HomeFreeBSD

Avoid adding -d to kernel module link command lines for lld >= 14

Description

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

Details

Provenance
dimAuthored on May 14 2022, 8:07 PM
Parents
rG373511338d95: uipc_socket.c: Modify MSG_TLSAPPDATA to only do Alert Records
Branches
Unknown
Tags
Unknown