Skip to content

Conversation

@mintsuki
Copy link
Contributor

@mintsuki mintsuki commented Jul 10, 2025

If the environment is considered to be the triple component as a whole, so, including the object format, if any, and if that is the intended behaviour, then the loongarch64 function computeTargetABI() should be changed to not rely on hasEnvironment(), but, rather, to check if there is a non-unknown environment set.

Without this change, using a (ideally valid) target of loongarch64-unknown-none-elf, with a manually specified ABI of lp64s, will result in a completely superfluous warning:

warning: triple-implied ABI conflicts with provided target-abi 'lp64s', using target-abi

@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Jul 10, 2025

@llvm/pr-subscribers-backend-loongarch

Author: None (mintsuki)

Changes

Addresses issue #147665


Full diff: https://github.com/llvm/llvm-project/pull/147952.diff

1 Files Affected:

  • (modified) llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp (+4-2)
diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp
index 03ce004ed33a5..d21c996704544 100644
--- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp
+++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp
@@ -62,9 +62,11 @@ static ABI getTripleABI(const Triple &TT) {
     break;
   // Let the fallback case behave like {ILP32,LP64}D.
   case llvm::Triple::EnvironmentType::GNUF64:
-  default:
     TripleABI = Is64Bit ? ABI_LP64D : ABI_ILP32D;
     break;
+  default:
+    TripleABI = ABI_Unknown;
+    break;
   }
   return TripleABI;
 }
