My AMD-64 experience (errors and all)
I went through an interesting experience trying to get Mupen64 working on my AMD 64 computer. A friend and I were interested in getting a 64-bit emulator for the N64, since we both have AMD 64s and wanted to at least see if it was any faster. This is all under linux, using Ubuntu (latest one, the 'Badger') with GCC 3.4.5. Here are the results of my tinkering:
(WARNING: Long post alert!)
Control:
I compiled Mupen64 on my laptop (as a control, it's an Intel Celeron based model) with suprisingly little warnings (in fact, I don't think there were any warnings). The only modification was that I changed the -mcpu=athlon line in the Makefile to -march=pentium3 (personal preference, and -mcpu is obsolete anyways). I also compiled the TR64 graphics plugin with the same modifications for the laptop.
The laptop runs the latest install of Foresight Linux, with gcc 3.4.4, FYI. Same library versions for everything else, AFAIK.
The AMD 64:
Mupen64 would not compile on the AMD 64 machine without some modification to the Makefile. First thing I did was change -mcpu=athlon to -march=k8, and added the -m64 flag (probably unnecessary). Then, I had to add the flag -fPIC in the Makefile, since the compiler would not finish compiling otherwise (complained that main.o would not compile without that specific option). Then, the compiler got stumped as soon as it hit glN64. The compiler compained of several "loses precision" errors. To circumvent this, I removed all references to glN64 from the Makefile. Now the program would compile, only without the glN64 plugin. The compiler gave several warnings this time, most of them saying either:
"warning: cast from pointer to integer of different size"
or
"pointer targets in assignment differ in signedness".
I can run both the GUI and non-GUI versions of the programs, but none of the demo roms on the download page work. The roms will 'load' fine, but when I hit the play button in the GUI, or when the ROM finished loading in the non-GUI, the program will crash and exit back to the terminal window I loaded them from.
The TR64 plugin would not run without modification to the source code. I had to remove everything marked NCopyTextureRGBA32 in texture.c (including the big function at the end of the file) before the code would compile. I modified the CFLAGS so they reflected the CFLAGS used to compile mupen64, and got similar warnings to the ones shown when I compiled mupen64. I do not know if the plugin works or not, since mupen64 will not run with either TR64 or the Soft GFX plugin. For reference, the TR64 plugin did not work (but did compile) on my laptop either when only the Makefile was modified, so with all that I'm going to assume that problems with this plugin not functioning on the AMD 64 machine do not necessarily relate to the machine having a 64 bit processor.
The Glide64 plugin flat out refused to compile on the AMD64 machine, giving several "loses precision" errors, similar to the ones given by glN64.
All roms I tested with both the dummy audio plugin and jttl's plugin, as well as both Blight's Input Plugin and the Mupen64 input plugin, to eliminate those as possibilities for Mupen64 crashing. The exact same error was given each time, by both the GUI and non-GUI programs. However, the GUI and non-GUI programs themselves report differing errors. The GUI gives:
"Signal number 11 caught:
errno = 0 (Success)"
whereas the non-GUI gives:
"Fatal signal: Segmentation Fault (SDL Parachute Deployed)". Both programs report their respective errors consistently each time I try to run a test ROM with them (regardless of the test rom).
In short, the important stuff compiles on an x86-64 processor, but no ROMs work. The graphics plugins seem to have problems compiling, except the Soft GFX plugin.
I'm writing this as part massive bug report, part 'it-works-this-far' message. I hope this post helps out, please let me know if there is something I should be doing, or if there is something anyone wants me to do!
Not sure what all will be helpful, so I'll attach the following:
Attachments:
mod-output.txt - Output of 'make' with all modifications to Makefile.
cflags-output.txt - Output of 'make' with only CFLAGS changed.
orig-output.txt - Output of 'make' with only mcpu=athlon changed to march=k8 (will not compile otherwise)
Makefile.txt - Fully modified makefile (with glN64 commented out and CFLAGS changed (uncommented CFLAGS are the minimal needed, will not compile without those two; second commented CFLAGS from the top are my modified optimized CFLAGS, that work))
I also have the code compiled with no optimizations and the Makefile completely modified for debugging, but it's too big to be attached.
Hope I've helped in some way!