From owner-svn-src-all@freebsd.org Thu Aug 25 23:52:54 2016 Return-Path: Delivered-To: svn-src-all@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 DB3D7BC6269; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B49D81B05; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A806816C1; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 673F01DD1E; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id fMGBvwkjVP2k; Thu, 25 Aug 2016 23:52:50 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DD90C1DD16 To: Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> Date: Thu, 25 Aug 2016 16:52:44 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 23:52:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07 Content-Type: multipart/mixed; boundary="itIFAicGN9GH2MlTRrtx69i2OwwcFwagB" From: Bryan Drewery To: Ed Schouten Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> In-Reply-To: --itIFAicGN9GH2MlTRrtx69i2OwwcFwagB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/25/2016 1:55 PM, Ed Schouten wrote: > Hi Bryan, >=20 > 2016-08-25 19:43 GMT+02:00 Bryan Drewery : >>>> readelf -a /lib/libc.so.7|grep basename >>> 2149: 0000000000076200 231 FUNC GLOBAL DEFAULT 11 >>> basename@@FBSD_1.0 (2) >>> 2514: 0000000000076140 184 FUNC GLOBAL DEFAULT 11 >>> basename_r@@FBSD_1.2 (4) >=20 > I think the reason for this is that I haven't made any changes to the > underlying basename() function (yet); only to dirname(). So there is > no basename@FBSD_1.0. Only basename@@FBSD_1.0 (to indicate it's the > latest version against we should link). >=20 It only happens with static builds which lack the 1.0 symbol: > # readelf -a /usr/lib/libc.a|grep basename > File: /usr/lib/libc.a(basename.o) > 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS /root/git/fr= eebsd/lib/libc/gen/basename.c > 2: 0000000000000000 8 OBJECT LOCAL DEFAULT 5 basename.bna= me > 6: 00000000000000c0 231 FUNC GLOBAL DEFAULT 2 basename > 7: 0000000000000000 184 FUNC GLOBAL DEFAULT 2 basename_r With dynamic it is fine: > # readelf -a /lib/libc.so.7|grep basename > 2149: 0000000000078280 231 FUNC GLOBAL DEFAULT 11 basename@@FB= SD_1.0 (2) > 2514: 00000000000781c0 184 FUNC GLOBAL DEFAULT 11 basename_r@@= FBSD_1.2 (4) > What happens if you s/__sym_compat/__sym_default the basename() line? >=20 >=20 Libc wouldn't build, it complained quite loudly with a lot of these: > fatal error: error in backend: A @@ version cannot be undefined With this it built: > diff --git lib/libc/gen/basename.c lib/libc/gen/basename.c > index 7e21ca4..5f35613 100644 > --- lib/libc/gen/basename.c > +++ lib/libc/gen/basename.c > @@ -66,7 +66,7 @@ basename_r(const char *path, char *bname) > } >=20 > char * > -basename(char *path) > +(basename_impl)(char *path) > { > static char *bname =3D NULL; >=20 > @@ -77,3 +77,4 @@ basename(char *path) > } > return (basename_r(path, bname)); > } > +__sym_default(basename, basename_impl, FBSD_1.0); Perhaps there is a better way, but it worked... Then I get: > # readelf -a /lib/libc.so.7|grep basename > 2145: 0000000000078280 231 FUNC GLOBAL DEFAULT 11 basename@@FB= SD_1.0 (2) > 2514: 00000000000781c0 184 FUNC GLOBAL DEFAULT 11 basename_r@@= FBSD_1.2 (4) > # readelf -a /usr/lib/libc.a|grep basename > File: /usr/lib/libc.a(basename.o) > 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS /root/git/fr= eebsd/lib/libc/gen/basename.c > 2: 0000000000000000 8 OBJECT LOCAL DEFAULT 5 basename_imp= l.bname > 6: 00000000000000c0 231 FUNC GLOBAL DEFAULT 2 basename@@FB= SD_1.0 > 7: 00000000000000c0 231 FUNC GLOBAL DEFAULT 2 basename_imp= l > 8: 0000000000000000 184 FUNC GLOBAL DEFAULT 2 basename_r And xinstall builds with dynamic and static and runs fine. --=20 Regards, Bryan Drewery --itIFAicGN9GH2MlTRrtx69i2OwwcFwagB-- --pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXv4TPAAoJEDXXcbtuRpfPo9oH/0m/J/ETN+vqXi2gVmo9HRqR xRUxfzBbZjBnCi97roHQrWp/g22Hw4ShHfByWRkWUNpqz+HKIwogNdUvdWne+gin XHg2ygBSkKE3jLYXQGYzm8e+1sXslyyAeStuGSHLZjZxjXtLhILMu064xGnmYAUR ZJozhzcAhqxmZ4B2WXDv3qAsIqBFs+84BDT5vkUPOPL6SBriUcED3TowobUZjHY8 AnUDOCYAXFga0opNjVUtdbe0FPLNH3E5H4LVClm4NnbZK1xRq358EZZk8X3ptS35 kCA96tjCLgAeOwrxvGT5PUNHBmE5M1GV6DzHoBTXDWoDCE1BzHSkgvjDcphRgcM= =3Ct7 -----END PGP SIGNATURE----- --pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07--