RISC-V: Re-enable GCC+Rust builds
Conor Dooley
conor at kernel.org
Thu Sep 4 04:28:19 PDT 2025
On Wed, Sep 03, 2025 at 08:59:29AM +0800, Asuna wrote:
> > That particular one might be a problem not because of -mstack-protector-guard itself, but rather three options get added at once:
> > $(eval KBUILD_CFLAGS += -mstack-protector-guard=tls \
> > -mstack-protector-guard-reg=tp \
> > -mstack-protector-guard-offset=$(shell \
> > awk '{if ($$2 == "TSK_STACK_CANARY") print $$3;}' \
> > $(objtree)/include/generated/asm-offsets.h))
> > and the other ones might be responsible for the error.
>
>
> I still don't understand the problem here. `bindgen_skip_c_flags` in
> `rust/Makefile` contains a pattern `-mstack-protector-guard%`, the % at the
> end enables it to match all those 3 options at the same time, and
> `filter-out` function removes them before passing to Rust bindgen's
> libclang. Am I missing something here?
If they don't ever appear with gcc + llvm builds, that's fine.
> > Similarly, something like -Wno-unterminated-string-initialization could cause a problem if gcc supports it but not libclang.
>
>
> Yes. However, this option is only about warnings, not architecture related
> and does not affect the generated results, so simply adding it into
> `bindgen_skip_c_flags` patterns should be enough, I think.
>
> > I think you're mostly better off catching that sort of thing in Kconfig, where possible and just make incompatible mixes invalid. What's actually incompatible is likely going to depend heavily on what options are enabled.
>
> Sounds better, I'll go down that path.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20250904/a6d438a7/attachment.sig>
More information about the linux-riscv
mailing list