Page MenuHomeFreeBSD

Add option to build LLVM RISC-V target
ClosedPublic

Authored by mhorne on Mar 30 2019, 12:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 3:54 PM
Unknown Object (File)
Thu, Apr 18, 2:29 PM
Unknown Object (File)
Mar 21 2024, 11:04 PM
Unknown Object (File)
Feb 24 2024, 6:19 AM
Unknown Object (File)
Feb 24 2024, 6:04 AM
Unknown Object (File)
Jan 5 2024, 5:40 PM
Unknown Object (File)
Dec 25 2023, 9:42 AM
Unknown Object (File)
Dec 23 2023, 1:43 AM
Subscribers

Details

Summary

Although the RISC-V target support is still experimental, it is
quickly maturing. The latest LLVM import brought in codegen
support for RV64G, so we should be able to begin experimenting
with clang as an alternate compiler.

Add the WITH/WITHOUT_LLVM_TARGET_RISCV build knobs, with the
target disabled by default.

Test Plan

LLVM/clang compiles and can be used to compile a simple RISC-V program.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The latest LLVM import brought in codegen support for RV64G

Citation needed on this, but at the very least building the RISC-V support will allow us to see what support is available/lacking.

This revision is now accepted and ready to land.Mar 30 2019, 12:52 AM

Yes, this is very nice to have! Are we going for this in head only, or will this be MFCd in some way?

In D19759#423559, @dim wrote:

Yes, this is very nice to have! Are we going for this in head only, or will this be MFCd in some way?

I'm not aware of your usual MFC policy when it comes to LLVM. Will STABLE/12 eventually receive LLVM 8.0 or will it stay on 7? If it doesn't I'm not sure we need to MFC this as anyone looking for a RISC-V compiler would have already installed something better.

Even then, I'm seeing that there are a few important commits (64 bit F/D extension codegen) that didn't make it to the 8.0 release :(

I'm not aware of your usual MFC policy when it comes to LLVM. Will STABLE/12 eventually receive LLVM 8.0 or will it stay on 7?

It is my intention to merge 8.0 relatively soon, so it is not just before the slush. (I set an MFC reminder of 1 month.) It depends a little on how much ports fallout has been fixed, though.

If it doesn't I'm not sure we need to MFC this as anyone looking for a RISC-V compiler would have already installed something better.

I think it will have more to do with other runtime support, such as libc, rtld and of course the kernel. I suppose it won't work at all on stable/11, but maybe it has a better chance on stable/12.

Even then, I'm seeing that there are a few important commits (64 bit F/D extension codegen) that didn't make it to the 8.0 release :(

Depending on how large those commits are, I have no objections against cherry-picking them.

I think it will have more to do with other runtime support, such as libc, rtld and of course the kernel. I suppose it won't work at all on stable/11, but maybe it has a better chance on stable/12.

Good point. An MFC could be worthwhile then after some further testing.

Even then, I'm seeing that there are a few important commits (64 bit F/D extension codegen) that didn't make it to the 8.0 release :(

Depending on how large those commits are, I have no objections against cherry-picking them.

Good to know. I will be looking further at this in the coming weeks, so I'll reach out to you with any specific questions about the import process. Just want to make sure I'm not stepping on any toes.

This revision was automatically updated to reflect the committed changes.