Re: [PATCH v1] RISC-V: disallow gcc + rust builds

Conor Dooley
2024-10-01T19:27:38Z

[-- Attachment #1.1: Type: text/plain, Size: 2094 bytes --]

On Tue, Oct 01, 2024 at 11:55:25AM -0700, Nathan Chancellor wrote:
> On Tue, Oct 01, 2024 at 12:28:13PM +0100, Conor Dooley wrote:
> > From: Conor Dooley <conor.dooley@microchip.com>
> >
> > 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/20240917000848.720765-2-jmontleo@redhat.com/ [1]
> > Link: https://lore.kernel.org/all/20240926-battering-revolt-6c6a7827413e@spud/ [2]
> > Fixes: 70a57b247251a ("RISC-V: enable building 64-bit kernels with rust support")
> > Reported-by: Jason Montleon <jmontleo@redhat.com>
> > Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>
> Seems like a reasonable restriction to me.
>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
>
> I assume the difficulty is not in getting the libclang version itself
> but actually mapping extensions to the versions and then deciding how to
> make that available to the build system? Or is it more that a solution
> is somewhat known but someone has to actually implement it? Sorry if
> this has been talked about before.

It's mostly that someone has to take the time to go and do it. Miguel
and I discussed getting the libclang version a bit in [2] and mapping
the versions to extensions is no different (AFAIU) to mapping the
versions to extensions for Clang, so the work in figuring that out is
mostly done. It's a matter of going off and doing it, and testing the
various mixed tool configurations and versions to make sure it works
correctly.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]