From owner-freebsd-ports@freebsd.org Thu Aug 18 09:16:40 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 5F6D2BBC21B; Thu, 18 Aug 2016 09:16:40 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay103.isp.belgacom.be (mailrelay103.isp.belgacom.be [195.238.20.130]) (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 3B55814E5; Thu, 18 Aug 2016 09:16:37 +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?A2AOBwC9e7VX/9SdgG1eDoM2SQ18t1qBf?= =?us-ascii?q?RyGAQKBZjkUAgEBAQEBAQFeJ0EBBAmEEAEFOhwjEAsOCgklDyoeBhMbiBq8PwE?= =?us-ascii?q?BAQEBAQQBAQEBI4p3ihsBBJlEhiCIdHGOYkiLc4N4HjaDPz06MgGCNjKERAEBA?= =?us-ascii?q?Q?= 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; 18 Aug 2016 11:15:24 +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 u7I9FLEk035401; Thu, 18 Aug 2016 11:15:22 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 18 Aug 2016 11:15:21 +0200 From: Tijl Coosemans To: Steve Kargl Cc: kargl@uw.edu, Diane Bruce , freebsd-toolchain@freebsd.org, freebsd-ports@freebsd.org Subject: Re: Problems with out libgcc_s.so in base Message-ID: <20160818111521.7f79b9f8@kalimero.tijl.coosemans.org> In-Reply-To: <20160817211710.GA59205@troutmask.apl.washington.edu> References: <20160814230351.GA10587@troutmask.apl.washington.edu> <20160814233430.GA35872@night.db.net> <20160817211710.GA59205@troutmask.apl.washington.edu> 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: Thu, 18 Aug 2016 09:16:40 -0000 On Wed, 17 Aug 2016 14:17:10 -0700 Steve Kargl wrote: > On Sun, Aug 14, 2016 at 07:34:30PM -0400, Diane Bruce wrote: >> On Sun, Aug 14, 2016 at 04:03:51PM -0700, Steve Kargl wrote: >>> Freebsd-ports could also use a wrapper: >>> % cat ~/bin/gfc7 >>> #! /bin/sh >>> DIR=`id -P sgk | sed 's/\:/\ /g' | awk '{print $9}'` >>> export DIR >>> >>> LD_LIBRARY_PATH=$DIR/work/7/lib >>> export LD_LIBRARY_PATH >>> >>> LD_RUN_PATH=$DIR/work/7/lib >>> export LD_RUN_PATH >>> >>> $DIR/work/7/bin/gfortran -fno-backtrace $@ >> >> Yes. I have also suggested we use a wrapper to the ports guys. > > I thought about this a bit, and cleaner solution might be > to add the program suffix to libgcc_s.so.1. For example, > > % cat foo.f90 > program foo > print *, 'Hello' > end program > % gfortran6 -o z foo.f90 && ./z > /lib/libgcc_s.so.1: version GCC_4.6.0 required by \ > /usr/local/lib/gcc6/libgfortran.so.3 not found > % ldconfig -r | grep libgcc > 6:-lgcc_s.1 => /lib/libgcc_s.so.1 > 735:-lgcc_s.1 => /usr/local/lib/gcc6/libgcc_s.so.1 > > Clearly, ldd is looking for 735 but finds 6. If the lang/gcc6 could > be convinced to build, install, and use libgcc_s6.so.1, then the > problem is solved without a wrapper. In this case the real cause of the problem is that compilers and linkers search /lib and /usr/lib last and ldconfig searches them first. Renaming the library is just a hack around that.