Skip to content

Commit

Permalink
[clang] [MinGW] Handle linking ARM64EC code (#78912)
Browse files Browse the repository at this point in the history
  • Loading branch information
bylaws committed Jan 31, 2024
1 parent d55d72e commit d74619a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clang/lib/Driver/ToolChains/MinGW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("thumb2pe");
break;
case llvm::Triple::aarch64:
CmdArgs.push_back("arm64pe");
if (TC.getEffectiveTriple().isWindowsArm64EC())
CmdArgs.push_back("arm64ecpe");
else
CmdArgs.push_back("arm64pe");
break;
default:
D.Diag(diag::err_target_unknown_triple) << TC.getEffectiveTriple().str();
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Driver/mingw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@

// RUN: %clang -target i686-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_NO_INIT_ARRAY %s
// CHECK_NO_INIT_ARRAY: "-fno-use-init-array"

// RUN: %clang -target arm64ec-windows-gnu -### -o /dev/null %s 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
// CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"

0 comments on commit d74619a

Please sign in to comment.