Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2016 16:52:44 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Ed Schouten <ed@nuxi.nl>
Cc:        Guido Falsi <madpilot@freebsd.org>, svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers <src-committers@freebsd.org>, Ed Schouten <ed@freebsd.org>
Subject:   Re: svn commit: r303988 - head/lib/libc/gen
Message-ID:  <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org>
In-Reply-To: <CABh_MKkk4Lf-RxGwdHTYsG4gyt8%2BvA--iyEctpRvbRufkUEodQ@mail.gmail.com>
References:  <201608120703.u7C73whf007189@repo.freebsd.org> <d23b295a-1902-193c-dee6-ba49ebd77280@FreeBSD.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <CABh_MKkxD3OTF7VO9Rq_eZyqHPN%2BxVws3q3dsH2R3DfZ343kFw@mail.gmail.com> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <CABh_MKm_YQ3bJD19Cz1vBCGr=YxuzctXV6F1iqMASkSx-PsVMw@mail.gmail.com> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <f4d148a5-2746-b88a-dd84-28c88de91bde@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <b1e9b368-2900-269e-c281-7de14cecfcf6@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> <CABh_MKkk4Lf-RxGwdHTYsG4gyt8%2BvA--iyEctpRvbRufkUEodQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07
Content-Type: multipart/mixed; boundary="itIFAicGN9GH2MlTRrtx69i2OwwcFwagB"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Ed Schouten <ed@nuxi.nl>
Cc: Guido Falsi <madpilot@freebsd.org>, svn-src-head@freebsd.org,
 jilles@freebsd.org, svn-src-all@freebsd.org,
 src-committers <src-committers@freebsd.org>, Ed Schouten <ed@freebsd.org>
Message-ID: <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org>
Subject: Re: svn commit: r303988 - head/lib/libc/gen
References: <201608120703.u7C73whf007189@repo.freebsd.org>
 <d23b295a-1902-193c-dee6-ba49ebd77280@FreeBSD.org>
 <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org>
 <CABh_MKkxD3OTF7VO9Rq_eZyqHPN+xVws3q3dsH2R3DfZ343kFw@mail.gmail.com>
 <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org>
 <CABh_MKm_YQ3bJD19Cz1vBCGr=YxuzctXV6F1iqMASkSx-PsVMw@mail.gmail.com>
 <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org>
 <f4d148a5-2746-b88a-dd84-28c88de91bde@FreeBSD.org>
 <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org>
 <b1e9b368-2900-269e-c281-7de14cecfcf6@FreeBSD.org>
 <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org>
 <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org>
 <CABh_MKkk4Lf-RxGwdHTYsG4gyt8+vA--iyEctpRvbRufkUEodQ@mail.gmail.com>
In-Reply-To: <CABh_MKkk4Lf-RxGwdHTYsG4gyt8+vA--iyEctpRvbRufkUEodQ@mail.gmail.com>

--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 <bdrewery@freebsd.org>:
>>>> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1ce79adf-94cc-e5d3-7b8b-0914f2b07512>