[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAo_F_UP1Gd4jHlZ@dell-precision-5540>
Date: Thu, 24 Apr 2025 09:39:35 -0400
From: Ben Wolsieffer <ben.wolsieffer@...ring.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Naresh Kamboju <naresh.kamboju@...aro.org>,
Miguel Ojeda <ojeda@...nel.org>,
Christian Schrrefl <chrisi.schrefl@...il.com>,
Russell King <rmk+kernel@...linux.org.uk>,
Rudraksha Gupta <guptarud@...il.com>,
Alice Ryhl <aliceryhl@...gle.com>, Ard Biesheuvel <ardb@...nel.org>,
anders.roxell@...aro.org, arnd@...db.de, dan.carpenter@...aro.org,
laura.nao@...labora.com, linux-kernel@...r.kernel.org,
lkft-triage@...ts.linaro.org, regressions@...ts.linux.dev,
rust-for-linux@...r.kernel.org, torvalds@...ux-foundation.org,
Nick Clifton <nickc@...hat.com>,
Richard Earnshaw <richard.earnshaw@....com>,
Ramana Radhakrishnan <ramanara@...dia.com>
Subject: Re: Build: arm rustgcc unknown argument '-mno-fdpic'
On Sat, Apr 19, 2025 at 12:30:01AM +0200, Miguel Ojeda wrote:
> Thanks a lot for the details!
>
> To clarify, this is for GCC kernel builds: skipping the flag is done
> for libclang under GCC builds (because `bindgen` always uses libclang,
> and `bindgen` is used by Rust to understand C headers).
>
> So GCC will get the flag for the C side of the kernel builds, but
> libclang will not get the flag because Clang doesn't recognize it.
> Thus, if Clang vs. GCC differ in how they compute the layout of some
> type, then we would have an issue "mixing" them.
>
> As you can imagine, GCC kernel builds with Rust enabled are a hack due
> to that, and it would be ideal to get `bindgen` to somehow be able to
> understand C headers as GCC does:
>
> https://github.com/rust-lang/rust-bindgen/issues/1949
-mno-fdpic disables a GCC feature that we don't want for kernel builds.
clang does not support this feature, so it always behaves as though
-mno-fdpic is passed. Therefore, it should be fine to mix the two, at
least as far as FDPIC is concerned.
Ben
Powered by blists - more mailing lists