Skip to content

Commit 2584db8

Browse files
authored
Pin riscv64 to march=rv64gc baseline (dotnet#5842)
This change allows loading `libsosplugin` built on Ubuntu 26.04 when used with a rootfs based on the same OS. Clang on Ubuntu 26.04 defaults to the RVA23 profile, which requires the V extension (among others). The toolchain and most other distros, however, target the Linux kernel baseline (`rv64gc`). This mismatch leads to issues when loading the plugin. Context: dotnet/runtime#127919 (comment)
1 parent 7021006 commit 2584db8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

eng/native/configurecompiler.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,11 @@ if(CLR_CMAKE_HOST_UNIX_ARMV6)
775775
add_compile_options(-mfloat-abi=hard)
776776
endif(CLR_CMAKE_HOST_UNIX_ARMV6)
777777

778+
if(CLR_CMAKE_HOST_UNIX_RISCV64)
779+
add_compile_options(-march=rv64gc)
780+
add_compile_options(-mabi=lp64d)
781+
endif(CLR_CMAKE_HOST_UNIX_RISCV64)
782+
778783
if(CLR_CMAKE_HOST_UNIX_X86)
779784
add_compile_options(-msse2)
780785
endif()

0 commit comments

Comments
 (0)