History

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.

Nathan Chancellor committed 5 years ago

Commit d5750cd1 parent 59612b23 files · +26 −0Browse files

Unified · Split

3 files
  1. MAINTAINERS +1 −0
  2. init/Kconfig +5 −0
  3. scripts/lld-version.sh +20 −0
MAINTAINERS+1−0
@@ -4274,6 +4274,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues · 4273 unmodified lines
4274C: irc://chat.freenode.net/clangbuiltlinux4274C: irc://chat.freenode.net/clangbuiltlinux
4275F: Documentation/kbuild/llvm.rst4275F: Documentation/kbuild/llvm.rst
4276F: scripts/clang-tools/4276F: scripts/clang-tools/
4277F: scripts/lld-version.sh
4277K: \b(?i:clang|llvm)\b4278K: \b(?i:clang|llvm)\b
4278 4279
4279CLEANCACHE API4280CLEANCACHE API
init/Kconfig+5−0
@@ -47,6 +47,10 @@ config CLANG_VERSION · 46 unmodified lines
47 int47 int
48 default $(shell,$(srctree)/scripts/clang-version.sh $(CC))48 default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
49 49
50config LLD_VERSION
51 int
52 default $(shell,$(srctree)/scripts/lld-version.sh $(LD))
53
50config CC_CAN_LINK54config CC_CAN_LINK
51 bool55 bool
52 default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT56 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 · 1298 unmodified lines
1351config LD_ORPHAN_WARN1355config LD_ORPHAN_WARN
1352 def_bool y1356 def_bool y
1353 depends on ARCH_WANT_LD_ORPHAN_WARN1357 depends on ARCH_WANT_LD_ORPHAN_WARN
1358 depends on !LD_IS_LLD || LLD_VERSION >= 110000
1354 depends on $(ld-option,--orphan-handling=warn)1359 depends on $(ld-option,--orphan-handling=warn)
1355 1360
1356config SYSCTL1361config SYSCTL
scripts/lld-version.sh+20−0
@@ -0,0 +1,20 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Usage: $ ./scripts/lld-version.sh ld.lld
5#
6# Print the linker version of `ld.lld' in a 5 or 6-digit form
7# such as `100001' for ld.lld 10.0.1 etc.
8
9linker_string="$($* --version)"
10
11if ! ( echo $linker_string | grep -q LLD ); then
12 echo 0
13 exit 1
14fi
15
16VERSION=$(echo $linker_string | cut -d ' ' -f 2)
17MAJOR=$(echo $VERSION | cut -d . -f 1)
18MINOR=$(echo $VERSION | cut -d . -f 2)
19PATCHLEVEL=$(echo $VERSION | cut -d . -f 3)
20printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t