Spec strings to pass ‘-rpath’ for each ‘-L’

Ludovic Courtès ludo@gnu.org
Thu Sep 13 20:26:00 GMT 2012


Hi Marc,

Marc Glisse <marc.glisse@inria.fr> skribis:

> On Thu, 13 Sep 2012, Ludovic Courtès wrote:
>
>> Hi,
>>
>> 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.
>
> %{L*:-rpath %*} maybe?

Woow, indeed!

What about adding it as an example to the FAQ entry, and/or to the “Spec
Files” node of the manual?  For instance along these lines:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 814 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120913/6972b506/attachment.bin>
-------------- next part --------------

Regarding that section of the manual, I was also confused by the use of
the verb “to substitute” not followed by “with” or “for”.  “Expands to”
(as for macros) would seem more appropriate to me.  WDYT?

Thanks!

Ludo’.


More information about the Gcc-help mailing list