aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object
diff options
context:
space:
mode:
authorJacek Caban <jacek@codeweavers.com>2024-03-21 11:40:46 +0100
committerGitHub <noreply@github.com>2024-03-21 11:40:46 +0100
commit8ecc377c88ba32978ace6a67de895403eeba3a22 (patch)
tree32bd4ae3a7f85f81b02bd5e6b00d9c3e5d2efa32 /llvm/lib/Object
parentccb3a8feaa5b132dc829e55e069dde62008df4a8 (diff)
downloadllvm-8ecc377c88ba32978ace6a67de895403eeba3a22.zip
llvm-8ecc377c88ba32978ace6a67de895403eeba3a22.tar.gz
llvm-8ecc377c88ba32978ace6a67de895403eeba3a22.tar.bz2
[llvm-lib] Use ARM64EC machine type for import libraries when -machine:arm64x is used. (#85972)
This is compatible with MSVC, `-machine:arm64x` is essentially an alias to `-machine:arm64ec`. To make a type library that exposes both native and EC symbols, an additional `-defArm64Native` argument is needed in both cases.
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/COFFImportFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Object/COFFImportFile.cpp b/llvm/lib/Object/COFFImportFile.cpp
index 46c8e70..8224a14 100644
--- a/llvm/lib/Object/COFFImportFile.cpp
+++ b/llvm/lib/Object/COFFImportFile.cpp
@@ -626,8 +626,11 @@ Error writeImportLibrary(StringRef ImportName, StringRef Path,
MachineTypes Machine, bool MinGW,
ArrayRef<COFFShortExport> NativeExports) {
- MachineTypes NativeMachine =
- isArm64EC(Machine) ? IMAGE_FILE_MACHINE_ARM64 : Machine;
+ MachineTypes NativeMachine = Machine;
+ if (isArm64EC(Machine)) {
+ NativeMachine = IMAGE_FILE_MACHINE_ARM64;
+ Machine = IMAGE_FILE_MACHINE_ARM64EC;
+ }
std::vector<NewArchiveMember> Members;
ObjectFactory OF(llvm::sys::path::filename(ImportName), NativeMachine);