[PATCH] build: add -Wl,-rpath=path to $gmplibs (issue 7124057)

Jakub Jelinek jakub@redhat.com
Thu Jan 17 19:17:00 GMT 2013

On Thu, Jan 17, 2013 at 07:11:12PM +0000, minux.ma@gmail.com wrote:
> Reviewers: bonzini_gnu.org, dj_redhat.com, neroden_gcc.gnu.org,
> aoliva_redhat.com, ralf.wildenhues_gmx.de,
> Message:
> some systems (notably NetBSD), doesn't place the path where libgmp,
> libmpfr, libmpc resides into /etc/ld.so.conf, and instead rely on
> the binary providing correct -rpath; this patch adds the required
> -Wl,-rpath=path to $gmplibs so that when bootstrapping gcc,
> the various language frontends (cc1, etc) could run in that case.
> I assume all the linkers that gcc bootstraps with have support for
> the -rpath flag.
> Description:
> 2013-01-18  Shenghou Ma  <minux.ma@gmail.com>
> 	* configure.ac: add -Wl,-rpath=path to $gmplibs
> 	* configure: Re-generate.

This is wrong.  Not everybody wants RPATHs randomly added, the path
could be already searched by the dynamic linker, or it can be configured
against libgmp etc. in one path only to be later on moved to some path where
it will be searched by the dynamic linker.
So, whether to use -Wl,-rpath or not (you aren't testing at all whether
the compiler and linker support -Wl,-rpath, e.g. if you don't use gcc as
the initial compiler, it might not work, or if your linker doesn't) should
be decided based on configure options.


More information about the Gcc-patches mailing list