Re: Adding default RUNPATH to compiled binaries

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

 



On Sun, 11 Dec 2011, Maciej (Matchek) Bliziński wrote:

I've seen this topic discussed many times. The problem seems to come
up every time gcc is compiled with prefix != /usr/bin. The way to
reproduce it is simple:

echo "int main() {}" > t.c; g++ -o t t.c ; ./t

The result:

ld.so.1: t: fatal: libstdc++.so.6: open failed: No such file or directory
Killed

I just had a bug filed against my gcc packages[1].  I did some
research, and I found information about a number of approaches, which
aren't really consistent and none of them is explained or
self-explanatory.

In some instances GCC sources were patched[2], in other the spec
information was dumped, modified and placed where it would be taken as
the default[3].

What's the recommended way of doing it?

Whether you patch the builtin specs or provide a specs file that overrides them doesn't really matter, it is roughly equivalent. What does matter and requires some thought is what you want to put in there. Make sure you handle -m32/-m64. Determine if you always want to do something or only when -lgcc_s is there. Chose between passing ld a -R flag or a -c flag. etc.

--
Marc Glisse


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux