Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2017 20:41:26 +0100
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        Dag-Erling =?UTF-8?B?U23DuHJncmF2?= <des@des.no>
Cc:        Baptiste Daroussin <bapt@FreeBSD.org>, ports@FreeBSD.org, arch@FreeBSD.org
Subject:   Re: manpath change for ports ?
Message-ID:  <20170308204126.6d152c44@kalimero.tijl.coosemans.org>
In-Reply-To: <86mvcvojzt.fsf@desk.des.no>
References:  <20170306235610.cmpxk27jhoafel6l@ivaldir.net> <86mvcvojzt.fsf@desk.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 08 Mar 2017 16:39:50 +0100 Dag-Erling Sm=C3=B8rgrav <des@des.no> wr=
ote:
> 4) Remove the hardcoded library path in lang/gcc*
>=20
> This makes it possible to work on software that includes both libraries
> and programs while an earlier copy of the same software is already
> installed.  With the current state of gcc, the programs you are working
> on will be linked against the version of the library that's already
> installed instead of the version you just compiled, and there is nothing
> you can do to prevent it.  You won't notice anything if all you ever do
> is "make && make install", because the new library will replace the old,
> but if you try to run your program directly from the build tree, it will
> use the wrong library.  This can be incredibly frustrating if you're not
> aware of it - imagine you're trying to fix a bug in that library and no
> matter what you do, your regression test keeps failing...

If you want to run a program from its build directory and the program
links to a library also in the build directory then you have to run the
program with LD_LIBRARY_PATH environment variable set to the build
directory.  Or, you could link the program with -rpath <builddir>, but
then you should relink it before installation.  It's one of the things
libtool takes care of automatically.

If this is the problem you have then it has nothing to do with gcc.  If
you're not using libtool then your program probably does not have any
rpath or runpath so it falls back on rtld/ldconfig which may find it in
/usr/local/lib.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170308204126.6d152c44>