From owner-freebsd-ports@freebsd.org Thu Aug 18 12:48:48 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 BCA44BBD67E; Thu, 18 Aug 2016 12:48:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E1EA16AB; Thu, 18 Aug 2016 12:48:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2a03:fc02:2:1:d8dd:a30a:c903:147b] (unknown [IPv6:2a03:fc02:2:1:d8dd:a30a:c903:147b]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9FB4A379A2; Thu, 18 Aug 2016 14:48:44 +0200 (CEST) Subject: Re: Problems with out libgcc_s.so in base Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_53D58B0A-3E40-425C-8251-062DB0ADB539"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6.1 From: Dimitry Andric In-Reply-To: <20160818111521.7f79b9f8@kalimero.tijl.coosemans.org> Date: Thu, 18 Aug 2016 14:48:28 +0200 Cc: Steve Kargl , freebsd-toolchain@freebsd.org, freebsd-ports@freebsd.org, kargl@uw.edu Message-Id: References: <20160814230351.GA10587@troutmask.apl.washington.edu> <20160814233430.GA35872@night.db.net> <20160817211710.GA59205@troutmask.apl.washington.edu> <20160818111521.7f79b9f8@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.3124) 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 12:48:48 -0000 --Apple-Mail=_53D58B0A-3E40-425C-8251-062DB0ADB539 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 18 Aug 2016, at 11:15, Tijl Coosemans wrote: >=20 > On Wed, 17 Aug 2016 14:17:10 -0700 Steve Kargl = wrote: ... >> % ldconfig -r | grep libgcc >> 6:-lgcc_s.1 =3D> /lib/libgcc_s.so.1 >> 735:-lgcc_s.1 =3D> /usr/local/lib/gcc6/libgcc_s.so.1 >>=20 >> 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. >=20 > 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. Well, even if you would adjust the compilers and linkers to look in /usr/local/lib first, how would you solve the problem of having multiple, possibly incompatible versions of the same library in different directories? For example, on one of my systems, I now have these: /usr/local/lib/gcc47/libgcc_s.so.1 /usr/local/lib/gcc48/libgcc_s.so.1 /usr/local/lib/gcc49/libgcc_s.so.1 /usr/local/lib/gcc5/libgcc_s.so.1 /usr/local/lib/gcc6/libgcc_s.so.1 /usr/local/lib/gcc7/libgcc_s.so.1 So which one are you going to put at the front of the path? The gcc7 version? If you are lucky that one is backwards compatible with all the previous ones, but still I would like it much better if a program compiled by, say, gcc5 was linked *explicitly* against the gcc5 version of libgcc_s.so. Steve's proposed scheme solves that quite nicely, in my opinion. The problem is only in the details, as usual. There will be many configure scripts and libtool-like utilities out there, that assume libgcc must be linked using -lgcc_s, not -lgcc_s$VERSION. -Dimitry --Apple-Mail=_53D58B0A-3E40-425C-8251-062DB0ADB539 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAle1rqsACgkQsF6jCi4glqNSkACgydIKGVVzIivLUMvS31yqvn6r WTgAn17Ir9XoD+c05qbjvHM7bHLn128Z =fwFb -----END PGP SIGNATURE----- --Apple-Mail=_53D58B0A-3E40-425C-8251-062DB0ADB539--