This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Spec strings to pass ‘-rpath’ for each ‘-L ’
- From: Ian Lance Taylor <iant at google dot com>
- To: Ludovic Courtès <ludo at gnu dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 13 Sep 2012 09:52:09 -0700
- Subject: Re: Spec strings to pass ‘-rpath’ for each ‘-L ’
- References: <87r4q5295d.fsf@gnu.org>
On Thu, Sep 13, 2012 at 9:13 AM, Ludovic Courtès <ludo@gnu.org> wrote:
>
> The page at <http://gcc.gnu.org/faq.html>, under “Dynamic linker is
> unable to find GCC libraries” reads:
>
> The short explanation is that if you always pass a -R option to the
> linker, your programs become dependent on directories which may be NFS
> mounted [...]
>
> However, if you feel you really need such an option to be passed
> automatically to the linker, you may add it to a GCC specs file. [...]
> You may add linker flags such as -R or -rpath, depending on platform
> and linker, to the *link or *lib specs.
>
> After spending some time looking at spec strings and at the manual, I
> can’t think of a way of emitting ‘-rpath LIBDIR’ for every ‘-LLIBDIR’
> encountered.
>
> Am I missing something?
I don't think so. I don't think there is a way to do that.
I think the FAQ is just suggesting adding -rpath options for a few
specific directories, not for every -L option. That suggestion was in
particular intended to address issues with finding libstdc++.so at
runtime.
Ian