Re: Passing arguments into LDFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Gallagher wrote:
> On 09/22/2010 08:08 AM, Paul F. Johnson wrote:
>> I know I can do the likes of 
>>
>> export CFLAGS="$CFLAGS -blah" and it will pass whatever CFLAGS is plus
>> the argument "-blah" to the compiler.
>>
>> How do I do this with LDFLAGS. I'm trying to pass --build-id using
>>
>> export LDFLAGS="$LDFLAGS --build-id"
>>
>> It's about the only way I can get mono to build currently!
>>
>> TTFN
>>
>> Paul
> 
> Try
> export LDFLAGS="$LDFLAGS -Wl,--build-id"
> 
> - -Wl, means "pass the part after the comma directly to the linker"

This.  When gcc is used to indirectly call ld, it won't always pass the 
$LDFLAGS to the linker.  To force it to you have to use the -Wl switch 
and replace all spaces in the switch with commas.  For example:

LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl--build-id -s"
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux