|
|
Subscribe / Log in / New account

Building the kernel with clang

Building the kernel with clang

Posted Sep 19, 2017 21:17 UTC (Tue) by ndesaulniers (subscriber, #110768)
In reply to: Building the kernel with clang by ndesaulniers
Parent article: Building the kernel with Clang

I just spoke with Greg more about UAL so that I might better understand the context around the issue. It seems that UAL is an issue for ARM (pre ARMv8, so 32b ARM). He likened the situation to: "imagine you have a code base written in AT&T syntax, and your assembler only works with GAS, or vice versa." I'm not sure what the situation is for ARMv8, so I'm going to give it a shot (disabling `-no-integrated-as`) and see what breaks.


to post comments

Building the kernel with clang

Posted Sep 19, 2017 21:21 UTC (Tue) by ndesaulniers (subscriber, #110768) [Link] (1 responses)

Turns out it breaks pretty quick. Warnings about "DWARF2 only supporting one section per compilation unit," and errors around unexpected tokens and intruction mnemonics. Ok, bugs for another day.

Building the kernel with clang

Posted Sep 25, 2017 14:58 UTC (Mon) by mwsealey (subscriber, #71282) [Link]

Try building with DWARF4.. :)

Building the kernel with clang

Posted Sep 19, 2017 23:05 UTC (Tue) by Sesse (subscriber, #53779) [Link] (1 responses)

You mean Intel and not GAS in your metaphor? (The gas default x86 syntax is AT&T.)

Building the kernel with clang

Posted Sep 20, 2017 0:00 UTC (Wed) by ndesaulniers (subscriber, #110768) [Link]

Yes, sorry! objdump -M intel -d <...>

Building the kernel with clang

Posted Sep 20, 2017 7:04 UTC (Wed) by alison (subscriber, #63752) [Link] (2 responses)

I take it then that there is no hope for building ARM32 with clang? Increasingly it feels like ARM32 users should upgrade to ARM64 in ordert to get not only clang support but also eBPF.

Building the kernel with clang

Posted Sep 20, 2017 21:00 UTC (Wed) by ndesaulniers (subscriber, #110768) [Link]

Personally, my professional work is on arm64 devices, and for a hobby I have x86-64 machines. All other architectures are important to support, but I don't have the bandwidth to support them all. My hope is that work we do on arm64 and x86-64 encourages others to step up and help support their favorite architectures.

Building the kernel with clang

Posted Sep 21, 2017 16:38 UTC (Thu) by mkaehlcke (guest, #61834) [Link]

I have no first hand experience with supporting arm32 builds with clang, but given that the kernel now has the generic/kbuild bits for supporting clang and that there are older patch sets for arm32 out there I imagine it shouldn't be that hard. The stack shared by Arnd Bergmann in April could be a starting point: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/play... / https://www.spinics.net/lists/linux-fsdevel/msg109823.html


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds