Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #541 (new enhancement)

Opened 1 year ago

Last modified 4 months ago

Better GDC/mingw32 support

Reported by: larsivi Assigned to: larsivi
Priority: major Milestone: 1.0
Component: Packaging Version: 0.99.6 Jeff
Keywords: mingw, gdc, triage Cc: Profic, h3r3tic

Description

See this forum thread.

Attachments

tango-r3554-mingw32.patch (267 bytes) - added by jerdfelt on 06/04/08 14:17:59.
Patch for building with mingw32

Change History

07/11/07 06:06:38 changed by larsivi

  • type changed from defect to enhancement.

12/04/07 03:58:54 changed by larsivi

  • cc changed from Profic to Profic, h3r3tic.

h3r3tic added a patch to patches/

05/24/08 13:35:13 changed by larsivi

  • keywords changed from mingw, gdc to mingw, gdc, triage.

What is needed for Tango itself and/or build system these days to have Tango fully working on Mingw?

06/04/08 14:17:59 changed by jerdfelt

  • attachment tango-r3554-mingw32.patch added.

Patch for building with mingw32

06/04/08 14:19:38 changed by jerdfelt

  • version changed from 0.98 RC2 to 0.99.6 Jeff.

I've attached a patch for a small bug when compiling tango with mingw32. It assumes that only Linux systems use GNU compilers.

The patch switches a version block from "linux" to "GNU" since the code applies to GNU compilers and not just Linux systems.

06/04/08 14:27:37 changed by jerdfelt

I also have another problem with Threads and mingw32. The assembly code in lib/common/tango/core/Thread.d references the FS segment, which gdc doesn't like for some reason:

/tmp/ccpWsEPO.s: Assembler messages: /tmp/ccpWsEPO.s:139: Error: bad memory operand `' /tmp/ccpWsEPO.s:153: Error: bad memory operand `'

Commenting out the 6 references to FS (3 push and 3 pop) gets it to compile, but I suspect this isn't the correct fix. I haven't used threads yet to verify that it crashes.

I have quite a bit of assembly experience in the past, but not with GCC assembly so I'm not sure what the problem is. It might be a bug in GDC.

06/04/08 14:31:36 changed by h3r3tic

see patches/build-posix-mingw.patch for the trick for compiling Thread.d

06/04/08 14:33:55 changed by jerdfelt

Those were the only code problems I've found when building tango with mingw32.

However, cross-compiling is a *huge* mess. All of the GDC scripts and makefiles assume Posix which obviously isn't correct for mingw32. Also there are quite a few places where binary names are hardcoded when it needs a prefix for cross compiling.

Before I start digging into the build system, would there be any arguments against a patch that makes a significant change to handle cross-compiling correctly? I think much of the makefiles can stay, but the GDC build scripts will need some major overhaul.

06/04/08 15:24:05 changed by larsivi

jerdfeldt: great effort! as for cross-compilation, there is the build-gdc-x.sh script, is there very much more work than that needed?

When that is said, I'm interested in improvements to the build scripts, but preferably without any increase in (outwards) complexity.

06/04/08 15:25:35 changed by larsivi

Also, as for the version (linux) to version (GNU) - note that linux also means DMD on Linux - so just that switch may not be entirely correct?

06/04/08 16:50:59 changed by larsivi

Looked at the Thread patch - it seems to remove ThreadASM from the build, then modify the fs stuff a tad? It is very much defined as a hack there though.

06/04/08 18:14:04 changed by jerdfelt

The build-gdc-x.sh script has a few problems.

The first being it doesn't set the AR make variable so the built static libraries don't have the correct indexes for the symbols in the archive (since my Linux system ar doesn't understand windows objects I guess).

The second, which is the bigger issue, is the use of the gdc-posix makefile. Windows is not Posix and as a result, lots of hacking needs to be done to change Posix version references to mingw32.

Also, the build-tango.sh script assumes the local system is the target system, which is very much incorrect. Removing the use of uname is necessary here.

Much of this can be fixed. I was planning on merging build-gdc-x.sh into build-gdc.sh and fixing up build-tango.sh and install-gdc.sh similarly.

06/17/08 04:52:00 changed by larsivi

I would very much appreciate patches in this direction.