News for hackers. Stuff that matters.
Re:OpenMandriva, the first Clang-built Linux distribution by qhwudbebd on Sunday June 16, 2019 @09:10AM (#20195271)
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?)
Re:OpenMandriva, the first Clang-built Linux distribution by ndesaulniers on Sunday June 16, 2019 @01:44PM (#20196804)
Good question! This is my day job! Builds are looking pretty green!

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.

Re:OpenMandriva, the first Clang-built Linux distribution by qhwudbebd on Sunday June 16, 2019 @05:02PM (#20197865)
Ah, 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.
Re:OpenMandriva, the first Clang-built Linux distribution by ndesaulniers on Sunday June 16, 2019 @05:07PM (#20197901)
Great! Please report any bugs you find via our issue tracker on the site linked above (if we haven't already spotted them).
Re:OpenMandriva, the first Clang-built Linux distribution by qalmakka on Sunday June 16, 2019 @09:18AM (#20195301)
The 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).
Re:OpenMandriva, the first Clang-built Linux distribution by Conan_Kudo on Sunday June 16, 2019 @09:17AM (#20195296)
The 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).
Re:OpenMandriva, the first Clang-built Linux distribution by ndesaulniers on Sunday June 16, 2019 @01:45PM (#20196817)
False! Mainline builds cleanly for most arches with clang.
Re:OpenMandriva, the first Clang-built Linux distribution by BurningCycles on Monday June 17, 2019 @04:45AM (#20201042)
But 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.
Re:OpenMandriva, the first Clang-built Linux distribution by Conan_Kudo on Sunday June 16, 2019 @02:45PM (#20197163)
Not with any released version of clang, but yes, it works with snapshots of git master...
Re:OpenMandriva, the first Clang-built Linux distribution by ndesaulniers on Sunday June 16, 2019 @05:11PM (#20197920)
Again, 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.

Re:OpenMandriva, the first Clang-built Linux distribution by Conan_Kudo on Sunday June 16, 2019 @09:41PM (#20199167)
I'm mainly working off our experience in OpenMandriva, so at least for your standard general-purpose Linux distribution, it doesn't work yet.
Re:OpenMandriva, the first Clang-built Linux distribution by Twirrim on Sunday June 16, 2019 @10:38AM (#20195665)
The 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-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/