public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* libgmp, libmpfr, RPATH, RUNPATH, LD_LIBRARY_PATH and gcc build options
@ 2008-01-07 10:20 Poor Yorick
  0 siblings, 0 replies; only message in thread
From: Poor Yorick @ 2008-01-07 10:20 UTC (permalink / raw)
  To: gcc-help

This is a followup to my previous question about RPATH and RUNPATH in gcc
binaries:

	http://gcc.gnu.org/ml/gcc-help/2008-01/msg00028.html

I built and installed gcc to an NFS mount and used it to build and install a
stack of software packages in the same area.  LD_LIBRARY_PATH is not used in
the environment, and because they can't use DT_RPATH and DT_RUNPATH, gcc
binaries were the only programs which couldn't find the correct libgmp and
libmpfr.  It seemed like the only good solution was to build gcc with static
libgmp and libmpfr, but if shared versions of those libraries exist, they get
used when building gcc, and there is no option to request the static
libraries. To work around this issue, I hid libgmp.so and libmpfr.so before
building gcc.  This is an excerpt from my build script:

	config_pre () {
		#can't embed RUNPATH or RPATH into gcc binaries
		# so make sure it builds with static gmp and mpfr

		for i in 'libgmp.so*' 'libmpfr.so*'; do
			find ../lib -iname "$i" | while read; do
				mv "$REPLY" "$REPLY".hide
			done
		done
	}

	link_pre () {
		#unhide libgmp and libmpfr
		for i in 'libgmp.so*.hide' 'libmpfr.so*.hide'; do
			find ../lib -iname "$i" | while read; do
				mv "$REPLY" "${REPLY%.hide}"
			done
		done
	}


Perhaps this will help someone who finds themselves in the same boat.  How about adding some configure options like --with-static-gmp and --with-static-mpfr to gcc?  Also, now that gcc binaries depend on external libraries, why not allow DT_RPATH and DT_RUNPATH into them? 

-- 
Yorick

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-05 22:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-07 10:20 libgmp, libmpfr, RPATH, RUNPATH, LD_LIBRARY_PATH and gcc build options Poor Yorick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).