[ghudson@MIT.EDU: Re: -Xlinker and LDFLAGS]
Alexandre Oliva
aoliva@redhat.com
Thu Jan 11 08:35:00 GMT 2001
On Jan 11, 2001, Richard Stallman <rms@gnu.org> wrote:
> Would it be feasible to make gcc understand the linker -R argument for
> GNU/Linux? It looks like that would be useful.
We've gone over this issue in one of the GCC mailing lists.
GCC only accepts -R on Solaris to be compatible with Sun's C Compiler.
Supporting -R on GNU/Linux too might give people the impression that
-R is a portable switch in GCC, and then, they might start asking why
-R doesn't work on other platforms.
The answer is simple: -R is not a compiler switch, it's a linker
switch on Solaris, that Sun's C Compiler used to pass through to the
linker, GCC does similarly on Solaris for compatibility, and GNU ld
accepts for compatibility with Solaris' linker. The GNU ld switch is
-rpath. Other linkers have different switches that convey the same
meaning, or require environment variables to be set to convey that
meaning, or take switches such as -L to implicitly have the same
meaning as -R.
The point is that, spelled -R or -rpath, it's a switch to the linker,
and the syntax to pass a switch to the linker in GCC is -Wl, or
-Xlinker. Accepting -R in GCC would give people a false sense of
portability.
This is my opinion on this subject. Others' may differ.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
More information about the Gcc
mailing list