Skip to content
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

[clang] enable lld #104

Closed
nickdesaulniers opened this issue Jun 25, 2019 · 7 comments · Fixed by #481
Closed

[clang] enable lld #104

nickdesaulniers opened this issue Jun 25, 2019 · 7 comments · Fixed by #481

Comments

@nickdesaulniers
Copy link
Contributor

per a discussion today with Arnd, it would be good to make the clang builds use LD=ld.lld for their linkers. The kernel really stresses LLD's linker script support, so it would be good to get it under coverage soon. Should work with arm64.

@nickdesaulniers
Copy link
Contributor Author

Also, probably need to verify that ld.lld is packaged in the docker images.

@nickdesaulniers
Copy link
Contributor Author

Also, the TCWG @ linaro is also testing with Clang+LLD on by default.

@broonie
Copy link
Member

broonie commented Jun 26, 2019

Unless upstream arranges for clang builds to use lld by default we should probably keep coverage of builds with GNU LD since that's what people will be building if they just decide to go and build with clang. Testing with lld would definitely be good and I'm all in favour of adding it, I just worry about loosing coverage of the more standard case.

A reference to the discussion with Arnd would be helpful.

@nickdesaulniers
Copy link
Contributor Author

A reference to the discussion with Arnd would be helpful.

Video call, unrecorded.

Unless upstream arranges for clang builds to use lld by default we should probably keep coverage of builds with GNU LD since that's what people will be building if they just decide to go and build with clang.

Sure if someone just does make CC=clang then clang will likely use ld.bfd (it needs a CMake variable -DCLANG_DEFAULT_LINKER=lld.

But we'd like to build the kernel with more than just clang; we'd like to use all llvm utilities so we can catch regressions in them.

I agree that make CC=clang LD=ld.lld NM=llvm-nm ... will get burdensome eventually, and have a few ideas to simplify that in Kbuild.

In the meantime, we'd really like to get testing coverage with lld.

@gctucker
Copy link
Contributor

gctucker commented Jul 9, 2019

Maybe we could build a handful of defconfigs with an llvm build environment, as well as the current clang ones?

I think this could be defined as part of the Docker image used to do the kernel builds (Debian alternatives, or env variables set up before calling make...).

@gctucker gctucker added this to the Clang milestone Jul 29, 2019
@gctucker gctucker added this to Backlog in KernelCI project board Aug 28, 2019
@gctucker gctucker mentioned this issue Feb 28, 2020
6 tasks
@kees
Copy link
Contributor

kees commented Jul 5, 2020

Maybe we could build a handful of defconfigs with an llvm build environment, as well as the current clang ones?

An "all LLVM tools" option now exists by setting LLVM=1 on the "make" command line. So now we could do GCC+bfd, Clang+bfd, and Clang+lld+all-other-LLVM-tools.

@gctucker
Copy link
Contributor

gctucker commented Jul 6, 2020

Sounds like something we should be trying with linux-next on staging.

@khilman khilman linked a pull request Aug 27, 2020 that will close this issue
KernelCI project board automation moved this from Backlog to Done Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

4 participants