Skip to content

[Clang][MIPS] Send correct architecture for MinGW toolchains #121042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

hpoussin
Copy link
Contributor

'mipspe' name was chosen by binutils, when the project was able to create executables for Windows CE/MIPS.

'mipspe' name was chosen by binutils, when the project was able to create
executables for Windows CE/MIPS.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Dec 24, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 24, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Hervé Poussineau (hpoussin)

Changes

'mipspe' name was chosen by binutils, when the project was able to create executables for Windows CE/MIPS.


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

2 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/MinGW.cpp (+3)
  • (modified) clang/test/Driver/mingw.cpp (+4)
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 963de81027ca9f..9f0c6160a309ec 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -138,6 +138,9 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     else
       CmdArgs.push_back("arm64pe");
     break;
+  case llvm::Triple::mipsel:
+    CmdArgs.push_back("mipspe");
+    break;
   default:
     D.Diag(diag::err_target_unknown_triple) << TC.getEffectiveTriple().str();
   }
diff --git a/clang/test/Driver/mingw.cpp b/clang/test/Driver/mingw.cpp
index 9790c86a364f85..66da0c97f41668 100644
--- a/clang/test/Driver/mingw.cpp
+++ b/clang/test/Driver/mingw.cpp
@@ -85,6 +85,10 @@
 // RUN:   | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
 // CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"
 
+// RUN: %clang --target=mipsel-windows-gnu -### -o /dev/null %s 2>&1 \
+// RUN:   | FileCheck %s --check-prefix CHECK_MINGW_MIPSPE
+// CHECK_MINGW_MIPSPE: "-m" "mipspe"
+
 // RUN: %clang --target=i686-windows-gnu -fms-hotpatch -### -- %s 2>&1 \
 // RUN:    | FileCheck %s --check-prefix=FUNCTIONPADMIN
 // FUNCTIONPADMIN: "--functionpadmin"

@@ -85,6 +85,10 @@
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
// CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"

// RUN: %clang --target=mipsel-windows-gnu -### -o /dev/null %s 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_MIPSPE
// CHECK_MINGW_MIPSPE: "-m" "mipspe"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it supported by binutils now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, binutils removed support for "mipspe" target in 2.31 (2018)

@hpoussin
Copy link
Contributor Author

hpoussin commented Jan 3, 2025

Ping

@wzssyqa wzssyqa merged commit 8267bea into llvm:main Jan 5, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 5, 2025

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building clang at step 7 "test-build-unified-tree-check-llvm".

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

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/RISCV/ELF_jal.s' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
RUN: at line 1: rm -rf /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp && mkdir -p /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp
+ rm -rf /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp
+ mkdir -p /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp
RUN: at line 2: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-mc -triple=riscv64 -filetype=obj      -o /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv64_jal.o /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-mc -triple=riscv64 -filetype=obj -o /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv64_jal.o /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s
RUN: at line 4: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-mc -triple=riscv32 -filetype=obj      -o /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv32_jal.o /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-mc -triple=riscv32 -filetype=obj -o /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv32_jal.o /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s
RUN: at line 6: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink -noexec      -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096      -abs external_func=0x1fe000fe      -check /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv64_jal.o
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 -abs external_func=0x1fe000fe -check /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv64_jal.o
RUN: at line 10: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink -noexec      -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096      -abs external_func=0x1fe000fe      -check /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv32_jal.o
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 -abs external_func=0x1fe000fe -check /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv32_jal.o
llvm-jitlink: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h:285: llvm::orc::SymbolStringPool::~SymbolStringPool(): Assertion `Pool.empty() && "Dangling references at pool destruction time"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 -abs external_func=0x1fe000fe -check /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv32_jal.o
 #0 0x00007f1288c26157 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/b/1/llvm-x86_64-debian-dylib/build/lib/libLLVM.so.20.0git+0xf12157)
 #1 0x00007f1288c23c0e llvm::sys::RunSignalHandlers() (/b/1/llvm-x86_64-debian-dylib/build/lib/libLLVM.so.20.0git+0xf0fc0e)
 #2 0x00007f1288c2682f SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f1287cfe140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x13140)
 #4 0x00007f1287824d51 raise (/lib/x86_64-linux-gnu/libc.so.6+0x38d51)
 #5 0x00007f128780e537 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22537)
 #6 0x00007f128780e40f (/lib/x86_64-linux-gnu/libc.so.6+0x2240f)
 #7 0x00007f128781d6d2 (/lib/x86_64-linux-gnu/libc.so.6+0x316d2)
 #8 0x000000000043e3bc (/b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink+0x43e3bc)
 #9 0x00007f128b429257 llvm::orc::ExecutorProcessControl::~ExecutorProcessControl() (/b/1/llvm-x86_64-debian-dylib/build/lib/libLLVM.so.20.0git+0x3715257)
#10 0x00007f128b42af3f llvm::orc::SelfExecutorProcessControl::~SelfExecutorProcessControl() crtstuff.c:0:0
#11 0x00007f128b31b201 llvm::orc::ExecutionSession::~ExecutionSession() (/b/1/llvm-x86_64-debian-dylib/build/lib/libLLVM.so.20.0git+0x3607201)
#12 0x0000000000416180 llvm::Session::~Session() (/b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink+0x416180)
#13 0x00000000004213ac main (/b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink+0x4213ac)
#14 0x00007f128780fd7a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d7a)
#15 0x000000000041144a _start (/b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink+0x41144a)
/b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.script: line 5: 2495541 Aborted                 /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 -abs external_func=0x1fe000fe -check /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_jal.s /b/1/llvm-x86_64-debian-dylib/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_jal.s.tmp/elf_riscv32_jal.o

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 5, 2025

LLVM Buildbot has detected a new failure on builder lldb-remote-linux-ubuntu running on as-builder-9 while building clang at step 16 "test-check-lldb-api".

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

Here is the relevant piece of the build log for the reference
Step 16 (test-check-lldb-api) failure: Test just built components: check-lldb-api completed (failure)
...
PASS: lldb-api :: types/TestIntegerType.py (1209 of 1218)
PASS: lldb-api :: types/TestIntegerTypeExpr.py (1210 of 1218)
PASS: lldb-api :: types/TestRecursiveTypes.py (1211 of 1218)
PASS: lldb-api :: types/TestShortType.py (1212 of 1218)
PASS: lldb-api :: types/TestLongTypes.py (1213 of 1218)
PASS: lldb-api :: types/TestShortTypeExpr.py (1214 of 1218)
PASS: lldb-api :: types/TestLongTypesExpr.py (1215 of 1218)
PASS: lldb-api :: tools/lldb-server/TestNonStop.py (1216 of 1218)
PASS: lldb-api :: tools/lldb-server/TestLldbGdbServer.py (1217 of 1218)
TIMEOUT: lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py (1218 of 1218)
******************** TEST 'lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py' FAILED ********************
Script:
--
/usr/bin/python3.12 /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin --libcxx-include-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include/c++/v1 --libcxx-include-target-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include/aarch64-unknown-linux-gnu/c++/v1 --libcxx-library-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib/aarch64-unknown-linux-gnu --arch aarch64 --build-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin/lldb --compiler /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang --dsymutil /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin --lldb-obj-root /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb --lldb-libs-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib --platform-url connect://jetson-agx-2198.lab.llvm.org:1234 --platform-working-dir /home/ubuntu/lldb-tests --sysroot /mnt/fs/jetson-agx-ubuntu --env ARCH_CFLAGS=-mcpu=cortex-a78 --platform-name remote-linux /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/python_api/process/cancel_attach -p TestCancelAttach.py
--
Exit Code: -9
Timeout: Reached timeout of 600 seconds

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 8267bea9a35c3c3f866b942a50c2b98ac462ce35)
  clang revision 8267bea9a35c3c3f866b942a50c2b98ac462ce35
  llvm revision 8267bea9a35c3c3f866b942a50c2b98ac462ce35

--
Command Output (stderr):
--
WARNING:root:Custom libc++ is not supported for remote runs: ignoring --libcxx arguments
FAIL: LLDB (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang-aarch64) :: test_scripted_implementation (TestCancelAttach.AttachCancelTestCase.test_scripted_implementation)

--

********************
Slowest Tests:
--------------------------------------------------------------------------
600.04s: lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py
180.98s: lldb-api :: commands/command/script_alias/TestCommandScriptAlias.py
81.61s: lldb-api :: tools/lldb-server/TestLldbGdbServer.py
70.68s: lldb-api :: commands/process/attach/TestProcessAttach.py
40.50s: lldb-api :: functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
35.11s: lldb-api :: functionalities/completion/TestCompletion.py
34.30s: lldb-api :: functionalities/single-thread-step/TestSingleThreadStepTimeout.py
32.52s: lldb-api :: tools/lldb-server/TestNonStop.py
21.41s: lldb-api :: commands/statistics/basic/TestStats.py
20.68s: lldb-api :: functionalities/gdb_remote_client/TestPlatformClient.py
19.06s: lldb-api :: functionalities/thread/state/TestThreadStates.py
18.24s: lldb-api :: commands/dwim-print/TestDWIMPrint.py
17.03s: lldb-api :: tools/lldb-server/TestGdbRemote_vCont.py
15.43s: lldb-api :: python_api/watchpoint/watchlocation/TestTargetWatchAddress.py

@hpoussin hpoussin deleted the clang-mips-coff-14 branch January 21, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants