Skip to content

LoongArch64: Track the progress of nativeaot test cases passing on LoongArch64. #104661

Closed

Description

@sunlijun-610

This issue will track the progress of nativeaot test cases passing on LoongArch64

Activity

  1. added
    untriaged
    on Jul 10, 2024
  2. added this to the Future milestone on Jul 10, 2024
  3. removed
    untriaged
    on Jul 10, 2024
  4. sunlijun-610 commented on Jul 11, 2024

    @sunlijun-610
    ContributorAuthor

    Currently, I've just tested the smoke tests of nativeaot, in runtime/src/tests/nativeaot/SmokeTests.
    In smoke tests, linux-loongarch64 requires testing 15 test cases. And currently, 13 cases can be passed through.

    The two failed tests are SmokeTests/DynamicGenerics/DynamicGenerics/native/DynamicGenerics and SmokeTests/UnitTests/UnitTests/native/UnitTests, each have a small test failure. ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test failed in DynamicGenerics and BasicThreading.Run failed in UnitTests. I think they maybe both related to TLS, but LoongArch64 currently lacks TLS support, and is working toward it.

    Another issue is, while compiling smoke tests SharedLibrary, it will report errors like
    ld.lld : error : relocation R_LARCH_PCALA_LO12 cannot be used against symbol 'memmove'; recompile with -fPIC [/home/sunlijun/runtime/src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj] [/home/sunlijun/runtime/src/tests/build.proj].

    The reason why I didn't test coreclr tests and libraries tests is that it usually reports an unstable error like
    EXEC : error : One or more errors occurred. (Code generation failed for method '[S.P.CoreLib]System.Globalization.CalendricalCalculationsHelper.EquationOfTime(float64)') [/home/sunlijun/runtime_test/runtime/src/libraries/Common/tests/Common.Tests.csproj::TargetFramework=net9.0-linux] while compiling the .o file using ilc-published/ilc. It's currently too unstable to test them. We are analyzing and trying to solve it.

  5. am11 commented on Jul 11, 2024

    @am11
    Member

    Another issue is, while compiling smoke tests SharedLibrary, it will report errors like
    ld.lld : error : relocation R_LARCH_PCALA_LO12 cannot be used against symbol 'memmove'; recompile with -fPIC [/home/sunlijun/runtime/src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj] [/home/sunlijun/runtime/src/tests/build.proj].

    Does this fix the error: am11@5d76762?

  6. sunlijun-610 commented on Jul 12, 2024

    @sunlijun-610
    ContributorAuthor

    Another issue is, while compiling smoke tests SharedLibrary, it will report errors like
    ld.lld : error : relocation R_LARCH_PCALA_LO12 cannot be used against symbol 'memmove'; recompile with -fPIC [/home/sunlijun/runtime/src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj] [/home/sunlijun/runtime/src/tests/build.proj].

    Does this fix the error: 5d76762?

    No, it doesn't. CMAKE_POSITION_INDEPENDENT_CODE should have already been set up in eng/native/configureplatform.cmake, so it seems unralated to the error.
    Thanks!

  7. am11 commented on Jul 12, 2024

    @am11
    Member

    Ah, it's included by INC_PLATFORM_DIR. You can try setting <LinkerFlavor>bfd</LinkerFlavor> in that test project to see if it works. It might be the problem with lld's LA64 port. See similar reports https://github.com/search?q=repo%3Allvm%2Fllvm-project+%22cannot+be+used+against+symbol%22&type=issues

  8. sunlijun-610 commented on Jul 12, 2024

    @sunlijun-610
    ContributorAuthor

    Ah, it's included by INC_PLATFORM_DIR. You can try setting <LinkerFlavor>bfd</LinkerFlavor> in that test project to see if it works. It might be the problem with lld's LA64 port. See similar reports https://github.com/search?q=repo%3Allvm%2Fllvm-project+%22cannot+be+used+against+symbol%22&type=issues

    Yes, you're right! I tried to use ld.bfd to link, and it was compiled and run successfully. Thanks a lot for your help!

  9. am11 commented on Jul 12, 2024

    @am11
    Member

    Great! You can open an issue in llvm repo with SharedLibrary's .o file attached; that bfd links the object while lld doesn't accept R_LARCH_PCALA_LO12. The default is bfd in production targets so it's not critical. When building the repo we use lld for everything unless otherwise specified.

  10. am11 commented on Aug 13, 2024

    @am11
    Member

    The two failed tests are SmokeTests/DynamicGenerics/DynamicGenerics/native/DynamicGenerics and SmokeTests/UnitTests/UnitTests/native/UnitTests, each have a small test failure. ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test failed in DynamicGenerics and BasicThreading.Run failed in UnitTests. I think they maybe both related to TLS, but LoongArch64 currently lacks TLS support, and is working toward it.

    TLS is now supported #106254 (comment), they should be passing now?

  11. sunlijun-610 commented on Aug 13, 2024

    @sunlijun-610
    ContributorAuthor

    The two failed tests are SmokeTests/DynamicGenerics/DynamicGenerics/native/DynamicGenerics and SmokeTests/UnitTests/UnitTests/native/UnitTests, each have a small test failure. ThreadLocalStatics.TLSTesting.ThreadLocalStatics_Test failed in DynamicGenerics and BasicThreading.Run failed in UnitTests. I think they maybe both related to TLS, but LoongArch64 currently lacks TLS support, and is working toward it.

    TLS is now supported #106254 (comment), they should be passing now?

    No, they still cannot pass. More precisely, they have a very low probability of passing, possibly less than 20%. And they have many types of errors when they fail.

  12. filipnavara commented on Feb 20, 2025

    @filipnavara
    Member

    Given the progress made on RISC-V NativeAOT port, can you retry running the DynamicGenerics test with DOTNET_gcConservative=1 environment variable?

  13. shushanhf commented on Apr 15, 2025

    @shushanhf
    Contributor

    This issue will be fixed by #114616 and #114618.

  14. locked and limited conversation to collaborators on May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions