Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building SheepShaver for x64 Windows #14

Open
cat7 opened this issue Nov 7, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@cat7
Copy link

commented Nov 7, 2012

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

This comment has been minimized.

Copy link
Collaborator

commented Nov 8, 2012

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//issues/14.

@cat7

This comment has been minimized.

Copy link
Author

commented Nov 8, 2012

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

This comment has been minimized.

Copy link
Author

commented Nov 14, 2012

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.

JustinCB pushed a commit to JustinCB/macemu that referenced this issue Apr 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.