dmd -Wl=comma_separated_linker_flags (cf clang++ -Wl, comma_separated_linker_flags)

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 20 18:53:39 PST 2017


relying on the shell (especially involving arrays) seems like a bad
idea: not portable, easy to mess up:

`dmd -L{-lbar,-Ldir,--export-dynamic}` works but what if it's stored in $lflags:

lflags="-lbar,-Ldir,--export-dynamic"

the function to convert $lflags to a dmd-appropriate flag is not so
simple; what do you suggest for that case?




On Mon, Feb 20, 2017 at 5:26 PM, Nicholas Wilson via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Tuesday, 21 February 2017 at 00:33:27 UTC, Timothee Cour wrote:
>>>
>>> Just use shell expansions?
>>> dmd -Wl,-{lbar,Ldir,-export-dynamic,pie}
>>
>>
>> This doesn't work :  unrecognized switch '-Wl...'
>>
>> On Sun, Dec 11, 2016 at 3:36 PM, Guillaume Boucher via Digitalmars-d
>> <digitalmars-d at puremagic.com> wrote:
>>>
>>> On Sunday, 11 December 2016 at 21:39:26 UTC, Timothee Cour wrote:
>>>>
>>>>
>>>> is there a way to pass linker flags?
>>>> dmd -Wl=comma_separated_linker_flags
>>>> eg:
>>>> dmd -Wl=-lbar,-Ldir,--export-dynamic,-pie
>>>>
>>>> (same functionality as clang++ -Wl,-lbar,-Ldir,--export-dynamic,-pie)
>>>>
>>>> If not could we support it? Would make a lot of things easier.
>>>
>>>
>>>
>>> Just use shell expansions?
>>>
>>> dmd -Wl,-{lbar,Ldir,-export-dynamic,pie}
>
>
> linker flag is prefix is `-L` e.g. `-L-lbar` to link bar.


More information about the Digitalmars-d mailing list