From owner-freebsd-ports@freebsd.org Fri Aug 19 19:51:47 2016 Return-Path: Delivered-To: freebsd-ports@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 19C4CBBFEA8; Fri, 19 Aug 2016 19:51:47 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay106.isp.belgacom.be (mailrelay106.isp.belgacom.be [195.238.20.133]) (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 E3FE51470; Fri, 19 Aug 2016 19:51:45 +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?A2C9BQAMYrdX/9SdgG1eg0RJDXyrRIwsg?= =?us-ascii?q?X0chgECgWk5FAIBAQEBAQEBXieEXwEFJxMcIxALDgoJJQ8SGB4GE4gXAxu2NA2?= =?us-ascii?q?EDgEBAQEBAQQBAQEBI4p4gkOHWAEEmRM0hiCGO4I5cY5lSIdthAiDeB42ghIcg?= =?us-ascii?q?U46NIctAQEB?= Received: from 212.157-128-109.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([109.128.157.212]) by relay.skynet.be with ESMTP; 19 Aug 2016 21:50:32 +0200 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 u7JJoTcr066249; Fri, 19 Aug 2016 21:50:30 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 19 Aug 2016 21:50:28 +0200 From: Tijl Coosemans To: Konstantin Belousov Cc: Dimitry Andric , freebsd-toolchain@freebsd.org, freebsd-ports@freebsd.org, Steve Kargl , kargl@uw.edu Subject: Re: Problems with out libgcc_s.so in base Message-ID: <20160819215028.3d8e5b42@kalimero.tijl.coosemans.org> In-Reply-To: <20160819072813.GB83214@kib.kiev.ua> References: <20160814230351.GA10587@troutmask.apl.washington.edu> <20160814233430.GA35872@night.db.net> <20160817211710.GA59205@troutmask.apl.washington.edu> <20160818111521.7f79b9f8@kalimero.tijl.coosemans.org> <20160819011432.6f2eadbd@kalimero.tijl.coosemans.org> <20160819072813.GB83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 19:51:47 -0000 On Fri, 19 Aug 2016 10:28:14 +0300 Konstantin Belousov wrote: > The option which would fix all this mess is: > 1. add rpath for gcc lib/ directory into spec file > and > 2. make ports collection use its own compiler instead of fighting with > the base. That still doesn't cover all cases, e.g.: port exec -> base lib -> libgcc_s.so.1 -> port lib -> recent libgcc_s.so.1 An example is: % echo 'int main(void){}' > test.c % clang37 -o test test.c -lexecinfo -lgfortran -L/usr/local/lib/gcc5 -Wl,-rpath,/usr/local/lib/gcc5 % ./test /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc5/libgfortran.so.3 not found The base library (libexecinfo) doesn't have DT_RPATH or DT_RUNPATH so the only way rtld can find the right libgcc_s.so is if the executable (test) has DT_RPATH and no DT_RUNPATH. Clang runs ld with --enable-new-dtags so the executable has DT_RUNPATH. DT_RPATH is deprecated in the Linux world so there are probably more ports that use --enable-new-dtags. Another example seems to be Rust.