cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.38k stars 289 forks source link

Building SheepShaver for x64 Windows #14

Open cat7 opened 11 years ago

cat7 commented 11 years ago

Hi, in an attempt to compile SheepShaver for x64 Windows (using latest mingw64 and msys) I fail at:

C:\Users\hsp\AppData\Local\Temp\ccXTNxEx.s: Assembler messages: C:\Users\hsp\AppData\Local\Temp\ccXTNxEx.s:1148: Error: can't resolve .text' {.text section} -_op_execute' {UND section} make: *\ [obj/basic-dyngen-ops.o] Error 1

How can this be fixed?

Best, Cat_7

asvitkine commented 11 years ago

I'm not sure. I assume x64 Windows build never previously worked, correct?

On Wed, Nov 7, 2012 at 3:27 PM, cat7 notifications@github.com wrote:

Hi, in an attempt to compile SheepShaver for x64 Windows (using latest mingw64 and msys) I fail at:

C:\Users\hsp\AppData\Local\Temp\ccXTNxEx.s: Assembler messages: C:\Users\hsp\AppData\Local\Temp\ccXTNxEx.s:1148: Error: can't resolve .text' {.text section} -_op_execute' {UND section} make: *\ [obj/basic-dyngen-ops.o] Error 1

How can this be fixed?

Best, Cat_7

— Reply to this email directly or view it on GitHubhttps://github.com/cebix/macemu/issues/14.

cat7 commented 11 years ago

Hi, yes, that is correct. Perhaps the issue is in the COFF part of dyngen.c ?

Basic-dyngen-ops.cpp has a remark about coff_text_shndx not being the same as text_shndx and seems to provide a workaround for Windows x64, which doesn't work (anymore?) Perhaps this is related? http://opencores.org/bug,view,1739

Got a bit more info after adding the -S compiler flags to DYNGEN_OP_FLAGS = -S -fomit-frame-pointer -falign-functions=0 -finline-limit=10000 -g0 -fno-reorder-blocks -fno-optimize-sibling-calls

gcc -I../kpx_cpu/include -I../kpx_cpu/src -DUSE_JIT -I../include -I. -I../slirp -DHAVE_CONFIG_H -O2 -c ../kpx_cpu/src/cpu/jit/dyngen.c -o obj/dyngen.ho

g++ -I../kpx_cpu/include -I../kpx_cpu/src -DUSE_JIT -I../include -I. -I../slirp -DHAVE_CONFIG_H -O2 -c ../kpx_cpu/src/cpu/jit/cxxdemang le.cpp -o obj/cxxdemangle.ho

g++ -o dyngen.exe obj/dyngen.ho obj/cxxdemangle.ho

./dyngen.exe -o basic-dyngen-ops.hpp obj/basic-dyngen-ops.o dyngen: bad COFF header

make: *\ [basic-dyngen-ops.hpp] Error 1

cat7 commented 11 years ago

I contacted a Qemu developer regarding 64 bit dyngen. This is what he answered:

The binary formats for 32 bit andfor 64 bit applications differ. See http://en.wikipedia.org/wiki/Portable_Executable for details. You can also use objdump to see the header data from *.o files. In your case, obj/basic-dyngen-ops.o is 64 bit Windows code. Try "file obj/basic-dyngen-ops.o" to see this.

QEMU's dyngen.c never supported the 64 bit Windows binary format:

 /* Check COFF identification.  */
 if (fhdr.f_magic != I386MAGIC) {
     error("bad COFF header");
 }

32 bit Windows uses the code marked with preprocessor macro CONFIG_FORMAT_COFF. For 64 bit Windows, you will need new code which is similar but not identical.