lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+G9fYt4otQK4pHv8pJBW9e28yHSGCDncKquwuJiJ_1ou0pq0w@mail.gmail.com>
Date: Tue, 15 Apr 2025 17:10:44 +0530
From: Naresh Kamboju <naresh.kamboju@...aro.org>
To: Miguel Ojeda <ojeda@...nel.org>, Christian Schrrefl <chrisi.schrefl@...il.com>
Cc: 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
Subject: Re: Build: arm rustgcc unknown argument '-mno-fdpic'

Hey Christian, Miguel,

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.

diff --git a/rust/Makefile b/rust/Makefile
index 3aca903a7d08..f207ba0ed466 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -273,7 +273,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387
-mpreferred-stack-boundary=% \
  -fzero-call-used-regs=% -fno-stack-clash-protection \
  -fno-inline-functions-called-once -fsanitize=bounds-strict \
  -fstrict-flex-arrays=% -fmin-function-alignment=% \
- -fzero-init-padding-bits=% \
+ -fzero-init-padding-bits=% -mno-fdpic \
  --param=% --param asan-%

 # Derived from `scripts/Makefile.clang`.

- Naresh

>
> I hope that helps!
>
> Cheers,
> Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