From nobody Thu Dec 2 09:51:44 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 538F918B8848 for ; Thu, 2 Dec 2021 09:51:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4WSp6hS0z4r7f; Thu, 2 Dec 2021 09:51:54 +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 "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id A6E472B5B7; Thu, 2 Dec 2021 09:51:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 7DDED563DB; Thu, 2 Dec 2021 10:51:52 +0100 (CET) From: Dimitry Andric Message-Id: <75CCC6A8-F777-48F9-9AC7-5A08FA9CCD25@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_C8AC2CF4-EB75-4385-A8E3-C47CF5CB66FF"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: failure of pructl (atexit/_Block_copy/--no-allow-shlib-undefined) Date: Thu, 2 Dec 2021 10:51:44 +0100 In-Reply-To: Cc: FreeBSD Current , Jessica Clarke To: Kyle Evans References: <20211202020326.GU35602@funkthat.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638438715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1zpc63vfycukBzfaykoSb2dTvyYnz8h0mhYi8Ec54No=; b=C55HrVwM1EBWBDuH3MR/elAbo9QzcNQo2s2oHiIgbtiIdJx379mOxdvnxId6YezAhGkOon dLm4O6azNLaMvOTr/btfbfX+qloq3qO70GU3AT1tkCKr4Fl1uDrntItD0GOrjqD8vU2Giq aELEwaTcDg3BTBJYijaPKxl3o1RHb55MHloiyqTe7Az8CkUnM5fDU+J4xGgDqmyalxGojs KNPvw2QGoCOX++synDK7gOBknRSam/nQ+9Pn/sRikDp36nKACDxT6e2d2IJsSJf1QaN2F8 5gZf8uCKm87C6hPvlYBCwqJxQUJNFOCe11qpAj1eITdeUiKiFigQXxD5H6DHOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638438715; a=rsa-sha256; cv=none; b=Itv9ipbAB8qG5cm9fhOZ79PCsALKYHKUHTNyvewPxEQHzibNeWe+uJgL7i+kfDPeQt6xLQ GO69JXvTBadXzwOx1+IUriXLeCdVLQMqKR8TLBC396o4q1+QwKyo0QMAf/OexAnBAtToR0 H+D/E1b9loTugshzr1hwe20F7vzIu6Sv7sH603xOWybuRz+0jILK4I0b6usMfglwBoyMKj XOXCV74h+klXC/BShMGsqBhW6GITK/SjBzUd8D7VXISGifNaW2uxGv70KmZsFMFplwZF1v yrlS8egrW1hgPUMF2QAnMrwL9LlciG4tI6y9xFR89mMDupjVyzHtSS3knPWJ+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_C8AC2CF4-EB75-4385-A8E3-C47CF5CB66FF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 2 Dec 2021, at 06:42, Kyle Evans wrote: >=20 > On Wed, Dec 1, 2021 at 8:05 PM John-Mark Gurney = wrote: >>=20 >> Hello, >>=20 >> It seems like the recent changes to make --no-allow-shlib-undefined >> broke pructl. >>=20 >> lib/libc/stdlib/atexit.c uses a weak _Block_copy symbol, but >> pructl does not use atexit_b, and yet gets the following error: >> : && /usr/bin/cc -Werror -O2 -pipe -fstack-protector-strong -isystem = /usr/local/include -fno-strict-aliasing -std=3Dc99 = -fstack-protector-strong CMakeFiles/pructl.dir/pructl.c.o -o pructl = -Wl,-rpath,/usr/local/lib: /usr/local/lib/libpru.so && : >> ld: error: /lib/libc.so.7: undefined reference to _Block_copy = [--no-allow-shlib-undefined] >> cc: error: linker command failed with exit code 1 (use -v to see = invocation) >>=20 >> What is the correct fix? It seems like atexit.c or the linker should >> be fixed, as pructl doesn't use atexit_b at all. >>=20 >=20 > CC dim@ and jrtc27@... this seems like a toolchain regression? We're > relying on the address of weak _Block_copy to simply evaluate to NULL > if it's undefined here, which seems legit and pretty well-defined at > this point from my recollection. What do you mean exactly with "here"? In libc? In atexit? In libpru? I can't make it out from the context, sorry. :) As far as I can see, _Block_copy has always been a weak undefined symbol in libc.so: 4: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _Block_copy Apparently the "block runtime" is supposed to provide the actual object, so I guess you have to explicitly link to that runtime? I know next to nothing about the blocks stuff, so it's all pretty much unknown territory to me... :) -Dimitry --Apple-Mail=_C8AC2CF4-EB75-4385-A8E3-C47CF5CB66FF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYaiXMAAKCRCwXqMKLiCW o2qrAJsE+Zy0+2voHapslP1zBm8rF+/kfwCg2xpqDfYYlojks5G5uYoz9y2gsgg= =jYqh -----END PGP SIGNATURE----- --Apple-Mail=_C8AC2CF4-EB75-4385-A8E3-C47CF5CB66FF--