@@ -96,7 +98,7 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
 
   // 1. If the '-target-abi' is valid, use it.
   if (IsABIValidForFeature(ArgProvidedABI)) {
-    if (TT.hasEnvironment() && ArgProvidedABI != TripleABI)
+    if (IsABIValidForFeature(TripleABI) && ArgProvidedABI != TripleABI)
       errs()
           << "warning: triple-implied ABI conflicts with provided target-abi '"
           << ABIName << "', using target-abi\n";

@mintsuki mintsuki force-pushed the loongarch-abi-fix branch from a481cb3 to 34376af Compare July 10, 2025 12:53
@MaskRay
Copy link
Member

MaskRay commented Jul 14, 2025

Thanks for the report and patch. Could you please

  • Change the description to include the explanation at Triples: Environment vs Object format #147665 (comment) , with potential simplification, so that future contributors reading the commit message do not need to click the link?
  • Add a test to a clang/test/Driver/loongarch-*.c file (perhaps loongarch-abi.c) ?

@mintsuki
Copy link
Contributor Author

Thanks for the report and patch. Could you please

  • Change the description to include the explanation at Triples: Environment vs Object format #147665 (comment) , with potential simplification, so that future contributors reading the commit message do not need to click the link?
  • Add a test to a clang/test/Driver/loongarch-*.c file (perhaps loongarch-abi.c) ?

@MaskRay I updated the description, but I am not sure what to change in the loongarch-abi.c file. I am new to the LLVM codebase, and therefore I may be missing something, but that test file seems to already test for everything that matters? Like, how would I test for a change that removes a warning?

@MaskRay
Copy link
Member

MaskRay commented Jul 15, 2025

Add a run line like RUN: %clang -### -Werror ... 2>&1 | FileCheck %s. If %clang reports a warning (turned to an error due to -Werror), the exit code will be 1.

@mintsuki
Copy link
Contributor Author

Add a run line like RUN: %clang -### -Werror ... 2>&1 | FileCheck %s. If %clang reports a warning (turned to an error due to -Werror), the exit code will be 1.

This warning does not return 1 with -Werror though.

@zhaoqi5
Copy link
Contributor

zhaoqi5 commented Jul 15, 2025

llvm/test/CodeGen/LoongArch/target-abi-from-triple-edge-cases.ll tests these warning cases, it should be updated in this commit.

@mintsuki
Copy link
Contributor Author

llvm/test/CodeGen/LoongArch/target-abi-from-triple-edge-cases.ll tests these warning cases, it should be updated in this commit.

@zhaoqi5 okay, but how would I check that a warning is not generated? Can you please propose a change?

@zhaoqi5
Copy link
Contributor

zhaoqi5 commented Jul 16, 2025

@zhaoqi5 okay, but how would I check that a warning is not generated? Can you please propose a change?

I think we can delete the check directly. But it is better to find a case that still appears this warning.

By the way, I accidentally found that your changes seem to have unwanted influence to lto. Shows below:

$ clang --target=loongarch64-unknown-linux-gnu -flto=auto hello.c
warning: the triple-implied ABI is invalid, ignoring and using feature-implied ABI
warning: the triple-implied ABI is invalid, ignoring and using feature-implied ABI

But no warnings without your commit. I think this should be dealt with.

@mintsuki
Copy link
Contributor Author

I cannot reproduce those warnings, either with, or without my changes.

@mintsuki mintsuki force-pushed the loongarch-abi-fix branch 2 times, most recently from 436c35b to 54a136f Compare July 16, 2025 04:26
@mintsuki
Copy link
Contributor Author

Okay, I made the test pass, now.

I modified my change such that if a -gnu or -musl environment is used, lp64d/ilp32d is implied, as I guess that was the original intention, despite it not being spelled out explicitly? That should, I guess, also fix that lto warning.

@mintsuki mintsuki force-pushed the loongarch-abi-fix branch 3 times, most recently from 72ec69a to f8a753f Compare July 16, 2025 05:05
Copy link
Member

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

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

Approved on my end. Please wait for a LoongArch maintainer's approval.

Copy link
Contributor

@SixWeining SixWeining left a comment

Choose a reason for hiding this comment

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

LGTM. But I suggest to keep it open for a couple of days in case other people have any comments.

@SixWeining
Copy link
Contributor

cc @xen0n @xry111

@zhaoqi5
Copy link
Contributor

zhaoqi5 commented Jul 17, 2025

If the triple environment type is unknown ( ie. using llc --triple=loongarch64/loongarch32 ... ), I think warnings ( in source code line 170~175 ) will appear after this commit?
But no warnings before, because ilp32d/lp64d was set as default for unknown environment type.

I donot know whether the warnings should be avoided.

If the environment is considered to be the final triple component as a whole,
then the loongarch64 function computeTargetABI() should be changed not to rely
on hasEnvironment(), but, rather, to check if there is a non-unknown
environment set.

Without this change, using a (ideally valid) target of
loongarch64-unknown-none-elf, with a manually specified ABI of lp64s, will
result in a completely superfluous warning:

  warning: triple-implied ABI conflicts with provided target-abi 'lp64s', using target-abi
@mintsuki mintsuki force-pushed the loongarch-abi-fix branch from f8a753f to ba2dcbe Compare July 17, 2025 02:32
@mintsuki
Copy link
Contributor Author

If the triple environment type is unknown ( ie. using llc --triple=loongarch64/loongarch32 ... ), I think warnings ( in source code line 170~175 ) will appear after this commit? But no warnings before, because ilp32d/lp64d was set as default for unknown environment type.

I donot know whether the warnings should be avoided.

Seems reasonable, I have updated the PR accordingly, thanks.

@mintsuki
Copy link
Contributor Author

Will this PR make its way into 21.x? Would be nice if it could, since it's a rather small fix that prevents a lot of spurious warnings with the loongarch64-elf target.

@mintsuki
Copy link
Contributor Author

@MaskRay CI needs approval after my last force push.

@SixWeining
Copy link
Contributor

Will this PR make its way into 21.x? Would be nice if it could, since it's a rather small fix that prevents a lot of spurious warnings with the loongarch64-elf target.

I think it can be cherry-picked to 21.x.

@mintsuki
Copy link
Contributor Author

Awesome! Thanks.

@SixWeining SixWeining merged commit 9ed8816 into llvm:main Jul 22, 2025
9 checks passed
@github-actions
Copy link

@mintsuki Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@SixWeining
Copy link
Contributor

/cherry-pick 9ed8816

@llvmbot
Copy link
Member

llvmbot commented Jul 22, 2025

/pull-request #149961

@llvmbot llvmbot moved this from Needs Triage to Done in LLVM Release Status Jul 22, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 22, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-android running on sanitizer-buildbot-android while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/186/builds/10923

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[       OK ] AddressSanitizer.AtoiAndFriendsOOBTest (2297 ms)
[ RUN      ] AddressSanitizer.HasFeatureAddressSanitizerTest
[       OK ] AddressSanitizer.HasFeatureAddressSanitizerTest (0 ms)
[ RUN      ] AddressSanitizer.CallocReturnsZeroMem
[       OK ] AddressSanitizer.CallocReturnsZeroMem (18 ms)
[ DISABLED ] AddressSanitizer.DISABLED_TSDTest
[ RUN      ] AddressSanitizer.IgnoreTest
[       OK ] AddressSanitizer.IgnoreTest (0 ms)
[ RUN      ] AddressSanitizer.SignalTest
[       OK ] AddressSanitizer.SignalTest (201 ms)
[ RUN      ] AddressSanitizer.ReallocTest
[       OK ] AddressSanitizer.ReallocTest (41 ms)
[ RUN      ] AddressSanitizer.WrongFreeTest
[       OK ] AddressSanitizer.WrongFreeTest (137 ms)
[ RUN      ] AddressSanitizer.LongJmpTest
[       OK ] AddressSanitizer.LongJmpTest (0 ms)
[ RUN      ] AddressSanitizer.ThreadStackReuseTest
[       OK ] AddressSanitizer.ThreadStackReuseTest (2 ms)
[ DISABLED ] AddressSanitizer.DISABLED_MemIntrinsicUnalignedAccessTest
[ DISABLED ] AddressSanitizer.DISABLED_LargeFunctionSymbolizeTest
[ DISABLED ] AddressSanitizer.DISABLED_MallocFreeUnwindAndSymbolizeTest
[ RUN      ] AddressSanitizer.UseThenFreeThenUseTest
[       OK ] AddressSanitizer.UseThenFreeThenUseTest (118 ms)
[ RUN      ] AddressSanitizer.FileNameInGlobalReportTest
[       OK ] AddressSanitizer.FileNameInGlobalReportTest (128 ms)
[ DISABLED ] AddressSanitizer.DISABLED_StressStackReuseAndExceptionsTest
[ RUN      ] AddressSanitizer.MlockTest
[       OK ] AddressSanitizer.MlockTest (0 ms)
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadedTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowIn
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowLeft
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowRight
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFHigh
[ DISABLED ] AddressSanitizer.DISABLED_DemoOOM
[ DISABLED ] AddressSanitizer.DISABLED_DemoDoubleFreeTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoNullDerefTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoFunctionStaticTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoTooMuchMemoryTest
[ RUN      ] AddressSanitizer.LongDoubleNegativeTest
[       OK ] AddressSanitizer.LongDoubleNegativeTest (0 ms)
[----------] 19 tests from AddressSanitizer (27801 ms total)

[----------] Global test environment tear-down
[==========] 22 tests from 2 test suites ran. (27804 ms total)
[  PASSED  ] 22 tests.

  YOU HAVE 1 DISABLED TEST

Step 9 (run cmake) failure: run cmake (failure)
...
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- compiled but failed to run
-- Compiling and running to test HAVE_STEADY_CLOCK
CMake Warning at /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/third-party/benchmark/CMakeLists.txt:319 (message):
  Using std::regex with exceptions disabled is not fully supported
-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test HAVE_POSIX_REGEX -- compiled but failed to run
CMake Warning at /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/third-party/benchmark/CMakeLists.txt:319 (message):
  Using std::regex with exceptions disabled is not fully supported
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test HAVE_POSIX_REGEX -- compiled but failed to run
-- Compiling and running to test HAVE_STEADY_CLOCK
CMake Warning at /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/third-party/benchmark/CMakeLists.txt:319 (message):
  Using std::regex with exceptions disabled is not fully supported
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Configuring done (20.3s)
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Configuring done (20.6s)
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Configuring done (20.8s)

-- Generating done (2.9s)
-- Generating done (2.9s)
-- Build files have been written to: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build_android_i686
-- Generating done (2.9s)
-- Build files have been written to: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build_android_aarch64
-- Build files have been written to: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build_android_arm
Step 12 (build android/i686) failure: build android/i686 (failure)
...
[648/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/ArchitectureSet.cpp.o
[649/689] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/X86TargetParser.cpp.o
[650/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Architecture.cpp.o
[651/689] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/RISCVTargetParser.cpp.o
[652/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/PackedVersion.cpp.o
[653/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Platform.cpp.o
[654/689] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/Triple.cpp.o
[655/689] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/RISCVISAInfo.cpp.o
[656/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextAPIError.cpp.o
[657/689] Linking CXX static library lib/libLLVMTargetParser.a
[658/689] Linking CXX static library lib/libLLVMBinaryFormat.a
[659/689] Linking CXX static library lib/libLLVMCore.a
[660/689] Linking CXX static library lib/libLLVMBitReader.a
[661/689] Building CXX object lib/AsmParser/CMakeFiles/LLVMAsmParser.dir/Parser.cpp.o
[662/689] Linking CXX static library lib/libLLVMMC.a
[663/689] Linking CXX static library lib/libLLVMDebugInfoDWARFLowLevel.a
[664/689] Linking CXX static library lib/libLLVMMCParser.a
[665/689] Building Opts.inc...
[666/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Symbol.cpp.o
[667/689] Building CXX object lib/DebugInfo/Symbolize/CMakeFiles/LLVMSymbolize.dir/Symbolize.cpp.o
[668/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/RecordVisitor.cpp.o
[669/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/SymbolSet.cpp.o
[670/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Target.cpp.o
[671/689] Building CXX object tools/llvm-symbolizer/CMakeFiles/llvm-symbolizer.dir/llvm-symbolizer-driver.cpp.o
[672/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/RecordsSlice.cpp.o
[673/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/InterfaceFile.cpp.o
[674/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextStubCommon.cpp.o
[675/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Utils.cpp.o
[676/689] Building CXX object tools/llvm-symbolizer/CMakeFiles/llvm-symbolizer.dir/llvm-symbolizer.cpp.o
[677/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextStubV5.cpp.o
[678/689] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextStub.cpp.o
[679/689] Linking CXX static library lib/libLLVMTextAPI.a
[680/689] Building CXX object lib/AsmParser/CMakeFiles/LLVMAsmParser.dir/LLParser.cpp.o
[681/689] Linking CXX static library lib/libLLVMAsmParser.a
[682/689] Linking CXX static library lib/libLLVMIRReader.a
[683/689] Linking CXX static library lib/libLLVMObject.a
[684/689] Linking CXX static library lib/libLLVMDebugInfoDWARF.a
[685/689] Linking CXX static library lib/libLLVMDebugInfoPDB.a
[686/689] Linking CXX static library lib/libLLVMDebugInfoGSYM.a
[687/689] Linking CXX static library lib/libLLVMSymbolize.a
[688/689] Linking CXX static library lib/libLLVMDebuginfod.a
[689/689] Linking CXX executable bin/llvm-symbolizer
ninja: Entering directory `compiler_rt_build_android_i686'
ninja: error: loading 'build.ninja': No such file or directory

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




Step 34 (run instrumented asan tests [aarch64/bluejay-userdebug/TQ3A.230805.001]) failure: run instrumented asan tests [aarch64/bluejay-userdebug/TQ3A.230805.001] (failure)
...
[ RUN      ] AddressSanitizer.HasFeatureAddressSanitizerTest
[       OK ] AddressSanitizer.HasFeatureAddressSanitizerTest (0 ms)
[ RUN      ] AddressSanitizer.CallocReturnsZeroMem
[       OK ] AddressSanitizer.CallocReturnsZeroMem (18 ms)
[ DISABLED ] AddressSanitizer.DISABLED_TSDTest
[ RUN      ] AddressSanitizer.IgnoreTest
[       OK ] AddressSanitizer.IgnoreTest (0 ms)
[ RUN      ] AddressSanitizer.SignalTest
[       OK ] AddressSanitizer.SignalTest (201 ms)
[ RUN      ] AddressSanitizer.ReallocTest
[       OK ] AddressSanitizer.ReallocTest (41 ms)
[ RUN      ] AddressSanitizer.WrongFreeTest
[       OK ] AddressSanitizer.WrongFreeTest (137 ms)
[ RUN      ] AddressSanitizer.LongJmpTest
[       OK ] AddressSanitizer.LongJmpTest (0 ms)
[ RUN      ] AddressSanitizer.ThreadStackReuseTest
[       OK ] AddressSanitizer.ThreadStackReuseTest (2 ms)
[ DISABLED ] AddressSanitizer.DISABLED_MemIntrinsicUnalignedAccessTest
[ DISABLED ] AddressSanitizer.DISABLED_LargeFunctionSymbolizeTest
[ DISABLED ] AddressSanitizer.DISABLED_MallocFreeUnwindAndSymbolizeTest
[ RUN      ] AddressSanitizer.UseThenFreeThenUseTest
[       OK ] AddressSanitizer.UseThenFreeThenUseTest (118 ms)
[ RUN      ] AddressSanitizer.FileNameInGlobalReportTest
[       OK ] AddressSanitizer.FileNameInGlobalReportTest (128 ms)
[ DISABLED ] AddressSanitizer.DISABLED_StressStackReuseAndExceptionsTest
[ RUN      ] AddressSanitizer.MlockTest
[       OK ] AddressSanitizer.MlockTest (0 ms)
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadedTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowIn
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowLeft
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowRight
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFHigh
[ DISABLED ] AddressSanitizer.DISABLED_DemoOOM
[ DISABLED ] AddressSanitizer.DISABLED_DemoDoubleFreeTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoNullDerefTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoFunctionStaticTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoTooMuchMemoryTest
[ RUN      ] AddressSanitizer.LongDoubleNegativeTest
[       OK ] AddressSanitizer.LongDoubleNegativeTest (0 ms)
[----------] 19 tests from AddressSanitizer (27801 ms total)

[----------] Global test environment tear-down
[==========] 22 tests from 2 test suites ran. (27804 ms total)
[  PASSED  ] 22 tests.

  YOU HAVE 1 DISABLED TEST
program finished with exit code 1
elapsedTime=2179.684100

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 22, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-hwasan running on sanitizer-buildbot12 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/14560

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89274 tests, 72 workers --
Testing:  0..
FAIL: Clang :: CodeGenCUDA/amdgpu-alias-undef-symbols.cu (8812 of 89274)
******************** TEST 'Clang :: CodeGenCUDA/amdgpu-alias-undef-symbols.cu' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu    -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false |    /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu # RUN: at line 3
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu
libc++abi: Pure virtual function called!
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/test/CodeGenCUDA/Output/amdgpu-alias-undef-symbols.cu.script: line 1: 949170 Aborted                 /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false
     949172 Done                    | /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu

--

********************
Testing:  0.. 
FAIL: Clang :: CodeGenHIP/hip-cumode.hip (10313 of 89274)
******************** TEST 'Clang :: CodeGenHIP/hip-cumode.hip' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -S -o - --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib    /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck --check-prefix=NOWGP /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip # RUN: at line 3
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -S -o - --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck --check-prefix=NOWGP /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/test/CodeGenHIP/Output/hip-cumode.hip.script: line 6: 964729 Aborted                 /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -S -o - --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip 2>&1
     964730 Done                    | /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck --check-prefix=NOWGP /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip

--

********************
Testing:  0.. 10
FAIL: Clang :: CodeGenHipStdPar/rdc-does-not-enable-hipstdpar.cpp (10728 of 89274)
******************** TEST 'Clang :: CodeGenHipStdPar/rdc-does-not-enable-hipstdpar.cpp' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
Step 11 (stage2/hwasan check) failure: stage2/hwasan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89274 tests, 72 workers --
Testing:  0..
FAIL: Clang :: CodeGenCUDA/amdgpu-alias-undef-symbols.cu (8812 of 89274)
******************** TEST 'Clang :: CodeGenCUDA/amdgpu-alias-undef-symbols.cu' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu    -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false |    /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu # RUN: at line 3
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu
libc++abi: Pure virtual function called!
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/test/CodeGenCUDA/Output/amdgpu-alias-undef-symbols.cu.script: line 1: 949170 Aborted                 /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false
     949172 Done                    | /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenCUDA/amdgpu-alias-undef-symbols.cu

--

********************
Testing:  0.. 
FAIL: Clang :: CodeGenHIP/hip-cumode.hip (10313 of 89274)
******************** TEST 'Clang :: CodeGenHIP/hip-cumode.hip' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -S -o - --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib    /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck --check-prefix=NOWGP /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip # RUN: at line 3
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -S -o - --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip
+ /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck --check-prefix=NOWGP /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/test/CodeGenHIP/Output/hip-cumode.hip.script: line 6: 964729 Aborted                 /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/clang -S -o - --offload-arch=gfx906 --cuda-device-only -nogpuinc -nogpulib /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip 2>&1
     964730 Done                    | /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/FileCheck --check-prefix=NOWGP /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/test/CodeGenHIP/hip-cumode.hip

--

********************
Testing:  0.. 10
FAIL: Clang :: CodeGenHipStdPar/rdc-does-not-enable-hipstdpar.cpp (10728 of 89274)
******************** TEST 'Clang :: CodeGenHipStdPar/rdc-does-not-enable-hipstdpar.cpp' FAILED ********************
Exit Code: 134

Command Output (stderr):
--

tru pushed a commit to llvmbot/llvm-project that referenced this pull request Jul 22, 2025
If the environment is considered to be the triple component as a whole,
so, including the object format, if any, and if that is the intended
behaviour, then the loongarch64 function `computeTargetABI()` should be
changed to not rely on `hasEnvironment()`, but, rather, to check if
there is a non-unknown environment set.

Without this change, using a (ideally valid) target of
loongarch64-unknown-none-elf, with a manually specified ABI of lp64s,
will result in a completely superfluous warning:

```
warning: triple-implied ABI conflicts with provided target-abi 'lp64s', using target-abi
```

(cherry picked from commit 9ed8816)
@qinkunbao
Copy link
Member

Hi, it looks like this PR broke a few buildbots. e.g.,
https://lab.llvm.org/buildbot/#/builders/55/builds/14560

Can you take a look?

qinkunbao added a commit that referenced this pull request Jul 22, 2025
@SixWeining
Copy link
Contributor

Hi, it looks like this PR broke a few buildbots. e.g., https://lab.llvm.org/buildbot/#/builders/55/builds/14560

Can you take a look?

Seems these failures were not caused by this change. And the buildbots are green now.

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
If the environment is considered to be the triple component as a whole,
so, including the object format, if any, and if that is the intended
behaviour, then the loongarch64 function `computeTargetABI()` should be
changed to not rely on `hasEnvironment()`, but, rather, to check if
there is a non-unknown environment set.

Without this change, using a (ideally valid) target of
loongarch64-unknown-none-elf, with a manually specified ABI of lp64s,
will result in a completely superfluous warning:

```
warning: triple-implied ABI conflicts with provided target-abi 'lp64s', using target-abi
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

7 participants