About GCC and the -R option (a linker option I believe)

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat Apr 1 00:00:00 GMT 2000


> I have been reading the gcc manual entitled "Using and Porting the GNU
> Compiler Collection" but cannot find any documentation about the -R option
> used to include shared library directory paths in an executable.  I've
> used this option with gcc on my Solaris 2.7 machine and it works but it is
> not recognized by gcc on my HPUX10-20 machine. That's why I decided to
> actually look it up the gcc manual.

This option is not a gcc option, but a linker option. GCC recognizes
some of the assembler and linker options of the native tools, and
passes them through to those tools. What those options are highly
depends on the platform, and possibly on the exact version of the
assembler and linker.

It is safer to use use the -Wl, option of gcc to pass options to the
linker, that way, there is no confusion with options to other
passes. You'll have to look for the equivalent of -R in your linker
documentation, then.

Regards,
Martin



More information about the Gcc-help mailing list