From nobody Fri Mar 01 23:22:28 2024 X-Original-To: dev-commits-src-main@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 4Tmkdc3bfBz5DFPC; Fri, 1 Mar 2024 23:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tmkdc3B5cz4K70; Fri, 1 Mar 2024 23:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709335348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F5vGXQHDcOO14pP1CPXKCAxtb5pUZR8eqqIlLiBRo6s=; b=wSVvh1ttvthEQE6r8/CaPzMq7LIa9ylap1fZjcoDdbedOPVQh7b7bCdTC5Ox4YS0j36OG2 hixf39M3ZyqgLSgfcYkrXGCU4W1NNePG7VFM2op8ejQQGWoUsv9i6mMsMjOoxV7tbbx58o oK3jlJ+YwiUe2CXVims5o1lyYcd1gTb/2c+uXaqwarThgFQIY+quhWG/JE5HukfDtrsrjE 42H03oY/jDtpH8XcAKAK1FOVqFMpf34KEVNeWOPIG3YBdCpIIXAShmFDIofiARVOL15hhl QeWm040p2LbFj1v/PtH8adRFD7KOCds0z02XPuupx4yFQyo76ZRe6Sz3bNyu7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709335348; a=rsa-sha256; cv=none; b=K8DYuP17QEaIgDONxzV9jJSsowk9lL/tA0F2YzfAz+J5VHm/Qj9SBEhdiXxo/cgFziIQF4 PyDwjzWi2n5aTSrKna4MOFP7TYmi0fVtnL8gmq83nqLWTaoWROLXV5vI/LFVZLwBYkST5D h3C1IROYAA14N7VUVaGbQ8iwWlIzppzpNf18Xu17zQVnzLXb1wFI9lPB9wLf8PlA8yl/Fo 976Ua93Sn/mJWjJP8zs3YkY2XcJfJ8JMNaPn0WMAB2e3UpsFPyLiNufZwN/+bt2h2XHUuJ voK/ahGsIuN5hvMKx0EF1FC7kqvpXz5CGtahdaH32Z/5EuyBLIA5EvUj58tQcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709335348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F5vGXQHDcOO14pP1CPXKCAxtb5pUZR8eqqIlLiBRo6s=; b=HYAGi7rR3v65ZGHgqLPCF2uP2T4FmS3eSxJ5hbAicvoUPFvZ2+F+axKbCOuE6p48oP85sg PDkH3q4nc28YYiSN7Ym0AzkA3PRAn71P/07D7LR+O5+Qn0TApCO83s3JqVKWp/7IWyZnOv 9T/ZiUzFoDf0UMWppUh1T5VCMSlP7HaTv2zCC+6TMzRceaISBWaQb8OnsVGzXgmLGxljm+ xf8IeoxPVZQwGlAYeJ7dUge3UTzr3LhMqGY+Rr4T7ACFeD1y4cz1GkgssPHUZZbcgpfvz8 hQadcglFh9ilhkrHNZF8vxbewqZJhqNcxlDuQnF7X65undlaA+A5DQr2OX0+5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tmkdc2nttzmX9; Fri, 1 Mar 2024 23:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 421NMSpA072474; Fri, 1 Mar 2024 23:22:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 421NMS4W072471; Fri, 1 Mar 2024 23:22:28 GMT (envelope-from git) Date: Fri, 1 Mar 2024 23:22:28 GMT Message-Id: <202403012322.421NMS4W072471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2956f5885cf4 - main - Add an UNDEFINED_VERSION option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2956f5885cf4f001bd5c220ee9753d49aa1ad656 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2956f5885cf4f001bd5c220ee9753d49aa1ad656 commit 2956f5885cf4f001bd5c220ee9753d49aa1ad656 Author: Brooks Davis AuthorDate: 2024-03-01 23:21:46 +0000 Commit: Brooks Davis CommitDate: 2024-03-01 23:22:11 +0000 Add an UNDEFINED_VERSION option When enabled (current default) link with --undefined-version to allow symbol maps to contain symbols not defined by libraries. When disabled, link with --no-undefined-version to disallow these bugs. WITHOUT_UNDEFINED_VERSION is currently broken. Once it is fixed it should be made the default and this option should likely be removed. Reviewed by: dim, emaste Differential Revision: https://reviews.freebsd.org/D44169 --- share/man/man5/src.conf.5 | 5 ++++- share/mk/bsd.lib.mk | 10 ++++++---- share/mk/bsd.opts.mk | 1 + tools/build/options/WITHOUT_UNDEFINED_VERSION | 2 ++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 2713e7416a52..255d5a567ec0 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd February 17, 2024 +.Dd March 1, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1726,6 +1726,9 @@ and that the runtime support library is available Do not build .Xr unbound 8 and related programs. +.It Va WITHOUT_UNDEFINED_VERSION +Link libraries with --no-undefined-version to ensure all symbols are +provided. .It Va WITHOUT_UNIFIED_OBJDIR Use the historical object directory format for .Xr build 7 diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 3cb2f9305e45..981d0b49df39 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -260,10 +260,12 @@ SHLIB_NAME_FULL=${SHLIB_NAME} ${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} -# lld >= 16 turned on --no-undefined-version by default, but we have several -# symbols in our version maps that may or may not exist, depending on -# compile-time defines. -.if ${LINKER_TYPE} == "lld" && ${LINKER_VERSION} >= 160000 +# Ideally we'd always enable --no-undefined-version (default for lld >= 16), +# but we have several symbols in our version maps that may or may not exist, +# depending on compile-time defines and that needs to be handled first. +.if ${MK_UNDEFINED_VERSION} == "no" +LDFLAGS+= -Wl,--no-undefined-version +.else LDFLAGS+= -Wl,--undefined-version .endif .endif diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 51260533e265..dcfe64ac1350 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -68,6 +68,7 @@ __DEFAULT_YES_OPTIONS = \ SSP \ TESTS \ TOOLCHAIN \ + UNDEFINED_VERSION \ WARNS \ WERROR diff --git a/tools/build/options/WITHOUT_UNDEFINED_VERSION b/tools/build/options/WITHOUT_UNDEFINED_VERSION new file mode 100644 index 000000000000..0e58eb00f3c1 --- /dev/null +++ b/tools/build/options/WITHOUT_UNDEFINED_VERSION @@ -0,0 +1,2 @@ +Link libraries with --no-undefined-version to ensure all symbols are +provided.