-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
|
I noticed it and I think it was already fixed: llvm-mirror/lld@eaa12bb |
How is llvm-mirror/lld@eaa12bb related to https://bugs.llvm.org/show_bug.cgi?id=37432? Seems like that llvm bug would have to have been fixed before that commit you linked to would?
Red flag! I thought these were daily builds? |
It is not. |
sorry, it's late so this might not be as clear to me as it should be: llvm-mirror/lld@98c7ed5 looks like a fix for https://bugs.llvm.org/show_bug.cgi?id=37432, which is still open. So it's probably time to close:
Yes?
oh, good find. |
.travis.yml
Outdated
@@ -10,6 +10,8 @@ matrix: | |||
env: ARCH=ppc64le | |||
- name: "ARCH=x86_64" | |||
env: ARCH=x86_64 | |||
- name: "ARCH=x86_64 LD=ld.lld" | |||
env: ARCH=x86_64 LD=ld.lld-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once these are green on presubmit (and you can point to a build number that shows they're green), let's demote ARCH=x86_64
and ARCH=x86_64 LD=ld.lld REPO=linux-next
to cron (keeping LLD in presubmit).
I will first test if it really works as intended, then close the bugs. Looks like the fix is there, but I want to make sure. |
The Stretch binaries haven't been updated since Oct 29 because they have been erroring but we switched to Sid in b7ee15e, which has definitely been built nightly. I noted the failure here, I guess it should be reported to the LLVM bug tracker under packaging. |
You'll need to rebase your branch on top of the latest master to get the correct toolchain, Travis won't pass currently. |
Doesn't look like ClangBuiltLinux/linux#218 was addressed with this patch set: https://travis-ci.com/nathanchance/continuous-integration/jobs/158894300 |
It was not. I actually never hit this bug on local machine, because I was always getting "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" error regardless to actual CONFIG_UNWINDER_ORC setting. I'll take a look at what I can do about it. Looks like the alignment in question is |
At least it boots now: https://travis-ci.com/ClangBuiltLinux/continuous-integration/builds/91581463 |
Although we didn't actually make it to a shell:
|
What happens if we turn off the self tests (additional kernel configs above |
We could disable them and see but that would certainly point to a deeper issue. |
Sorry, I meant "if disabling all of them allows it to boot cleanly, then this is not a boot issue, but an issue from one (or more) of the tests, which we can then bisect configs to see which test(s) is(/are) problematic." |
Yeah sorry that's what I was thinking as well. I just meant that if a test is failing, it could mean a deeper issue in the kernel or lld but we absolutely want to see what test is failing specifically. |
Nope, with just the defconfig and image built (commit), the boot still fails: https://travis-ci.com/nathanchance/continuous-integration/builds/91771985 |
Too bad we can't get binaries from travis. I will try to replicate the setup locally and reproduce the issue. Maybe we can also make the kernel binary reproducible and print the checksum after it's compiled to check against local build. |
@tpimh use my Docker image ( |
patches 2 and 3 (from this PR) are very clearly functional changes (and I'm curious now if they are the problem). I wonder if those plus linkage with bfd cause the same issues? |
Travis shows no, regular x86_64 passes fine with those patches. |
@tpimh the LLD fix for the boot failure should be in the next apt.llvm.org toolchain build (hopefully in the next day or two), which was the last blocker to turning this on. Time to rebase? |
oh, we're that close? @samitolvanen and @Ajs1984 were just asking me about it for Android Cuttlefish. Sorry I haven't been keeping up to date as much lately (it's not my intention). |
Yes. Locally, I can use this script with a version of LLD that contains https://reviews.llvm.org/rL357885 and it links and boots successfully on mainline.
We will need some backports to support the older LTS branches including 4.19 because most of the fixes went into 4.20/5.0, I can look into that tonight. |
As it turns out, most of the LLD patches in the kernel have already been backported, thanks to Sasha Levin's AUTOSEL work. The fixes for ClangBuiltLinux/linux#29, ClangBuiltLinux/linux#30, and ClangBuiltLinux/linux#218 have all been merged as of the latest LTS releases. The only missing commit is the fix for ClangBuiltLinux/linux#31, which is commit ac3e233d29f7 ("x86/vdso: Drop implicit common-page-size linker flag") upstream. For 4.9/4.14, commit 379d98ddf413 ("x86: vdso: Use $LD instead of $CC to link") is needed for a clean pick, which should probably be merged anyways since kernel/common is carrying an older version in commit 35b779802c2e ("x86: vdso: Fix leaky vdso linker with CC=clang."). I can send an email to Greg and Sasha with this info (unless someone else wants to do it), all of those commits are clean picks for me. I've tested locally with this CI patch on top of #147 and the following for loop:
|
I'm pretty sure this will require some extra work, but as I can see most patches went upstream, I will try to build and test ASAP. |
backports will make it easier for other Android OEMs to make use of LLD. 🚀 🌔 |
I have prepared mbox files for 4.4 to 4.19 for x86_64. I am working on arm64 right now (only 4.9 and 4.14 need backports) but I will need to go to work shortly so I won't be able to finish until tonight. |
It looks like the only two commits that are needed for arm64 on 4.9 are 9b990e62aee5 ("arm64: ensure the kernel is compiled for LP64") and c931d34ea085 ("arm64: build with baremetal linker target instead of Linux when available"). The former is the most critical; without it, this error occurs:
The latter is a follow up fix, see 38fc42486775 ("arm64: Use aarch64elf and aarch64elfb emulation mode variants") and its revert 96f95a17c1cf ("Revert "arm64: Use aarch64elf and aarch64elfb emulation mode variants"") for more information. However, it introduces a recursive variable error on 4.9 at least, which I don't understand because it is used just like that in
|
let's keep arm64 as a separate work item. KASLR in particular is broken on arm64, which is not on in the defconfig but is on Pixel devices. |
Great, will make my life easier :) I'll send out the patches in a few hours with you, @Ajs1984, and @samitolvanen on CC. |
Here are the results of test build (no patches applied yet):
|
Patches sent and accepted by Sasha: https://lore.kernel.org/stable/20190411143924.GK11568@sasha-vm/ We still need https://reviews.llvm.org/rL357885 on the LLVM side to fix booting with KASLR. I don't know when the next Buster refresh will be as it doesn't appear to be on a timer in Jenkins just yet: https://llvm-jenkins.debian.net/job/llvm-toolchain-buster-8-binaries/ |
@sylvestre could we get the Buster clang-9 build refreshed? We'd like to turn this on but we need an LLD patch that isn't in the current version of clang-9. |
Sure, builds restarted! |
4.4.171 will have all of the patches we need for this but that might not get released for a bit. I think we can ship everything but 4.4 now then deal with 4.4 when it's ready to avoid carrying any patches. |
Why not just add necessary patches now and remove later when they start failing? |
I guess either way it requires a pull request to enable it in Travis when ready or remove the patches when it starts failing. It's up to you then. |
Good enough? |
patches/4.4/x86_64/0001-x86-build-Mark-per-CPU-symbols-as-absolute-explicitl.patch
Outdated
Show resolved
Hide resolved
Travis shows green, but there was a segfault with x86_64 LLD:
|
I don't see that? https://travis-ci.com/ClangBuiltLinux/continuous-integration/jobs/194715072 It happens on arm64 but it's always been that way (and it happens with GCC so it isn't a clang issue: https://gist.github.com/nathanchance/85343c5e4c23c360e389b332c052890e). |
Sorry, I was checking arm64 travis log, everything is fine then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Presubmit with all of the targets: https://travis-ci.com/nathanchance/continuous-integration/builds/109182936
🆒 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like I want to turn of bfd builds soon. Maybe not now, but soon.
Addressing the following issues:
Malformed linker script: vmlinux.lds linux#29alignment must be power of 2 linux#218LLD doesn't support common-page-size=value keyword linux#31LLD doesn't support -z nodefaultlib flag linux#94-m linker option has higher priority than OUTPUT_FORMAT directive linux#30