[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72napRCGp3Z-xZJaA9zcgREe3Xy5efW8VW=NEZ13DAy+Xw@mail.gmail.com>
Date: Tue, 15 Apr 2025 17:38:54 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Naresh Kamboju <naresh.kamboju@...aro.org>
Cc: 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, Ben Wolsieffer <ben.wolsieffer@...ring.com>,
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 Tue, Apr 15, 2025 at 1:40 PM Naresh Kamboju
<naresh.kamboju@...aro.org> wrote:
>
> On Tue, 8 Apr 2025 at 00:07, Miguel Ojeda <ojeda@...nel.org> wrote:
> >
> > On Mon, 07 Apr 2025 22:58:02 +0530 Naresh Kamboju <naresh.kamboju@...aro.org> wrote:
> > >
> > > Regressions on arm build with config rustgcc-lkftconfig-kselftest on the
> > > Linux mainline and next failed with CONFIG_RUST=y enabled.
> >
> > > Bad: next-20250327
> > > Good: next-20250326
> >
> > > Unable to generate bindings: clang diagnosed error: error: unknown
> > > argument: '-mno-fdpic'
> >
> > I assume this is the arm support, i.e. commit ccb8ce526807 ("ARM: 9441/1:
> > rust: Enable Rust support for ARMv7").
> >
> > Clang does not seem to support `-mno-fdpic`, thus you probably need to add it to
> > `bindgen_skip_c_flags` in `rust/Makefile` so that it gets skipped when the C
> > compiler is GCC.
> >
> > If you do so, please double-check if the flag could potentially alter the ABI in
> > a way that `bindgen` would generate the wrong bindings.
>
> I tested this idea and it works but I don't know enough about
> rust to double-check if the flag could potentially alter the
> ABI in a way that `bindgen` would generate the wrong bindings.
Yeah, it would be nice to have someone knowledgeable about the
arch/GCC/flag confirm or not -- I don't think Rust knowledge is
needed, i.e. it is mostly about how GCC behaves with/without the flag
and vs. Clang (since `bindgen` uses libclang to parse code).
The original commit adding it to arm (and similar ones for sh and xtensa) says:
When building with an arm-*-uclinuxfdpiceabi toolchain, the FDPIC ABI is
enabled by default but should not be used to build the kernel.
So it sounds like it is only an issue for particular toolchains/targets anyway?
Cc'ing Ben who introduced it, and the arm port GCC maintainers in case
they may be able to tell us more -- thanks in advance, and sorry for
any potential noise!
Cheers,
Miguel
Powered by blists - more mailing lists