Re: [PATCH] rust: Fix enabling Rust and building with GCC for LoongArch
From: WANG Rui
Date: Fri Mar 28 2025 - 22:43:28 EST
On Sat, Mar 29, 2025 at 12:15 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
Thanks for the review and feedback!
> In any case, the usual question for these "skipped flags" is whether
> they could affect the output of `bindgen`, i.e. could they modify
> layouts somehow?
These "skipped flags" won't affect the output of `bindgen`.
>
> Also, it would be nice to mention a bit more what was the build error
> and the GCC version in the commit message.
To make it easier for the maintainer to include more details in the
commit message, I've attached the original build error message below.
BINDGEN rust/bindings/bindings_generated.rs
error: unknown argument: '-mexplicit-relocs'
error: unknown argument: '-mdirect-extern-access'
error: unsupported argument 'normal' to option '-mcmodel=' for target 'unknown'
error: unknown target triple 'unknown'
panicked at /home/hev/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bindgen-0.71.1/ir/context.rs:564:15:
libclang error; possible causes include:
- Invalid flag syntax
- Unrecognized flags
- Invalid flag arguments
- File I/O errors
- Host vs. target architecture mismatch
If you encounter an error missing from this list, please file an issue or a PR!
gcc version 14.2.0 (crosstool-NG 1.27.0)
>
> Finally, regarding the Cc: stable, I guess that means 6.12+ since it
> is the first LTS with loongarch64, right?
Also, the `Cc: stable` is indeed targeting 6.12+, as it's the first
LTS with LoongArch64.
Thanks again!
Cheers,
-Rui