[Issue 15531] dmd.conf linker flags should be prepended instead of appended to subsequent linker flags

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 9 03:28:23 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15531

Mike Wey <mike at mikewey.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike at mikewey.eu

--- Comment #1 from Mike Wey <mike at mikewey.eu> ---
While pretending would solve the problems for the library paths, it will cause
problems with the actual libraries. (at leased with GNU ld).

This because libraries are only searched once for undefined symbols and in the
order in which they appear on the command line.

So if you are linking to a D library -lphobos should appear on the command line
after the d library and libraries phobos depends on after that.

One option around this is to use --start-group and --end group. The OSX version
of ld doesn't have these options, the OSX man page does say the placement of
the -l flag is significant.

--


More information about the Digitalmars-d-bugs mailing list