Install llvm-15 in riscv64 image #651
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR - this is needed to build dotnet/runtime.
Details:
clang 9 with gcc 9:
although clang-9 was the fist version which supported riscv64, there were some rough edges around .eh_frame handling in lld linker (LLVM linker). Using GNU's gold linker is an option, but we would need to install gcc-12 toolchain just for that, Currently we have clang-9 and gcc-9, so there is no way we can proceed with this combination.
clang 14 (current latest stable):
We get this error at the very beginning of cmake invocation:
turned out this
relaxation support is fixed in llvm-15: llvm/llvm-project#44181. Note that the error emerges fromScrt1.o(provided bydebootstrap -arch riscv64) in gcc-12 riscv64 toolchain installed in the rootfs. This is the default C runtime object which cmake links against in test, so the error message suggestion "recompile with -mno-relax" has no affect if we setset(CMAKE_C_FLAGS _INIT "-mno-relax")in toolchain.cmake, since this object file is prebuilt.There are other hacks to workaround it, but this is the cleanest and proper fix in my opinion.
cc @akoeplinger, @janvorli I will push the initial configuration patch to runtime once this goes in (still wrapping up mono configs)