From nobody Fri Mar 01 23:25:18 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 4Tmkj13DTsz5DFJg; Fri, 1 Mar 2024 23:25:25 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Tmkj11B0Dz4Kdk; Fri, 1 Mar 2024 23:25:25 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 168F83C019A; Fri, 1 Mar 2024 23:25:18 +0000 (UTC) Date: Fri, 1 Mar 2024 23:25:18 +0000 From: Brooks Davis To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2956f5885cf4 - main - Add an UNDEFINED_VERSION option Message-ID: References: <202403012322.421NMS4W072471@gitrepo.freebsd.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <202403012322.421NMS4W072471@gitrepo.freebsd.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Queue-Id: 4Tmkj11B0Dz4Kdk This knob is intended to be temporary to make it easier to fix incorrect symbol maps. I've got a set of patches for libc, libgcc_s, and libcxxrt that I'll submit after further testing. -- Brooks On Fri, Mar 01, 2024 at 11:22:28PM +0000, Brooks Davis wrote: > 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. >