5 ms·
Doesn’t mention if the kernel built fine with clang, that would be interesting if so as that used to be tricky. (I’m probably out of date; maybe it’s fine nowad
by qhwudbebd 7y ago
Doesn’t mention if the kernel built fine with clang, that would be interesting if so as that used to be tricky. (I’m probably out of date; maybe it’s fine nowadays?)
- Conan_Kudo 7y agoThe kernel is not built with clang as that only works with ARM architectures right now (the Android kernel supports it, but the mainline kernel does not).
- ndesaulniers 7y agoFalse! Mainline builds cleanly for most arches with clang.
- Conan_Kudo 7y agoNot with any released version of clang, but yes, it works with snapshots of git master...
- ndesaulniers 7y agoAgain, false! This is highly dependent on: 1. What arch are you targeting. 2. What version of Linux are you trying to build? Mainline, stable, next? 3. What configs are you trying. 4. What version of clang are you using. For example, pixel 2 kernel is arm64, 4.4 stable kernel, limited configs, and clang-4. Things for the most part are pretty green with released versions of clang. There are some long tail configs or combos of the above, but it's pretty minimal and we have a good handle on them.
- Conan_Kudo 7y agoI'm mainly working off our experience in OpenMandriva, so at least for your standard general-purpose Linux distribution, it doesn't work yet.
- BurningCycles 7y agoBut is the result stable ? I remember bulding it with some patches a year or two ago, and while it compile fine, it crashed horribly when booting.
- qalmakka 7y agoThe kernel _almost_ builds fine with Clang; one of the major stopgaps were the usage of VLAIS (which I think have been all removed given that they amount to pure insanity) and `asm goto`, which it has been implemented by LLVM (I think it will become available on stable when 9.0 is released this autumn).
- Twirrim 7y agoThe kernel still doesn't build with clang cleanly. There's a very active ongoing effort to deal with problems. https://www.phoronix.com/scan.php?page=news_item&px=Clang-Kernel-2018 https://www.phoronix.com/scan.php?page=news_item&px=Clang-Ke... from the Linux Plumber's conference last year, and there's work that will be landing as part of 5.2 to help: https://lwn.net/Articles/788532/ https://lwn.net/Articles/788532/
- ndesaulniers 7y agoGood question! This is my day job! Builds are looking pretty green! https://clangbuiltlinux.github.io/ https://clangbuiltlinux.github.io/ X86_64 required the implementation of ASM goto, which we just shipped. You'll need to build clang from source, but the feature will be in clang-9.0 release. Other arches should build with clang-8 (technically x86_64 will build pre 4.19 kernels) but we shipped pixel 2 kernels w/ clang-4.0 so older Clang's may work depending on your target arch/tree/configs.
- qhwudbebd 7y agoAh, that's really interesting, many thanks. I'd be building from source anyway, so I'll have to try clang HEAD with Linus' tree and see how it goes.
- ndesaulniers 7y agoGreat! Please report any bugs you find via our issue tracker on the site linked above (if we haven't already spotted them).