From nobody Mon May 30 18:30:31 2022 X-Original-To: dev-commits-src-all@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 03AB01B4C3A9; Mon, 30 May 2022 18:30:32 +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 4LBkVb3ZFbz3Hl8; Mon, 30 May 2022 18:30:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653935431; 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=1g1yttt5x/EDsaSZ0Dder/GxR3wxGVkdS+Bi8J7y+HE=; b=tkFD2ZInJTFpwwuO/NRZWYDZ1JJ6dPSaYX75oPb5GlMz+3b2YT51iAhtCXHgjZtuX6hCHx 3YL+kugPX/pPGWg+pEu/5G79fWMJcxVeq6u2Yl87ZyxERwkCgrlV1kFIN7BftM3uDgfpvj 4SG9X31lXeW07+3EQ5L2N6K7nEzxuJ4UMqXCgEjLbjM7lewqtCiEi5yAxkzdGZ0kZYSxqz QjREx3DH5leV6RX1c9vSa2KljpowYLH2NzqkfASZAx0WrkPI+1IRdsnZDuqsdwnDFXBOFt aff6shhed4pZCrPW6K0wA5/w1wQH4IJSu2nfGe2GCXa3EQUplT+KbJ3ci+D/fA== 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 225DD1C6BD; Mon, 30 May 2022 18:30:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24UIUV2Z084137; Mon, 30 May 2022 18:30:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24UIUVYJ084136; Mon, 30 May 2022 18:30:31 GMT (envelope-from git) Date: Mon, 30 May 2022 18:30:31 GMT Message-Id: <202205301830.24UIUVYJ084136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 177466dac805 - stable/13 - Avoid adding -d to kernel module link command lines for lld >= 14 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 177466dac805df0271511a0d7cd3152a467820c6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653935431; 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=1g1yttt5x/EDsaSZ0Dder/GxR3wxGVkdS+Bi8J7y+HE=; b=ysd21YGPdHlFfEsAmSBaycdmq4HKZJ5++a7AWGldc6lEPdy8+zeq2m3OAFfZg0XBAxIGDi ROjqsBmzFVjl1ZLj58MQrLo2Idu9+p57GQiNOlMDXpVv9vsysSDdRTY7BniH7Rdwmb2io4 XKwljDbOKW4tfH6oZD4mn5mXriIJdetDXOwowfI9nVh275itXTD/u8dWdRQinHNhT+so8R TpOjRKgqwXHvYAy4l+ceD6UJM+SmcRyfMQHJnMXDbZob8D/NXv42Q7b/taN9U8/YKxIl2p 9plFOI3tGhLp6Eor0rz9MWBLbj/f7O/+IEYa+ZQsAHotInuOFey3TWUEUXE4RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653935431; a=rsa-sha256; cv=none; b=DFw2bWUA26XMmJdrpETgdbQGnKakcpWUrdXzk5j/rJvY3fe7zbUocPAqhAtWDvRh8KyglB aF6GNEgwFN/sPiL4omzUElM0LgoASSOOkQ87JiQM9RVToX+AWdQP0y+5frujFGzCl5w4OG fQSrM06tMTZp1PEre8c64xw/d1r7FsDLQvICrAPxmQfI/aylc+EXp1/ak6pzju3ROFlKF3 Nvs9doWtWN7kdLz5wKcMn8sS5F/WQ14bg++ky4vFtx+AlEqccA2168BxhepMrMiKYadYv6 TjnAAn00UcUcca8OnppU6PPLjpJmJy1wtDRr9rnv6B1905KCXtoVhShFmPrpgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=177466dac805df0271511a0d7cd3152a467820c6 commit 177466dac805df0271511a0d7cd3152a467820c6 Author: Dimitry Andric AuthorDate: 2022-05-14 20:07:01 +0000 Commit: Dimitry Andric CommitDate: 2022-05-30 18:28:14 +0000 Avoid adding -d to kernel module link command lines for lld >= 14 Since 0b3178a45cd0 we have added '-d' to the link command line for kernel modules, so if any unexpected common symbols turn up (even though we use -fno-common in CFLAGS), storage will be allocated in in the module itself. However, with lld this option did not have any effect since ~2017, and as of lld 14 it warns: "-d, -dc, -dp, and --[no-]define-common will be removed. See https://github.com/llvm/llvm-project/issues/53660" Add a linker type and version check, to avoid adding the option for lld 14 and later. Reported by: bz MFC after: 2 weeks (cherry picked from commit 0817c8dc2a48efedac38d1b9b5c4747a15dbe840) --- sys/conf/kmod.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 736ce26d406c..629b7554f005 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -139,7 +139,11 @@ CFLAGS.gcc+= --param large-function-growth=1000 # share/mk/src.sys.mk, but the following is important for out-of-tree modules # (e.g. ports). CFLAGS+= -fno-common -LDFLAGS+= -d -warn-common +.if ${LINKER_TYPE} != "lld" || ${LINKER_VERSION} < 140000 +# lld >= 14 warns that -d is deprecated, and will be removed. +LDFLAGS+= -d +.endif +LDFLAGS+= -warn-common .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id} LDFLAGS+= --build-id=sha1 @@ -245,7 +249,7 @@ ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} .endif - ${LD} -m ${LD_EMULATION} ${_LDFLAGS} ${LDSCRIPT_FLAGS} -r -d \ + ${LD} -m ${LD_EMULATION} ${_LDFLAGS} ${LDSCRIPT_FLAGS} -r \ -o ${.TARGET} ${OBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}