From: Nathan Chancellor <nathan@kernel.org>
To: Rudraksha Gupta <guptarud@gmail.com>
Cc: "Christian Schrefl" <chrisi.schrefl@gmail.com>,
stable@vger.kernel.org, regressions@lists.linux.dev,
rust-for-linux@vger.kernel.org, "Miguel Ojeda" <ojeda@kernel.org>,
llvm@lists.linux.dev,
"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Benno Lossin" <lossin@kernel.org>
Subject: Re: ARMv7 Linux + Rust doesn't boot when compiling with only LLVM=1
Date: Fri, 19 Dec 2025 14:11:47 -0700 [thread overview]
Message-ID: <20251219211147.GA1407372@ax162> (raw)
In-Reply-To: <1910f4b6-db74-4c86-9010-28ab4462c5a7@gmail.com>
Hi Rudraksha,
On Wed, Dec 17, 2025 at 02:21:11AM -0800, Rudraksha Gupta wrote:
> On 12/16/25 06:41, Christian Schrefl wrote:
> > On 12/14/25 12:54 AM, Rudraksha Gupta wrote:
> > > 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
It certainly seems like LLVM / clang is a factor here based on the fact
that LLVM binutils were being used with GCC based on the original report
using 'LLVM=1 CC=gcc'. A few additional ideas for narrowing this down:
* Does this reproduce with GNU binutils + clang (i.e.,
CROSS_COMPILE=... CC=clang)? This would further confirm that clang
is the cuplrit since GNU binutils and GCC are confirmed working with
linux-stable, correct?
* Does this reproduce when linux-stable is built with clang / LLVM=1?
This would rule out a -next specific regression as well as allow
diffing the linux-stable GCC configuration with the clang
configuration to see if there are any configurations that get
enabled only with clang, which could be another reason no issue is
seen with GCC.
* Our continuous integration boot tests several ARM configurations in
QEMU, including Alpine Linux's:
https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/20379046102/job/58575229973
So it is possible that a postmarketOS configuration option
introduces this?
The results of that testing might give us a more obvious direction to go
for troubleshooting, especially since this appears to reproduce in QEMU,
which should make debugging in gdb possible.
Also, what version of clang is this?
Cheers,
Nathan
next prev parent reply other threads:[~2025-12-19 21:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-13 23:54 ARMv7 Linux + Rust doesn't boot when compiling with only LLVM=1 Rudraksha Gupta
2025-12-14 6:06 ` Miguel Ojeda
2025-12-14 7:34 ` Rudraksha Gupta
2025-12-15 11:19 ` Gary Guo
2025-12-17 10:01 ` Rudraksha Gupta
2025-12-15 12:17 ` Christian Schrefl
2025-12-17 10:10 ` Rudraksha Gupta
2025-12-16 14:41 ` Christian Schrefl
2025-12-17 10:21 ` Rudraksha Gupta
2025-12-19 21:11 ` Nathan Chancellor [this message]
2025-12-20 1:19 ` Christian Schrefl
2025-12-22 0:00 ` Rudraksha Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219211147.GA1407372@ax162 \
--to=nathan@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=chrisi.schrefl@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=guptarud@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=regressions@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox