This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A question about RPATH


On 20 December 2012 00:15, Dennis Clarke wrote:
>
>> > I am a firm believer that LD_LIBRARY_PATH is evil, certainly
>> > at least dangerous and the
>> > output binary from any compile should have an RPATH set to
>> > ensure that the correct
>> > libs are found that the developer wanted.
>> >
>> > Having said all that, is there a magic
>> > LD_OPTIONS_INCANTATION=-Wl,-rpath=/usr/local/lib type thing
>> > to set to ensure I get my RPATH ?  I should point out
>> > this is trivial to do in the Solaris world and perhaps I am
>> > missing something really obvious here.

GCC does not tell the linker to set RPATH unless explicitly requested,
see http://gcc.gnu.org/faq.html#rpath

> So I will rebuild gcc with LD_RUN_PATH=/usr/local/lib:/usr/local/gcc4/lib64 and see what
> I get.

That's what I've done when building on Solaris, although in my case it
was for the runtime libs, not the gcc executables (see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354#c9). There has been
a suggestion to add a new configure option to set RPATHs, see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45508#c10


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]