Auto-rpath revisited...

Alexandre Oliva oliva@dcc.unicamp.br
Sat Feb 21 14:20:00 GMT 1998


Ian Lance Taylor writes:

>    I'd suggest that the library path for libraries that gcc/g++ chooses
>    to link in automatically should be inserted automatically too.  This
>    would cover a quite common case of linking against several shared
>    libraries whose run-time directories you happen to know about with
>    libstdc++: you don't have to know where it lives, and it is
>    transparently linked in, so it should be transparently found at
>    run-time.

> I continue to feel that if the user explicitly specifies a -R or
> -rpath option, you should trust them.

> I would find it rather frustrating to want to set the rpath, and have
> gcc override me because it thought it knew better.

This is ok when you know what you're doing.  But most users don't know
g++ links -lstdc++ in, they just expect g++ to do the Right Thing
(TM).  *You* know what you're doing and what g++ will do, so you'll
just run gcc ... -R... -lstdc++, or g++ -nostdlib ... -lstdc++, which
will work.

I was just worried about C++ programs that rely on libtool libraries:
libtool would specify -rpath, but it wouldn't know where libstdc++
was, so that specification would be missing.  But then, if g++ did
implicitly append libstdc++ to the library path, it should implicitly
append its runtime directory too.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



More information about the Gcc mailing list