dmd's linking order

Sean Kelly sean at invisibleduck.org
Wed Apr 11 15:09:19 PDT 2012


On Apr 11, 2012, at 1:17 PM, Artur Skawina <art.08.09 at gmail.com> wrote:

> On 04/11/12 20:30, Jacob Carlborg wrote:
>> On 2012-04-11 16:59, Sean Kelly wrote:
>>> On Apr 11, 2012, at 1:25 AM, Jacob Carlborg<doob at me.com>  wrote:
>>> 
>>>> Could it happen that the linker arguments need to be placed first sometimes ?
>>> 
>>> If it's a user-created library then maybe. The general rule on Unix is that dependent objects need to be listed before the object they depend on.  I think the linker only does a single pass. Optlink doesn't have this problem--it's way nicer in this regard.
>> 
>> That would be the only case where optlink is nicer :)
>> 
> 
> Umm, "-( -llib1 -llib2 -)". 
> But using the correct order would be the right solution.

Didn't know that trick. I ran into this issue because it used to be possible to build druntime as three interdependent libraries (thus allowing the GC to be chosen at link time, for example) but it only ever worked on Windows. 


More information about the Digitalmars-d mailing list