From: Ben Wolsieffer <ben.wolsieffer@hefring.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
Miguel Ojeda <ojeda@kernel.org>,
Christian Schrrefl <chrisi.schrefl@gmail.com>,
Russell King <rmk+kernel@armlinux.org.uk>,
Rudraksha Gupta <guptarud@gmail.com>,
Alice Ryhl <aliceryhl@google.com>,
Ard Biesheuvel <ardb@kernel.org>,
anders.roxell@linaro.org, arnd@arndb.de,
dan.carpenter@linaro.org, laura.nao@collabora.com,
linux-kernel@vger.kernel.org, lkft-triage@lists.linaro.org,
regressions@lists.linux.dev, rust-for-linux@vger.kernel.org,
torvalds@linux-foundation.org, Nick Clifton <nickc@redhat.com>,
Richard Earnshaw <richard.earnshaw@arm.com>,
Ramana Radhakrishnan <ramanara@nvidia.com>
Subject: Re: Build: arm rustgcc unknown argument '-mno-fdpic'
Date: Thu, 24 Apr 2025 09:39:35 -0400 [thread overview]
Message-ID: <aAo_F_UP1Gd4jHlZ@dell-precision-5540> (raw)
In-Reply-To: <CANiq72nPtr1FE_SBU_+wHVptfjnoSGaxjP4LWMzVbOF0M6LvnA@mail.gmail.com>
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
next prev parent reply other threads:[~2025-04-24 13:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 17:28 Build: arm rustgcc unknown argument '-mno-fdpic' Naresh Kamboju
2025-04-07 18:37 ` Miguel Ojeda
2025-04-15 11:40 ` Naresh Kamboju
2025-04-15 15:38 ` Miguel Ojeda
2025-04-18 19:44 ` Ben Wolsieffer
2025-04-18 22:30 ` Miguel Ojeda
2025-04-24 13:39 ` Ben Wolsieffer [this message]
2025-04-24 17:01 ` Miguel Ojeda
2025-05-20 23:21 ` Rudraksha Gupta
2025-05-21 6:49 ` Miguel Ojeda
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=aAo_F_UP1Gd4jHlZ@dell-precision-5540 \
--to=ben.wolsieffer@hefring.com \
--cc=aliceryhl@google.com \
--cc=anders.roxell@linaro.org \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=chrisi.schrefl@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=guptarud@gmail.com \
--cc=laura.nao@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkft-triage@lists.linaro.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=naresh.kamboju@linaro.org \
--cc=nickc@redhat.com \
--cc=ojeda@kernel.org \
--cc=ramanara@nvidia.com \
--cc=regressions@lists.linux.dev \
--cc=richard.earnshaw@arm.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=rust-for-linux@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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