From owner-freebsd-current@FreeBSD.ORG Fri Nov 27 17:53:23 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44BAC106566B; Fri, 27 Nov 2009 17:53:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id C90018FC0A; Fri, 27 Nov 2009 17:53:22 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nARHrHTo044701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Nov 2009 19:53:17 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nARHrHav040094; Fri, 27 Nov 2009 19:53:17 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nARHrHUd040093; Fri, 27 Nov 2009 19:53:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Nov 2009 19:53:17 +0200 From: Kostik Belousov To: Manfred Antar Message-ID: <20091127175316.GE2368@deviant.kiev.zoral.com.ua> References: <200911270246.nAR2k9Zp026751@pozo.com> <86ocmos11v.fsf@ds4.des.no> <200911271636.nARGaf92050278@pozo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cPi+lWm09sJ+d57q" Content-Disposition: inline In-Reply-To: <200911271636.nARGaf92050278@pozo.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: ports@freebsd.org, Dag-Erling Sm??rgrav , current@freebsd.org Subject: Re: libthr on current breaks some ports X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2009 17:53:23 -0000 --cPi+lWm09sJ+d57q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2009 at 08:36:36AM -0800, Manfred Antar wrote: > At 02:40 AM 11/27/2009, Dag-Erling Sm??rgrav wrote: > >Manfred Antar writes: > >> The new addition to Makefile on /lib/libthr "-Wl,-znodlopen " > >> Breaks php4 and mhash on my current 1386 > > > >If they try to dlopen() libthr, they're already broken. > > > >> I'm sure other ports that use it are broken too as can't load the lib. > > > >I doubt it. > > > >DES > >--=20 > >Dag-Erling Sm??rgrav - des@des.no > > > >--=20 > >This message has been scanned for viruses and > >dangerous content by MailScanner, and is > >believed to be clean. >=20 > OK > Here are some of the errors I get > Just rebuild /usr/ports/graphics/gd >=20 > ldd /usr/local/lib/libgd.so.4 > /usr/local/lib/libgd.so.4: /libexec/ld-elf.so.1: /usr/local/lib/libgd.so.= 4: Unexpected inconsistency: dependency libthr.so.3 not found > /usr/local/lib/libgd.so.4: exit status 1 >=20 > Just rebuild /usr/ports/security/mhash > ldd /usr/local/lib/libmhash.so > /usr/local/lib/libmhash.so: /libexec/ld-elf.so.1: /usr/local/lib/libmhash= .so: Unexpected inconsistency: dependency libthr.so.3 not found > /usr/local/lib/libmhash.so: exit status 1 >=20 > Both of these have "--with-LDFLAGS=3D"${PTHREAD_LIBS}" in the Makefile. >=20 This is a real regression, but limited to ldd/LD_TRACE_LOADED_OBJECTS functionality. The following quick fix worked for me. diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 320aa85..508a786 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1571,7 +1571,8 @@ do_load_object(int fd, const char *name, char *path, = struct stat *sbp, object_add_name(obj, name); obj->path =3D path; digest_dynamic(obj, 0); - if (obj->z_noopen && (flags & RTLD_LO_DLOPEN)) { + if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) =3D=3D + RTLD_LO_DLOPEN) { dbg("refusing to load non-loadable \"%s\"", obj->path); _rtld_error("Cannot dlopen non-loadable %s\n", obj->path); munmap(obj->mapbase, obj->mapsize); @@ -2006,6 +2007,8 @@ dlopen(const char *name, int mode) lo_flags =3D RTLD_LO_DLOPEN; if (mode & RTLD_NOLOAD) lo_flags |=3D RTLD_LO_NOLOAD; + if (ld_tracing !=3D NULL) + lo_flags |=3D RTLD_LO_TRACE; =20 objlist_init(&initlist); =20 diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 6f51d7d..875e84b 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -242,8 +242,9 @@ typedef struct Struct_Obj_Entry { dlsym. */ =20 /* Flags for load_object(). */ -#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD */ -#define RTLD_LO_DLOPEN 0x02 /* load_object() called from dlopen(). */ +#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD. */ +#define RTLD_LO_DLOPEN 0x02 /* Load_object() called from dlopen(). */ +#define RTLD_LO_TRACE 0x04 /* Only tracing. */ =20 /* * Symbol cache entry used during relocation to avoid multiple lookups --cPi+lWm09sJ+d57q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksQEgwACgkQC3+MBN1Mb4jxUgCdF/VGitH/Ndot0QIDbCO7GB7X H8AAn1DP+BCIadpUGdEXJv/AwoVPyzEz =TQ4V -----END PGP SIGNATURE----- --cPi+lWm09sJ+d57q--