From nobody Thu Dec 02 05:42:21 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 A081318BA816 for ; Thu, 2 Dec 2021 05:42:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4J4Px52j4Vz4jZC; Thu, 2 Dec 2021 05:42:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 391BB29510; Thu, 2 Dec 2021 05:42:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f169.google.com with SMTP id z9so26484361qtj.9; Wed, 01 Dec 2021 21:42:33 -0800 (PST) X-Gm-Message-State: AOAM531NKjm3NsWi7ob/RRfaJPd0URPg2Gog/DgLUeCv+20N7W/Ts6xX PPRSt0kGBriR9/sUr+eUjDPVR/qvuvIIdNieRIA= X-Google-Smtp-Source: ABdhPJzkdLVtv1IPflxOYvFI2hhQLTkL3xY2DOZ3VY8lwMUlwBIJRg5ZU5hR73zrn8xTBCCae+6DiWr4El8FdzhFRfg= X-Received: by 2002:a05:622a:2d6:: with SMTP id a22mr11887952qtx.29.1638423752543; Wed, 01 Dec 2021 21:42:32 -0800 (PST) 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 References: <20211202020326.GU35602@funkthat.com> In-Reply-To: <20211202020326.GU35602@funkthat.com> From: Kyle Evans Date: Wed, 1 Dec 2021 23:42:21 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: failure of pructl (atexit/_Block_copy/--no-allow-shlib-undefined) To: FreeBSD Current Cc: Dimitry Andric , Jessica Clarke Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638423753; 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=ef4AQsxaQRfQch9/9N3DkiCeG1/vNztIzZ+XJ5RDkJ4=; b=u2cCdHeSjVqCAWRhb0qsN8wsUmiMaPchsJ/57baFT81pacWv0kjNYfHbHcZUuGjk4U0Pdc EhaEw5yS5i2nlvCxw2X4PJboYg8sH+yuIrDY3h1JjlxN7x5zRLXCSlriMjXxYoftcpsmza BobfBj+gmT/LGq3ffHdK2yLAC+sYrdMVtUoZZ1NOyHOQoCwg8dh+BuX/hqizwuLWrSDvPN Cn6vRbxhW1fBwarE24i3ZkdDxKvtHilbFktgEsg/hRcKgxivTJ5cb+IMDgWdX/lt+gcCf6 VvTiNmVmmxalbm4eL80biIqW38h1L02YM9f/jRvJwD3OMZ1+mlZlr3yjBtHzcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638423753; a=rsa-sha256; cv=none; b=Xp7cCB7r41Oapac4Uy5NZbVSzmxlwNkKSVEfwZ8OW+BXSrSEs5YBFtub5UEImOZk5FoDmr jmtI21k8tzFNB4Xd1/7i9tsRFzDdm8RUSyRoZBAXXnqHxkvaqqloc6QMJJAyvzPWOwTOxA l5ssJ/gQuoCBEo1LTfni5PBtmtRujL7+gnSgGCd9FgjGcYQP0cPU4rb3l5AImngidawi73 ZUDlFqGNZcJu0nkJHwZX9TsB06rTr+vAj8R5u4PSByWP1a6RdDPIHYbEBku+zkxxwNcXDg r1MavXCbZTD9l8HxzwV2u0SAKOhKvf56oxH7t8o3hV9Qm5z+furg3V/I5CTmXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Wed, Dec 1, 2021 at 8:05 PM John-Mark Gurney wrote: > > Hello, > > It seems like the recent changes to make --no-allow-shlib-undefined > broke pructl. > > 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=c99 -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) > > 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. > 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.