Skip to content

Commit 33549fc

Browse files
ConchuODpalmer-dabbelt
authored andcommitted
RISC-V: disallow gcc + rust builds
During the discussion before supporting rust on riscv, it was decided not to support gcc yet, due to differences in extension handling compared to llvm (only the version of libclang matching the c compiler is supported). Recently Jason Montleon reported [1] that building with gcc caused build issues, due to unsupported arguments being passed to libclang. After some discussion between myself and Miguel, it is better to disable gcc + rust builds to match the original intent, and subsequently support it when an appropriate set of extensions can be deduced from the version of libclang. Closes: https://lore.kernel.org/all/[email protected]/ [1] Link: https://lore.kernel.org/all/20240926-battering-revolt-6c6a7827413e@spud/ [2] Fixes: 70a57b2 ("RISC-V: enable building 64-bit kernels with rust support") Cc: [email protected] Reported-by: Jason Montleon <[email protected]> Signed-off-by: Conor Dooley <[email protected]> Acked-by: Miguel Ojeda <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/20241001-playlist-deceiving-16ece2f440f5@spud Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent afedc31 commit 33549fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/rust/arch-support.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Architecture Level of support Constraints
1717
============= ================ ==============================================
1818
``arm64`` Maintained Little Endian only.
1919
``loongarch`` Maintained \-
20-
``riscv`` Maintained ``riscv64`` only.
20+
``riscv`` Maintained ``riscv64`` and LLVM/Clang only.
2121
``um`` Maintained \-
2222
``x86`` Maintained ``x86_64`` only.
2323
============= ================ ==============================================

arch/riscv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ config RISCV
177177
select HAVE_REGS_AND_STACK_ACCESS_API
178178
select HAVE_RETHOOK if !XIP_KERNEL
179179
select HAVE_RSEQ
180-
select HAVE_RUST if RUSTC_SUPPORTS_RISCV
180+
select HAVE_RUST if RUSTC_SUPPORTS_RISCV && CC_IS_CLANG
181181
select HAVE_SAMPLE_FTRACE_DIRECT
182182
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
183183
select HAVE_STACKPROTECTOR

0 commit comments

Comments
 (0)