From owner-freebsd-arch@freebsd.org Wed Mar 8 19:41:33 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB979D02515 for ; Wed, 8 Mar 2017 19:41:33 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 92C6114EC for ; Wed, 8 Mar 2017 19:41:33 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 9239DD02513; Wed, 8 Mar 2017 19:41:33 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C39D02512; Wed, 8 Mar 2017 19:41:33 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay119.isp.belgacom.be (mailrelay119.isp.belgacom.be [195.238.20.146]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B74314E9; Wed, 8 Mar 2017 19:41:32 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BUFwAvXcBY/0nD8VFeHAEBBAEBCgEBg?= =?us-ascii?q?ycqQRBBWYNgin+QWikBlQ6CDYJsgzYCgj9BFwECAQEBAQEBAWsohRYBBSMzIxA?= =?us-ascii?q?LGAICBSECAg8qHgYTigOwTIIminwBAQEBBgEBAQEkgQuKMoRUgwaCXwWcNo1Dh?= =?us-ascii?q?Gh2gSqPDZM+IAE2gQM3LAiHFD81ihMBAQE?= X-IPAS-Result: =?us-ascii?q?A2BUFwAvXcBY/0nD8VFeHAEBBAEBCgEBgycqQRBBWYNgin+?= =?us-ascii?q?QWikBlQ6CDYJsgzYCgj9BFwECAQEBAQEBAWsohRYBBSMzIxALGAICBSECAg8qH?= =?us-ascii?q?gYTigOwTIIminwBAQEBBgEBAQEkgQuKMoRUgwaCXwWcNo1DhGh2gSqPDZM+IAE?= =?us-ascii?q?2gQM3LAiHFD81ihMBAQE?= Received: from 73.195-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.195.73]) by relay.skynet.be with ESMTP; 08 Mar 2017 20:41:28 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id v28JfR3U052294; Wed, 8 Mar 2017 20:41:27 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Wed, 8 Mar 2017 20:41:26 +0100 From: Tijl Coosemans To: Dag-Erling =?UTF-8?B?U23DuHJncmF2?= Cc: Baptiste Daroussin , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2017 19:41:33 -0000 On Wed, 08 Mar 2017 16:39:50 +0100 Dag-Erling Sm=C3=B8rgrav 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 , 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.