Home Page

Cross compiling

Posted By: jpcw

Cross compiling - 12/27/15 12:10 AM

I have been trying to compile up sdlmame for the pcduino (arm) however keep running out of space so I decided to have a go at cross compiling. I’ve setup the cross compiler and done a compile test on uboot and all seems ok but when compiling sdlmame I get a mame64 which the Linux file command shows as “mame64: ELF 64-bit LSB executable, x86-64,”

From what I can see the make file is looking at the uname –a results to autodetect the architecture and setting the ARCH environment variable doesn’t seem to override. Are there any parameters that I should be using or is there another trick to it?
Posted By: jpcw

Re: Cross compiling - 12/27/15 02:53 AM

Gotten a little further. It now seems to recognise the arm target but I now get the following error


root@ubuntudev:/home/john/mame-0.164# make
os_mkdir.c
gcc: error: arm: No such file or directory
make[1]: *** [obj/Release/src/host/os_mkdir.o] Error 1
make: *** [3rdparty/genie/bin/linux/genie] Error 2
Posted By: R. Belmont

Re: Cross compiling - 12/27/15 03:12 AM

There is some limited support for cross compiling if you make CROSS_BUILD=1 which allows e.g. building a Windows binary on desktop Linux with the MinGW tools installed, but the machine architectures match in that case. Micko will hopefully see this in a few hours when he's up and give a definitive answer.
Posted By: jpcw

Re: Cross compiling - 12/27/15 03:15 AM

Ok thanks, CROSS_BUILD=1 doesn't help any
Posted By: Micko

Re: Cross compiling - 12/27/15 01:21 PM

jpcw: Thing is that genie needs to be compiled with host tools (for that it use CC and CXX) for setting cross-build tools you need to set OVERRIDE_CC and OVERIDE_CXX to point to arm tools.

If you would be so kind to send me some instructions about which cross tools are you using and how can I get them to my email it would be great. I could then test it my self and change genie scripts if needed.

My mail is : mmicko@gmail.com
Micko
Posted By: jpcw

Re: Cross compiling - 12/27/15 02:38 PM

Thanks Micko, I've tried several different guides on setting up the cross compilers so instructions are a bit confused at the moment. I'll go through and redo it so I have a clean set of details so you don't waist any of your time. Will probably be Tuesday before I can get back to you.
Posted By: Micko

Re: Cross compiling - 12/28/15 06:21 PM

Sure, no problem. It will not be for release but we will have time to test and make it work properly.
Posted By: jpcw

Re: Cross compiling - 12/29/15 05:42 AM

Actually don't worry about the cross compile for the moment as I've managed to get most of the way there on the pcduino itself by using an SD card. (although happy to work with you if you want to just for the sake of getting it going)

I've managed to get the base compile done however during the linking I now get the below error, any ideas?

Linking mame...
../../../../../scripts/src/mame_mame/libemu.a(romload.o): In function `load_software_part_region(device_t&, software_list_device&, char const*, rom_entry const*)':
romload.c:(.text+0x3200): warning: memset used with constant zero length parameter; this could be due to transposed parameters
/usr/bin/ld: ../../../../../scripts/src/osd/mame_mame/libosd_sdl.a(sdlmain.o): undefined reference to symbol 'SDL_GetVideoDriver'
//usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [../../../../../mame] Error 1
make[1]: *** [mame] Error 2
make: *** [linux] Error 2
Posted By: jpcw

Re: Cross compiling - 12/29/15 06:21 AM

I ran the make with VERBOSE=1 and then took the command line that errored and added -lSDL2 to the end and ran it manually, taking substantially longer now so getting further. I'll see what the next step is once this finishes
Posted By: jpcw

Re: Cross compiling - 12/29/15 07:23 AM

Ok no go. after over an hour came back with pages of similar to below

cga.c:(.text+0x26f8): undefined reference to `isa8_device::install_bank(unsigned int, unsigned int, unsigned int, unsigned int, char const*, unsigned char*)'
cga.c:(.text+0x27f4): undefined reference to `isa8_device::install_memory(unsigned int, unsigned int, unsigned int, unsigned int, device_delegate<unsigned char (address_space&, unsigned int, unsigned char)>, device_delegate<void (address_space&, unsigned int, unsigned char, unsigned char)>)'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_cga_pc1512_device::isa8_cga_pc1512_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x2de0): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x2eb2): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_wyse700_device::isa8_wyse700_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x31d8): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x32aa): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_ec1841_0002_device::isa8_ec1841_0002_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x330c): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x33d2): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_cga_mc1502_device::isa8_cga_mc1502_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x3434): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x3506): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_cga_iskr1031_device::isa8_cga_iskr1031_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x3568): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x362e): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_cga_iskr1030m_device::isa8_cga_iskr1030m_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x3690): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x3756): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_cga_m24_device::isa8_cga_m24_device(machine_config const&, char const*, device_t*, unsigned int)':
cga.c:(.text+0x37b8): undefined reference to `device_isa8_card_interface::device_isa8_card_interface(machine_config const&, device_t&)'
cga.c:(.text+0x3886): undefined reference to `device_isa8_card_interface::~device_isa8_card_interface()'
../../../../../scripts/mame_mame/libbus.a(cga.o): In function `isa8_cga_device::device_start()':
cga.c:(.text+0x3d0c): undefined reference to `device_isa8_card_interface::set_isa_device()'

alto2cpu.c:(.text+0xc50): undefined reference to `alto2_cpu_device::exit_ether()'
alto2cpu.c:(.text+0xc5c): undefined reference to `alto2_cpu_device::exit_emu()'
../../../../../scripts/mame_mame/liboptional.a(alto2cpu.o): In function `alto2_cpu_device::hard_reset()':
alto2cpu.c:(.text+0x363e): undefined reference to `alto2_cpu_device::init_emu(int)'
alto2cpu.c:(.text+0x364e): undefined reference to `alto2_cpu_device::init_ether(int)'
collect2: error: ld returned 1 exit status
© 2020 Forums