[lld] [LLD][COFF] Require explicit specification of ARM64EC target (PR #116281)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 14:57:57 PST 2024


================
@@ -46,6 +47,26 @@ RUN: not lld-link -out:test.dll -machine:arm64 arm64-data-sym.obj x86_64-data-sy
 RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT3 %s
 INCOMPAT3: lld-link: error: x86_64-data-sym.obj: machine type x64 conflicts with arm64
 
+arm64ec machine type can't be inferred, it must be specified explicitly.
+RUN: not lld-link -out:test.dll arm64ec-data-sym.obj \
+RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s
+INCOMPAT4: lld-link: error: arm64ec-data-sym.obj: machine type arm64ec is ambiguous and cannot be inferred, use /machine:arm64ec or /machine:arm64x
+
+RUN: not lld-link -out:test.dll x86_64-data-sym.obj arm64ec-data-sym.obj \
+RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s
+
+RUN: not lld-link -out:test.dll aarch64-data-sym.obj arm64ec-data-sym.obj \
+RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT4 %s
+
+RUN: not lld-link -out:test.dll i686-data-sym.obj arm64ec-data-sym.obj \
+RUN:              -dll -noentry 2>&1 | FileCheck -check-prefix=INCOMPAT5 %s
+INCOMPAT5: arm64ec-data-sym.obj: machine type arm64ec conflicts with x86
+
+arm64x input implies arm64 target
+RUN: lld-link -out:test.dll -machine:arm64 arm64x-resource.obj -dll -noentry
----------------
cjacek wrote:

I messed up that test. After revisiting the MSVC behavior, I found that passing a single input file triggers an exception. However, when multiple files are passed, it behaves similarly to LLD without this change. I’ve now limited the impact of this change to ARM64EC, which aligns more closely with MSVC’s handling in these scenarios.

https://github.com/llvm/llvm-project/pull/116281


More information about the llvm-commits mailing list