From owner-freebsd-toolchain@freebsd.org Wed Dec 9 17:56:53 2015 Return-Path: Delivered-To: freebsd-toolchain@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 00B679D57FA for ; Wed, 9 Dec 2015 17:56:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (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 BF7661254 for ; Wed, 9 Dec 2015 17:56:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0A52164E0; Wed, 9 Dec 2015 18:56:49 +0100 (CET) Subject: Re: ongoing link issues Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0014845B-C282-4F1F-AE3A-394AD2E9DD21"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Dimitry Andric In-Reply-To: <56685C44.10802@hiwaay.net> Date: Wed, 9 Dec 2015 18:56:48 +0100 Cc: FreeBSD toolchain mailing list !!!! Message-Id: References: <56685C44.10802@hiwaay.net> To: "William A. Mahaffey III" X-Mailer: Apple Mail (2.3112) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 17:56:53 -0000 --Apple-Mail=_0014845B-C282-4F1F-AE3A-394AD2E9DD21 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 09 Dec 2015, at 17:50, William A. Mahaffey III = wrote: >=20 > I am still trying to statically link my inhouse code. I switched to = using g++5 in the link line: ... > g++5 -o /usr/local/bin/PreBFCGL.opteron.TEST.static = -Wl,-s,--allow-multiple-definition,-rpath=3D/usr/local/lib/gcc5 Main.o = -L/home/wam/V8/Cnx/test/junk/cart/unstaggered/bfc/pre/../lib/R4/opteron = -L/home/wam/lib/R4 -L/usr/lib64/openmotif -Wl,--start-group -lmaiPre = -lPre -lPrecxx -lutils -lftndmp -lftnO2pre -lftnO2 -lBC_Phi -license = -Wl,--end-group -lMemIO -lMotif -lStdHash -lmpi -ltet -lgomp -lMrm -lXm = -lXt -lGL -lGLU -lGLw -lX11 -ljpeg -lpng -lz -lm -static-libgcc = -static-libstdc++ -Bstatic -lgfortran -static-libgfortran && \rm -f = Main.o > [wam@kabini1, ~, 10:51:48am] 917 % PreBFCGL.TEST > /lib/libgcc_s.so.1: version GCC_4.6.0 required by = /usr/local/lib/gcc48/libgfortran.so.3 not found > [wam@kabini1, ~, 10:51:52am] 918 % PreBFCGL.TEST.static > /lib/libgcc_s.so.1: version GCC_4.6.0 required by = /usr/local/lib/gcc48/libgfortran.so.3 not found > [wam@kabini1, ~, 10:52:02am] 919 % PreBFCGL.bdver1.TEST.static > /lib/libgcc_s.so.1: version GCC_4.6.0 required by = /usr/local/lib/gcc48/libgfortran.so.3 not found > [wam@kabini1, ~, 10:52:04am] 920 % uname -a Instead of all the complicated stuff above, can't you simply use -static while linking? I'm not sure why you want a half-dynamic, half-static executable? If you want to link *some* of the libraries statically, you must enclose these in a -Wl,-Bstatic ... -Wl,-Bdynamic pair. For example: -Wl,-Bstatic -lstdc++ -lgfortran -lgcc -Wl,-Bdynamic Also, you should probably link using gcc5 instead of g++5, otherwise the latter might add its own -lstdc++ arguments. -Dimitry --Apple-Mail=_0014845B-C282-4F1F-AE3A-394AD2E9DD21 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.28 iEYEARECAAYFAlZoa2AACgkQsF6jCi4glqM2/wCeO6gIUfPoNXEP0KaDGhXLsvfA FBoAn3Be4IfyG51ipDsctUItXHwi/FiH =Fqw6 -----END PGP SIGNATURE----- --Apple-Mail=_0014845B-C282-4F1F-AE3A-394AD2E9DD21--