Setting the dynamic linker with an environment variable

Shaun Jackman sjackman@gmail.com
Wed Sep 10 18:00:00 GMT 2014


On 9 September 2014 17:13, Ian Lance Taylor <iant@google.com> wrote:
> On Tue, Sep 9, 2014 at 3:30 PM, Shaun Jackman <sjackman@gmail.com> wrote:
>> Alternatively, how can I modify the default `specs` file of GCC to add
>> to the default linker options
>> -L$prefix/lib -Wl,-rpath,$prefix/lib -Wl,--dynamic-linker
>> $prefix/lib/ld-linux-x86-64.so.2
>
> If you want to go that route, add it to the line after "*link:" in the
> specs file.

That worked like a charm! Thanks, Ian. I replaced the link spec like so:

*link:
-L/home/sjackman/.linuxbrew/lib -rpath /home/sjackman/.linuxbrew/lib
--dynamic-linker /home/sjackman/.linuxbrew/lib/ld-linux-x86-64.so.2

How do I remove the following four directories from the library search
path, while still retaining the $prefix/lib and $prefix/lib/gcc/*
directories?

/lib64 /usr/lib64 /lib /usr/lib

Thanks again,
Shaun



More information about the Gcc-help mailing list