Commit d5750cd3 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Masahiro Yamada

kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1

ld.lld 10.0.1 spews a bunch of various warnings about .rela sections,
along with a few others. Newer versions of ld.lld do not have these
warnings. As a result, do not add '--orphan-handling=warn' to
LDFLAGS_vmlinux if ld.lld's version is not new enough.

Link: https://github.com/ClangBuiltLinux/linux/issues/1187
Link: https://github.com/ClangBuiltLinux/linux/issues/1193Reported-by: default avatarArvind Sankar <nivedita@alum.mit.edu>
Reported-by: default avatarkernelci.org bot <bot@kernelci.org>
Reported-by: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 59612b24
...@@ -4274,6 +4274,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues ...@@ -4274,6 +4274,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues
C: irc://chat.freenode.net/clangbuiltlinux C: irc://chat.freenode.net/clangbuiltlinux
F: Documentation/kbuild/llvm.rst F: Documentation/kbuild/llvm.rst
F: scripts/clang-tools/ F: scripts/clang-tools/
F: scripts/lld-version.sh
K: \b(?i:clang|llvm)\b K: \b(?i:clang|llvm)\b
CLEANCACHE API CLEANCACHE API
......
...@@ -47,6 +47,10 @@ config CLANG_VERSION ...@@ -47,6 +47,10 @@ config CLANG_VERSION
int int
default $(shell,$(srctree)/scripts/clang-version.sh $(CC)) default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
config LLD_VERSION
int
default $(shell,$(srctree)/scripts/lld-version.sh $(LD))
config CC_CAN_LINK config CC_CAN_LINK
bool bool
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT
...@@ -1351,6 +1355,7 @@ config LD_DEAD_CODE_DATA_ELIMINATION ...@@ -1351,6 +1355,7 @@ config LD_DEAD_CODE_DATA_ELIMINATION
config LD_ORPHAN_WARN config LD_ORPHAN_WARN
def_bool y def_bool y
depends on ARCH_WANT_LD_ORPHAN_WARN depends on ARCH_WANT_LD_ORPHAN_WARN
depends on !LD_IS_LLD || LLD_VERSION >= 110000
depends on $(ld-option,--orphan-handling=warn) depends on $(ld-option,--orphan-handling=warn)
config SYSCTL config SYSCTL
......
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Usage: $ ./scripts/lld-version.sh ld.lld
#
# Print the linker version of `ld.lld' in a 5 or 6-digit form
# such as `100001' for ld.lld 10.0.1 etc.
linker_string="$($* --version)"
if ! ( echo $linker_string | grep -q LLD ); then
echo 0
exit 1
fi
VERSION=$(echo $linker_string | cut -d ' ' -f 2)
MAJOR=$(echo $VERSION | cut -d . -f 1)
MINOR=$(echo $VERSION | cut -d . -f 2)
PATCHLEVEL=$(echo $VERSION | cut -d . -f 3)
printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment