-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove cc-ldoption #342
Comments
Should be a fairly innocuous change to upstream as it isn't tied to upstreaming LTO support. At the same time though, do we actually need an diff --git a/Makefile b/Makefile
index 141653226f3c..5e9781490ea6 100644
--- a/Makefile
+++ b/Makefile
@@ -500,6 +500,9 @@ ifneq ($(GCC_TOOLCHAIN),)
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
CLANG_FLAGS += -no-integrated-as
+ifneq ($(shell $(LD) --version 2>&1 | head -n 1 | grep LLD),)
+CLANG_FLAGS += -fuse-ld=lld
+endif
KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS += $(CLANG_FLAGS)
export CLANG_FLAGS If we do want to introduce something like |
Just FYI, the following diff builds and boots on arm64 in QEMU (I built with diff --git a/Makefile b/Makefile
index 18a02e4c611e..aa1d73084fe6 100644
--- a/Makefile
+++ b/Makefile
@@ -492,7 +492,7 @@ endif
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
ifneq ($(CROSS_COMPILE),)
CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
-GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+GCC_TOOLCHAIN_DIR := $(dir $(shell which $(AS)))
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
endif
@@ -500,6 +500,10 @@ ifneq ($(GCC_TOOLCHAIN),)
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
CLANG_FLAGS += -no-integrated-as
+ifneq ($(shell $(LD) --version 2>&1 | head -n 1 | grep LLD),)
+CLANG_FLAGS += -fuse-ld=lld
+KBUILD_LDFLAGS += -O2
+endif
KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS += $(CLANG_FLAGS)
export CLANG_FLAGS
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index b215c712d897..41a611256476 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -55,7 +55,7 @@ $(obj-vdso): %.o: %.S FORCE
# Actual build commands
quiet_cmd_vdsold = VDSOL $@
- cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@
+ cmd_vdsold = $(CC) $(c_flags) -Wl,-N -Wl,-T $^ -o $@
quiet_cmd_vdsoas = VDSOA $@
cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
|
@nathanchance , thanks for testing. If you stripped out the arm64 vdso stuff, I'd sign off on the Makefile change. I think there's more to do for arm64 vdso (both on the lld side, and maybe in that vdso's Makefile. If you could add those links to these separate issues, then give Rui (LLD maintainer) and I suggested by tags, that would be appreciated. Otherwise I will do so myself once I get back from FOSDEM/Brussels. |
I went ahead and tested arm32 as well, which now fails to build with I think something is goofy with Without that diff:
With that diff:
This particular error is coming from the lack of Line 67 in b23b0ea
|
Ah great. You had similiar ideas and a use-case/test-case. Makes sense to distinguish on $LD_FOR_BUILD aka ld.bfd, ld.gold and ld.lld. |
https://lore.kernel.org/r/[email protected]/ Nathan, please file a separate bug for arm(32) vdso. |
Also, handy trick from the LLD documentation for verifying if something was linked with LLD:
|
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
Ripped from Nathan's patch on GitHub by kdrag0n: ClangBuiltLinux/linux#342 (comment) Signed-off-by: kdrag0n <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
Ripped from Nathan's patch on GitHub by kdrag0n: ClangBuiltLinux/linux#342 (comment) Signed-off-by: kdrag0n <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
Ripped from Nathan's patch on GitHub by kdrag0n: ClangBuiltLinux/linux#342 (comment) Signed-off-by: kdrag0n <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
Ripped from Nathan's patch on GitHub by kdrag0n: ClangBuiltLinux/linux#342 (comment) Signed-off-by: kdrag0n <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
Ripped from Nathan's patch on GitHub by kdrag0n: ClangBuiltLinux/linux#342 (comment) Signed-off-by: kdrag0n <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Eliminater74 <[email protected]>
Ripped from Nathan's patch on GitHub by kdrag0n: ClangBuiltLinux/linux#342 (comment) Signed-off-by: kdrag0n <[email protected]> Signed-off-by: Eliminater74 <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]> Signed-off-by: Chenyang Zhong <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]> Signed-off-by: Chenyang Zhong <[email protected]>
kbuild: Allow forcing the alternative LLD linker via Kconfig LLD is a relatively new linker from the LLVM Project that aims to be a faster and more modern alternative to the GNU gold and bfd linkers from binutils: https://lld.llvm.org/ I've also found that it offers more insightful diagnostics when something goes wrong, e.g. when there are undefined references. It does also appear to speed up the overall build time by 4-10s as compared to ld.bfd. These new config options will only allow fully-working configurations: - gold/lld when Clang LTO is enabled - bfd/lld otherwise Signed-off-by: Danny Lin <[email protected]> Signed-off-by: Adam W. Willis <[email protected]> Signed-off-by: Yaroslav Furman <[email protected]> BACKPORT: FROMLIST: Makefile: lld: set -O2 linker flag when linking w… …ith LLD For arm64: 0.34% size improvement with lld -O2 over lld for vmlinux. 3.3% size improvement with lld -O2 over lld for Image.lz4-dtb. Link: ClangBuiltLinux/linux#343 Suggested-by: Rui Ueyama <[email protected]> Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> (am from https://patchwork.kernel.org/patch/10806729/) Signed-off-by: Adam W. Willis <[email protected]> Signed-off-by: Yaroslav Furman <[email protected]> BACKPORT: FROMLIST: Makefile: lld: tell clang to use lld This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld={bfd,gold,lld,<absolute path to linker>}. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the BACKPORT: FROMLIST: Makefile: lld: tell clang to use lld This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld={bfd,gold,lld,<absolute path to linker>}. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Select the linker via absolute path from $PATH via `which`. This allows you to build with: $ make LD=ld.lld $ make LD=ld.lld-8 $ make LD=/path/to/ld.lld Add -Qunused-arguments to KBUILD_CPPFLAGS sooner, as otherwise Clang likes to complain about -fuse-lld= being unused when compiling but not linking (-c) such as when cc-option is used. There's no need to guard with cc-option. Link: ClangBuiltLinux/linux#342 Link: ClangBuiltLinux/linux#366 Link: ClangBuiltLinux/linux#357 Suggested-by: Nathan Chancellor <[email protected]> Suggested-by: Masahiro Yamada <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Reviewed-by: Nathan Chancellor <natechancellor@gmail Signed-off-by: Divyanshu-Modi <[email protected]> Signed-off-by: Kunmun <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Signed-off-by: Yousef Algadri <[email protected]> Signed-off-by: Raphiel Rollerscaperers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: ironman-reborn <[email protected]> Signed-off-by: GhostMaster69-dev <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: ironman-reborn <[email protected]> Signed-off-by: GhostMaster69-dev <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: ironman-reborn <[email protected]> Signed-off-by: GhostMaster69-dev <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: ironman-reborn <[email protected]> Signed-off-by: GhostMaster69-dev <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: ironman-reborn <[email protected]> Signed-off-by: GhostMaster69-dev <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. (am from https://lkml.org/lkml/2019/2/11/1947) Bug: 63740206 Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0 Link: ClangBuiltLinux/linux#342 Suggested-by: Nathan Chancellor <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]>
Forked from: ClangBuiltLinux/continuous-integration#122
Some parts of the kernel invoke the linker via
$(CC)
using-Wl,...
flags. This is problematic because settingLD=ld.lld
is not enough for this to work correctly.If compiling with Clang AND linking with LLD,
-fuse-ld=lld
needs to be added toKBUILD_CFLAGS
.The pixel kernels have a
ld-name
macro to distinguish between bfd and gold. I've extended them to support lld, but seems the base patch is not upstreamed.cc @samitolvanen
The text was updated successfully, but these errors were encountered: