* [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic'
@ 2025-05-22 12:02 Rudraksha Gupta
2025-05-22 12:52 ` Miguel Ojeda
2025-05-22 22:13 ` Miguel Ojeda
0 siblings, 2 replies; 6+ messages in thread
From: Rudraksha Gupta @ 2025-05-22 12:02 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt
Cc: rust-for-linux, linux-kernel, llvm, torvalds, Ben Wolsieffer,
Naresh Kamboju, Christian Schrrefl, Russell King, Rudraksha Gupta,
Ard Biesheuvel, anders.roxell, arnd, dan.carpenter, laura.nao,
lkft-triage, regressions, Nick Clifton, Richard Earnshaw,
Ramana Radhakrishnan, Miguel Ojeda,
Linux Kernel Functional Testing
Currently rust on arm fails to compile due to '-mno-fdpic'. This flag
disables a GCC feature that we don't want for kernel builds, so let's
skip it as it doesn't apply to Clang.
UPD include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
RUSTC L rust/core.o
BINDGEN rust/bindings/bindings_generated.rs
BINDGEN rust/bindings/bindings_helpers_generated.rs
CC rust/helpers/helpers.o
Unable to generate bindings: clang diagnosed error: error: unknown argument: '-mno-fdpic'
make[2]: *** [rust/Makefile:369: rust/bindings/bindings_helpers_generated.rs] Error 1
make[2]: *** Deleting file 'rust/bindings/bindings_helpers_generated.rs'
make[2]: *** Waiting for unfinished jobs....
Unable to generate bindings: clang diagnosed error: error: unknown argument: '-mno-fdpic'
make[2]: *** [rust/Makefile:349: rust/bindings/bindings_generated.rs] Error 1
make[2]: *** Deleting file 'rust/bindings/bindings_generated.rs'
make[1]: *** [/home/pmos/build/src/linux-next-next-20250521/Makefile:1285: prepare] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYvOanQBYXKSg7C6EU30k8sTRC0JRPJXYu7wWK51w38QUQ@mail.gmail.com/
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Tested-by: Rudraksha Gupta <guptarud@gmail.com>
Acked-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
Changes in v2:
- Fixed patch formatting issues
- Link to v1: https://lore.kernel.org/r/20250520-rust-mno-fdpic-arm-fix-v1-1-44e77fe6b2a1@gmail.com
---
rust/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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`.
---
base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21
change-id: 20250520-rust-mno-fdpic-arm-fix-940a58bf9433
Best regards,
--
Rudraksha Gupta <guptarud@gmail.com>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic'
2025-05-22 12:02 [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic' Rudraksha Gupta
@ 2025-05-22 12:52 ` Miguel Ojeda
2025-05-22 13:27 ` Rudraksha Gupta
2025-05-22 22:13 ` Miguel Ojeda
1 sibling, 1 reply; 6+ messages in thread
From: Miguel Ojeda @ 2025-05-22 12:52 UTC (permalink / raw)
To: Rudraksha Gupta
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, rust-for-linux,
linux-kernel, llvm, torvalds, Ben Wolsieffer, Naresh Kamboju,
Christian Schrrefl, Russell King, Ard Biesheuvel, anders.roxell,
arnd, dan.carpenter, laura.nao, lkft-triage, regressions,
Nick Clifton, Richard Earnshaw, Ramana Radhakrishnan,
Linux Kernel Functional Testing
On Thu, May 22, 2025 at 2:02 PM Rudraksha Gupta <guptarud@gmail.com> wrote:
>
> Currently rust on arm fails to compile due to '-mno-fdpic'. This flag
> disables a GCC feature that we don't want for kernel builds, so let's
> skip it as it doesn't apply to Clang.
>
> UPD include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> RUSTC L rust/core.o
> BINDGEN rust/bindings/bindings_generated.rs
> BINDGEN rust/bindings/bindings_helpers_generated.rs
> CC rust/helpers/helpers.o
> Unable to generate bindings: clang diagnosed error: error: unknown argument: '-mno-fdpic'
> make[2]: *** [rust/Makefile:369: rust/bindings/bindings_helpers_generated.rs] Error 1
> make[2]: *** Deleting file 'rust/bindings/bindings_helpers_generated.rs'
> make[2]: *** Waiting for unfinished jobs....
> Unable to generate bindings: clang diagnosed error: error: unknown argument: '-mno-fdpic'
> make[2]: *** [rust/Makefile:349: rust/bindings/bindings_generated.rs] Error 1
> make[2]: *** Deleting file 'rust/bindings/bindings_generated.rs'
> make[1]: *** [/home/pmos/build/src/linux-next-next-20250521/Makefile:1285: prepare] Error 2
> make: *** [Makefile:248: __sub-make] Error 2
>
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes: https://lore.kernel.org/all/CA+G9fYvOanQBYXKSg7C6EU30k8sTRC0JRPJXYu7wWK51w38QUQ@mail.gmail.com/
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Tested-by: Rudraksha Gupta <guptarud@gmail.com>
> Acked-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
Thanks for sending a v2! I was going to fix it myself, but this is
even better :)
By the way, submitting a patch typically requires / generally implies
that you actually tested it, so your own Tested-by is usually not
provided.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic'
2025-05-22 12:52 ` Miguel Ojeda
@ 2025-05-22 13:27 ` Rudraksha Gupta
2025-05-22 13:48 ` Miguel Ojeda
0 siblings, 1 reply; 6+ messages in thread
From: Rudraksha Gupta @ 2025-05-22 13:27 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, rust-for-linux,
linux-kernel, llvm, torvalds, Ben Wolsieffer, Naresh Kamboju,
Christian Schrrefl, Russell King, Ard Biesheuvel, anders.roxell,
arnd, dan.carpenter, laura.nao, lkft-triage, regressions,
Nick Clifton, Richard Earnshaw, Ramana Radhakrishnan,
Linux Kernel Functional Testing
> Thanks for sending a v2! I was going to fix it myself, but this is
> even better :)
>
> By the way, submitting a patch typically requires / generally implies
> that you actually tested it, so your own Tested-by is usually not
> provided.
Thanks! :D Happy to send in a v3 if needed
Rudraksha
>
> Cheers,
> Miguel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic'
2025-05-22 13:27 ` Rudraksha Gupta
@ 2025-05-22 13:48 ` Miguel Ojeda
2025-05-22 15:14 ` Rudraksha Gupta
0 siblings, 1 reply; 6+ messages in thread
From: Miguel Ojeda @ 2025-05-22 13:48 UTC (permalink / raw)
To: Rudraksha Gupta
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, rust-for-linux,
linux-kernel, llvm, torvalds, Ben Wolsieffer, Naresh Kamboju,
Christian Schrrefl, Russell King, Ard Biesheuvel, anders.roxell,
arnd, dan.carpenter, laura.nao, lkft-triage, regressions,
Nick Clifton, Richard Earnshaw, Ramana Radhakrishnan,
Linux Kernel Functional Testing
On Thu, May 22, 2025 at 3:27 PM Rudraksha Gupta <guptarud@gmail.com> wrote:
>
> Thanks! :D Happy to send in a v3 if needed
No worries, I will apply this one :)
I will remove the tag, unless you want it there for some reason (e.g.
because you want to point out some extra testing that goes beyond what
would normally be done).
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic'
2025-05-22 13:48 ` Miguel Ojeda
@ 2025-05-22 15:14 ` Rudraksha Gupta
0 siblings, 0 replies; 6+ messages in thread
From: Rudraksha Gupta @ 2025-05-22 15:14 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, rust-for-linux,
linux-kernel, llvm, torvalds, Ben Wolsieffer, Naresh Kamboju,
Christian Schrrefl, Russell King, Ard Biesheuvel, anders.roxell,
arnd, dan.carpenter, laura.nao, lkft-triage, regressions,
Nick Clifton, Richard Earnshaw, Ramana Radhakrishnan,
Linux Kernel Functional Testing
> No worries, I will apply this one :)
>
> I will remove the tag, unless you want it there for some reason (e.g.
> because you want to point out some extra testing that goes beyond what
> would normally be done).
>
> Thanks!
Removing the tag is fine by me :)
Rudraksha
>
> Cheers,
> Miguel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic'
2025-05-22 12:02 [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic' Rudraksha Gupta
2025-05-22 12:52 ` Miguel Ojeda
@ 2025-05-22 22:13 ` Miguel Ojeda
1 sibling, 0 replies; 6+ messages in thread
From: Miguel Ojeda @ 2025-05-22 22:13 UTC (permalink / raw)
To: Rudraksha Gupta
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, rust-for-linux,
linux-kernel, llvm, torvalds, Ben Wolsieffer, Naresh Kamboju,
Christian Schrrefl, Russell King, Ard Biesheuvel, anders.roxell,
arnd, dan.carpenter, laura.nao, lkft-triage, regressions,
Nick Clifton, Richard Earnshaw, Ramana Radhakrishnan,
Linux Kernel Functional Testing
On Thu, May 22, 2025 at 2:02 PM Rudraksha Gupta <guptarud@gmail.com> wrote:
>
> Currently rust on arm fails to compile due to '-mno-fdpic'. This flag
> disables a GCC feature that we don't want for kernel builds, so let's
> skip it as it doesn't apply to Clang.
>
> UPD include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> RUSTC L rust/core.o
> BINDGEN rust/bindings/bindings_generated.rs
> BINDGEN rust/bindings/bindings_helpers_generated.rs
> CC rust/helpers/helpers.o
> Unable to generate bindings: clang diagnosed error: error: unknown argument: '-mno-fdpic'
> make[2]: *** [rust/Makefile:369: rust/bindings/bindings_helpers_generated.rs] Error 1
> make[2]: *** Deleting file 'rust/bindings/bindings_helpers_generated.rs'
> make[2]: *** Waiting for unfinished jobs....
> Unable to generate bindings: clang diagnosed error: error: unknown argument: '-mno-fdpic'
> make[2]: *** [rust/Makefile:349: rust/bindings/bindings_generated.rs] Error 1
> make[2]: *** Deleting file 'rust/bindings/bindings_generated.rs'
> make[1]: *** [/home/pmos/build/src/linux-next-next-20250521/Makefile:1285: prepare] Error 2
> make: *** [Makefile:248: __sub-make] Error 2
>
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes: https://lore.kernel.org/all/CA+G9fYvOanQBYXKSg7C6EU30k8sTRC0JRPJXYu7wWK51w38QUQ@mail.gmail.com/
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Tested-by: Rudraksha Gupta <guptarud@gmail.com>
> Acked-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
Applied to `rust-next` -- thanks everyone!
[ Naresh provided the draft diff [1].
Ben explained [2]:
FDPIC is only relevant with no-MMU targets, and then only for userspace.
When configured for the arm-*-uclinuxfdpiceabi target, GCC enables FDPIC
by default to facilitate compiling userspace programs. FDPIC is never
used for the kernel, and we pass -mno-fdpic when building the kernel to
override the default and make sure FDPIC is disabled.
and [3]:
-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.
[1] https://lore.kernel.org/rust-for-linux/CA+G9fYt4otQK4pHv8pJBW9e28yHSGCDncKquwuJiJ_1ou0pq0w@mail.gmail.com/
[2] https://lore.kernel.org/rust-for-linux/aAKrq2InExQk7f_k@dell-precision-5540/
[3] https://lore.kernel.org/rust-for-linux/aAo_F_UP1Gd4jHlZ@dell-precision-5540/
- Miguel ]
[ Reworded title. - Miguel ]
Cheers,
Miguel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-22 22:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 12:02 [PATCH v2] arm: Fix rustgcc unknown argument '-mno-fdpic' Rudraksha Gupta
2025-05-22 12:52 ` Miguel Ojeda
2025-05-22 13:27 ` Rudraksha Gupta
2025-05-22 13:48 ` Miguel Ojeda
2025-05-22 15:14 ` Rudraksha Gupta
2025-05-22 22:13 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).