[lld] [LLD][COFF] Validate import library machine type. (PR #102738)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 10:00:25 PDT 2024
================
@@ -0,0 +1,32 @@
+# REQUIRES: x86
+# RUN: split-file %s %t.dir
+# RUN: llvm-lib -machine:i386 -out:%t.dir/test32.lib -def:%t.dir/test32.def
+# RUN: llvm-lib -machine:amd64 -out:%t.dir/test64.lib -def:%t.dir/test64.def
+# RUN: llvm-mc -triple i686-windows-msvc %t.dir/test.s -filetype=obj -o %t.dir/test32.obj
+# RUN: llvm-mc -triple x86_64-windows-msvc %t.dir/test.s -filetype=obj -o %t.dir/test64.obj
+
+# RUN: not lld-link -dll -noentry -out:%t32.dll %t.dir/test32.obj %t.dir/test64.lib 2>&1 | FileCheck --check-prefix=ERR32 %s
+# ERR32: error: test.dll: machine type x64 conflicts with x86
----------------
cjacek wrote:
The machine type is a property of import file, which is what's printed here. Import file is a member or an archive ("test64.lib" in this case) and I agree that it would be more informative to print that information. That's what we do for other member types, import files are an exception in this case. It's easy to change, I will create a PR.
https://github.com/llvm/llvm-project/pull/102738
More information about the llvm-commits
mailing list