Re: ARMv7 Linux + Rust doesn't boot when compiling with only LLVM=1
From: Rudraksha Gupta <hidden>
Date: 2025-12-17 10:21:13
Also in:
llvm, regressions, rust-for-linux, stable
On 12/16/25 06:41, Christian Schrefl wrote:
On 12/14/25 12:54 AM, Rudraksha Gupta wrote:quoted
Hello all, I have the following problem: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2635 In short, what is happening is the following: - The kernel boots and outputs via UART when I build the kernel with the following: make LLVM=1 ARCH="$arm" CC="${CC:-gcc}" - The kernel doesn't boot and there is no output via UART when I build the kernel with the following: make LLVM=1 ARCH="$arm" The only difference being: CC="${CC:-gcc}". Is this expected? I think this was present in the Linux kernel ever since Rust was enabled for ARMv7, and I never encountered it because postmarketOS was originally building the first way.I've managed to the get the build setup for qemu-armv7. For some reason I could not get past the initrd even on kernels that are supposed to work, but I think that is unrelated (and not a kernel issue).
Yep, I just got qemu-arm working to drop into a debug shell for now. I have to look into why other things aren't behaving nicely (but that's a problem for later me :P). For now, it seems to demonstrate the problem nicely: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2635#note_521740
On the linux-next kernel I didn't get any output on the console from qemu so I think I've reproduced the issue. Changing CONFIG_RUST=n did not change the behavior. So I this is almost certainly a LLVM/clang issue and not a Rust issue. I'll try to do a bit more digging, but I'm not sure how much I'll get done.
Did a little more testing in addition to the testing in the gitlab issue mentioned above: - Removed Rust configs from linux-next/pmos.config -> didn't boot on qemu-arm and my phone - Then I removed Rust dependencies from linux-next/APKBUILD -> didn't boot on qemu-arm and my phone - used linux-stable instead of linux-next -> booted on qemu-arm to a debug shell linux-stable is built via gcc: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/linux-stable/APKBUILD#L179 linux-next is built via clang: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/device/testing/linux-next/APKBUILD#L68
Adding the LLVM and ARM lists to this conversation. Cheers, Christian