Skip to content

Conversation

@LuckyXu-HF
Copy link
Contributor

  • Align PR#108419: Verify TLS resolver code for LA64.
  • Add -mtls-dialect=desc compile parameters for TestTLSWithLoadedDlls.sh to enble R_LARCH_TLS_DESC6 relocation type.

* Add `-mtls-dialect=desc` compile parameters for TestTLSWithLoadedDlls.sh to enble `R_LARCH_TLS_DESC6` relocation type.
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 29, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 29, 2025

install (TARGETS usetls DESTINATION bin)

if(CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On LoongArch64 will catch the error of TestTLSWithLoadedDlls.sh under debug mode:

TestTLSWithLoadedDlls.sh failed output
BEGIN EXECUTION
/data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/Tests/Core_Root//corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true TestTLSWithLoadedDlls.dll ''
Launching /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/Tests/Core_Root/corerun  -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/0/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/1/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/2/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/3/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/4/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/5/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/6/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/7/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/8/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/9/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/10/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/11/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/12/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/13/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/14/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/15/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/16/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/17/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/18/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/19/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/20/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/21/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/22/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/23/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/24/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/25/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/26/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/27/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/28/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/29/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/30/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/31/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/32/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/33/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/34/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/35/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/36/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/37/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/38/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/39/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/40/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/41/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/42/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/43/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/44/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/45/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/46/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/47/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/48/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/49/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/50/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/51/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/52/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/53/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/54/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/55/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/56/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/57/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/58/libusetls.so -l /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/59/libusetls.so /data/xuliangyu/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/JIT/Directed/tls/TestTLSWithLoadedDlls/TestTLSWithLoadedDlls.dll RunLotsOfTasks
ASSERT FAILED
	Expression: !"Detected static resolver in use when not expected"
	Location:   line 956 in /data/xuliangyu/runtime/src/coreclr/vm/threadstatics.cpp
	Function:   CanJITOptimizeTLSAccess
	Process:    1650216
Expected: 100
Actual: 134
END EXECUTION - FAILED

The TLS descriptor is disabled by default for LA64's clang and gcc. So we need to add this compile parameters to make the thread static variables to use R_LARCH_TLS_DESC6 relocation type to match the TestTLSWithLoadedDlls.sh test mechanism.

@LuckyXu-HF
Copy link
Contributor Author

@shushanhf @jkotas could you please help to review this PR? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-loongarch64 community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants