MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

PaddyMac
MAME Fan
Reged: 02/12/13
Posts: 2
Send PM


ld: unrecognised emulation mode: 64
#304174 - 02/12/13 06:47 AM


I'm trying to write an updated Gentoo ebuild for MAME 0.148. I've made quite a bit of progress, but I've hit a roadblock. Here's a snippet of output.

x86_64-pc-linux-gnu-ld -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -m64 obj/sdl/build/verinfo.o obj/sdl/libocore.a -lexpat -lz -lFLAC -lm -ljpeg -lportmidi `pkg-config --libs alsa` -L/usr/lib64/qt4 -lQtGui -lQtCore `sdl-config --libs` `pkg-config --libs fontconfig` -lSDL_ttf -lm -lutil -lX11 -lXinerama `pkg-config --libs gtk+-2.0` `pkg-config --libs gconf-2.0` `pkg-config QtGui --libs` -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/openwin/lib -o obj/sdl/build/verinfo
Linking obj/sdl/build/m68kmake...
x86_64-pc-linux-gnu-ld -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -m64 obj/sdl/emu/cpu/m68000/m68kmake.o obj/sdl/libocore.a -lexpat -lz -lFLAC -lm -ljpeg -lportmidi `pkg-config --libs alsa` -L/usr/lib64/qt4 -lQtGui -lQtCore `sdl-config --libs` `pkg-config --libs fontconfig` -lSDL_ttf -lm -lutil -lX11 -lXinerama `pkg-config --libs gtk+-2.0` `pkg-config --libs gconf-2.0` `pkg-config QtGui --libs` -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/openwin/lib -o obj/sdl/build/m68kmake
x86_64-pc-linux-gnu-ld: unrecognised emulation mode: 64
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
make: *** [obj/sdl/build/verinfo] Error 1
make: *** Waiting for unfinished jobs....
x86_64-pc-linux-gnu-ld: unrecognised emulation mode: 64
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
make: *** [obj/sdl/build/m68kmake] Error 1
make: *** wait: No child processes. Stop.

From what I understand, -m32 or -m64 is a valid flag for gcc, but it is not a valid flag for the linker, ld. So I edited src/osd/sdl/sdl.mak and commented out the lines which add -m32 or -m64 to LDFLAGS. However, the compile failed at the same point with the following output.

Linking obj/sdl/build/verinfo...
x86_64-pc-linux-gnu-ld -Wl,-O1 -Wl,--sort-common -Wl,--as-needed obj/sdl/build/verinfo.o obj/sdl/libocore.a -lexpat -lz -lFLAC -lm -ljpeg -lportmidi `pkg-config --libs alsa` -L/usr/lib64/qt4 -lQtGui -lQtCore `sdl-config --libs` `pkg-config --libs fontconfig` -lSDL_ttf -lm -lutil -lX11 -lXinerama `pkg-config --libs gtk+-2.0` `pkg-config --libs gconf-2.0` `pkg-config QtGui --libs` -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/openwin/lib -o obj/sdl/build/verinfo
Linking obj/sdl/build/m68kmake...
x86_64-pc-linux-gnu-ld: unrecognized option '-Wl,-O1'
x86_64-pc-linux-gnu-ld: use the --help option for usage information
make: *** [obj/sdl/build/verinfo] Error 1
make: *** Waiting for unfinished jobs....
x86_64-pc-linux-gnu-ld -Wl,-O1 -Wl,--sort-common -Wl,--as-needed obj/sdl/emu/cpu/m68000/m68kmake.o obj/sdl/libocore.a -lexpat -lz -lFLAC -lm -ljpeg -lportmidi `pkg-config --libs alsa` -L/usr/lib64/qt4 -lQtGui -lQtCore `sdl-config --libs` `pkg-config --libs fontconfig` -lSDL_ttf -lm -lutil -lX11 -lXinerama `pkg-config --libs gtk+-2.0` `pkg-config --libs gconf-2.0` `pkg-config QtGui --libs` -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/openwin/lib -o obj/sdl/build/m68kmake
x86_64-pc-linux-gnu-ld: unrecognized option '-Wl,-O1'
x86_64-pc-linux-gnu-ld: use the --help option for usage information
make: *** [obj/sdl/build/m68kmake] Error 1
make: *** wait: No child processes. Stop.

I'm compiling with the following command:
make -j3 all TARGET=mame BUILD_EXPAT=0 BUILD_FLAC=0 BUILD_JPEGLIB=0 BUILD_MIDILIB=0 BUILD_ZLIB=0 NOWERROR=1 NO_X11=0 DEBUG=0 NO_DEBUGGER=1 NO_OPENGL=0 PROFILER=0 USE_QTDEBUG=0 NO_USE_XINPUT=1

If anyone has any ideas, I'd certainly appreciate it!



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: ld: unrecognised emulation mode: 64 new [Re: PaddyMac]
#304213 - 02/13/13 03:13 AM


I don't know the specifics of ebuilds; I do know that Olivier Galibert is currently running MAME on Gentoo and so the standard build process does work there.

You might have better luck on the actual non-Windows MAME forum.



PaddyMac
MAME Fan
Reged: 02/12/13
Posts: 2
Send PM


Re: ld: unrecognised emulation mode: 64 new [Re: R. Belmont]
#304263 - 02/14/13 05:08 AM


I figured out the problem and solution. The problem was caused by a combination of a patch I wrote and a misunderstanding of MAME's build system. On Gentoo, everything is configurable, or at least that is the intention, so that the user can customize everything - including various compilation options. Makefiles should respect the user's settings, so I patched the makefile to use the system's LDFLAGS, compiler of choice, etc.

The problem was that I made sure the the Makefile gets the value of $(LD) from the user's environment, and that is typically the ld from binutils. However, MAME's build system expects $(LD) to be g++. So due to my initial patch, the build system was calling ld directly instead of the expected g++.

My solution was to change every instance of $(LD) in the makefiles to $(CXX) so that the user's custom settings can still be respected while also ensuring that MAME's build system requirements are met.

However, I know that an increasing number of people are migrating from GCC to Clang (and some may use Intel's compiler). I'm not sure how people who don't use GCC will be affected. Perhaps MAME's makefiles could be edited to be happy with a direct call to ld so as to be happy regardless of which compiler a user is running. Perhaps this is something that could take place upstream, but I'll make mention of it to the Gentoo devs as it may be something which will primarily or only be a Gentoo issue (if it's really an issue at all).


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 346 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4041