how to add RPATH and RUNPATH to gcc binaries themselves

Poor Yorick
Sat Jan 5 17:13:00 GMT 2008

I compiled and installed gcc 4.2.2 on an NFS mount accessible to a compute grid.  I have compiled approximately 50 other apps with this gcc instance, baking RPATH into the binaries with the following environment setting:

	LDFLAGS="-L$base/lib -Wl,-rpath,$base/lib -Wl,--enable-new-dtags ${LDFLAGS-}"                                            

I built and installed gcc itself using this same environment, but gcc, gforftran,etc., did not get an RPATH or RUNPATH.  LDFLAGS is usually sufficient for this  purpose, but not when building gcc, it seems.  What is the best way to get RPATH and RUNPATH into gcc itself?


More information about the Gcc-help mailing list