]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid adding -d to kernel module link command lines for lld >= 14
authorDimitry Andric <dim@FreeBSD.org>
Sat, 14 May 2022 20:07:01 +0000 (22:07 +0200)
committerDimitry Andric <dim@FreeBSD.org>
Mon, 30 May 2022 18:28:14 +0000 (20:28 +0200)
commit177466dac805df0271511a0d7cd3152a467820c6
tree5f05cece7aa41c94656f15c0d6a7ceab594b9cd8
parent84f5770003c4a8e62790eb0348f7e6d6bdb648a4
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