DDoS / GBAiD

A GameBoy Advance emulator in D
MIT License
83 stars 3 forks source link

64-bit compilation broken on Windows & Linux #2

Open mdparker opened 9 years ago

mdparker commented 9 years ago

With the package.json patch in #1, compilation fails on Windows with the following:

src\gbaid\graphics.d(533): Error: bad type/size of operands 'test'

I don't know anything about x86_64 assembly, so I haven't even tried to fix it.

mdparker commented 9 years ago

I just tried to compile on my 64-bit Linux Mint partition with 64-bit DMD and got the same error.

DDoS commented 9 years ago

Can you also try compiling with LDC?

DDoS commented 9 years ago

I got it to compile as 32 bit on Windows 8.1, but I can't get it to link, DMD's OPTLINK gives me an "Error 16: index range"

mdparker commented 9 years ago

I haven't installed LDC in ages. I'll look into it later. For now, I'm running Dustmite to see if I can reduce the OPTLINK error.

mdparker commented 9 years ago

After 14 hours, 41 minutes, 35 secs and 563 ms, dustmite has reduced it all down to an empty module named gl.d. Of course, that does not cause the error since there' s nothing left to link. I have no other ideas right now on how to proceed.

DDoS commented 9 years ago

Building in release mode using DMD on OS X also has broken linking, here's the error:

Undefined symbols for architecture x86_64:
"_D3std9exception138__T12errnoEnforceTbVAyaa52_2f7573722f6c6f63616c2f43656c6c61722f646d642f322e3036362e312f696e636c7564652f64322f7374642f737464696f2e64Vmi717Z12errnoEnforceFNfbLAyaZb", referenced from:
_D3std5stdio4File14__T7rawReadTvZ7rawReadMFAvZAv in gbaid.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1

This seems to point to rawRead, which AFAIK is only called in memory.d near the bottom of the file.

Maybe the two are related?

Edit: commenting out the 3 rawRead calls in memory.d loadFromFile fixes this linking issue. This looks like a problem with DMD.

Edit 2: This did not fix linking on Windows.

DDoS commented 7 years ago

I have successfully built it on 64bit Ubuntu in release mode, but the environment I'm using is headless, so I can't do a full test (no video or audio output). It did run 5 seconds of emulation at full speed without any errors, so I'm pretty sure it's working now.