Apply fixes for coreclr-interp on linux-riscv64#127919
Apply fixes for coreclr-interp on linux-riscv64#127919am11 wants to merge 4 commits intodotnet:mainfrom
Conversation
|
cc @clamp03, interp tests are now passing: am11@k1:~$ CORE_ROOT=$(pwd)/artifacts/tests/coreclr/linux.riscv64.Debug/Tests/Core_Root DOTNET_TieredCompilation=0 artifacts/tests/coreclr/linux.riscv64.Debug/JIT/Interpreter/InterpreterTester/InterpreterTester.sh
BEGIN EXECUTION
/home/am11/artifacts/tests/coreclr/linux.riscv64.Debug/Tests/Core_Root/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true InterpreterTester.dll ''
TestCallingConvention0: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention1: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention9: a = 1, b = 2, c = 3, d = 4
TestCallingConvention10: a = 1, b = 2, c = 3
TestCallingConvention11: s =
1
2
3
TestCallingConvention12: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = a, k = 10, l = 11, m = 12
TestCallingConvention13: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, s = (9, 10, 11, 12)
TestCallingConvention0Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention1Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention2Rev: s = 1, 2
TestCallingConvention3Rev: v = 1, 2
TestCallingConvention4Rev: s = 1, 2, 3, 4, 5, 6
TestCallingConvention5Rev: s = 1, 2, 3, 4
TestCallingConvention6Rev: s = 1, 2, 3, 4
TestCallingConvention7Rev: s = 1, 2, 3, 4
TestCallingConvention8Rev: s = 1, 2, 3, 4
TestCallingConvention9Rev: a = 1, b = 2, c = 3, d = 4
TestCallingConvention10Rev: a = 1, b = 2, c = 3
TestCallingConvention11Rev: s = 1, 2, 3
TestCallingConvention12Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = a, k = 10, l = 11, m = 12
TestCallingConvention13Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, s = (9, 10, 11, 12)
TestCallingConvention0: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention1: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention: s =
1
2
TestCallingConvention: s =
1
2
3
4
5
6
TestCallingConvention: s =
1
2
3
4
TestCallingConvention: s =
1
2
3
4
TestCallingConvention: s =
1
2
3
4
TestCallingConvention: s =
1
2
3
4
TestCallingConvention9: a = 1, b = 2, c = 3, d = 4
TestCallingConvention10: a = 1, b = 2, c = 3
TestCallingConvention: s =
1
2
3
TestCallingConvention12: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = a, k = 10, l = 11, m = 12
TestCallingConvention13: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, s = (9, 10, 11, 12)
Sum
Mul4
TestSwitch
PowLoop
TestJitFields
TestFields
TestStructRefFields
TestSpecialFields
TestFloat
TestConvOvf
TestConvOvfUn
TestConvBoundaries
TestLocalloc
TestVirtual
bc.NonVirtualMethod
bc.VirtualMethod
bc.GenericVirtualMethod
bc.GenericVirtualMethod<int>
bc.GenericVirtualMethod<string>
itest.VirtualMethod
itest.GenericVirtualMethod<int>
itest.GenericVirtualMethod<string>
bc.NonVirtualMethod
bc.VirtualMethod
bc.GenericVirtualMethod<int>
bc.GenericVirtualMethod<string>
itest.VirtualMethod
itest.GenericVirtualMethod<int>
itest.GenericVirtualMethod<string>
TestBoxing
TestArray
TestXxObj
TestSizeof
TestLdtoken
TestMdArray
TestExceptionHandling
1
2
3
Object reference not set to an instance of an object.
4
6
7
TestStringCtor
TestSharedGenerics
Test calls to shared generics from non-generic code
Test calls to shared generics from generic code (unshared generics)
Test calls to shared generics from generic code (shared generics)
Test isinst with shared generics (string)
Test castclass with shared generics (string)
Expected InvalidCastException from casting object to string[]
Test unbox.any with shared generics
Expected InvalidCastException from casting object to string
Test box with shared generics
Test classic unbox instruction with shared generics
Test newarr
Test new MD arr
TestDelegate
CallingFunc first time
Return CallingFunc first time
CallingFunc second time
Return CallingFunc second time
TestIntrinsics
Vector128.IsHardwareAccelerated=
False
X86Base.IsSupported=
False
ArmBase.IsSupported=
False
TestCalli
CallingFunc first time
Return CallingFunc first time
CallingFunc second time
Return CallingFunc second time
TestStaticVirtualGeneric_CodePointerCase
TestPreciseInitCctors
TestThreading_Interlocked_CompareExchange
TestRuntimeHelpers_IsReferenceOrContainsReferences
TestMemoryMarshal_GetArrayDataReference
Empty string length: 0
BitConverter.IsLittleEndian: True
IntPtr.Zero: 0, UIntPtr.Zero: 0
TestPInvoke
Hello world from pinvoke.dll!writeToStdout
calling missingPInvoke
caught #1
calling missingPInvokeWithMarshaling
caught #2
All tests passed successfully!
Interpreted App returned 100
Expected: 100
Actual: 100
END EXECUTION - PASSED |
|
Tagging subscribers to this area: @JulieLeeMSFT, @BrzVlad, @janvorli, @kg |
I am not following why we need to do that. What are the problems solved by this pinning? |
It crashes with SIGILL on old devices without vector ISA support. |
|
Also, it matches: runtime/src/native/minipal/cpufeatures.c Lines 733 to 737 in 41fad31 |
Is there a clang PR that changed the default? I would be curious about their justification for ignoring these old devices by default. C/C++ compilers have typically lower default baselines than we do. It is surprising that it is opposite here. |
|
llvm hasn't changed their defaults since 2019 llvm/llvm-project@e3d5ff5 (same as current main: https://github.com/llvm/llvm-project/blob/b3c15dbae051e29cfbd8b4110ac190528fb563a7/clang/lib/Driver/ToolChains/Arch/RISCV.cpp#L344; that is rv64gc baseline to run Linux based OS) However, Ubuntu has changed their default to require vector extension https://canonical.com/blog/canonical-and-ubuntu-risc-v-a-2025-retro-and-looking-forward-to-2026. I was cross-building on Ubuntu 26.04 and clang21 from its packages, therefore, it has the altered defaults. If I install it with official script: root@a8238645b83c:/runtime# curl -sSL https://apt.llvm.org/llvm.sh | bash -s - 21 all
root@a8238645b83c:/runtime# clang-21 --target=riscv64-unknown-linux-gnu -c riscv_default_probe.c
riscv_default_probe.c:10:2: error: At D
10 | #error At D
| ^
1 error generated.This shows the case that distro altered the baseline while linux kernel, toolchains (llvm and gcc) and other distros all are sticking to the rv64gc baseline. This PR makes it explicit. IMO, it's fine, given this file has: |
First time we ran the tests (with #127909) and found issues with interpreter tests.
TestCallingConvention2Revand then tripped a debug-only check that is AMD64-specific and not applicable on these targets. Return classification here is already handled by FP-struct info plus size-based integer mapping, so removing the assert preserves intended behavior and unblocks the interpreter calling-convention tests.Fixes #127860