llvm-lib: Disallow mixing object files with different machine types
authorNico Weber <nicolasweber@gmx.de>
Fri, 7 Jun 2019 13:24:34 +0000 (13:24 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 7 Jun 2019 13:24:34 +0000 (13:24 +0000)
commitd546b5052bb71ad90230fa572101730d4c0246a3
treea729217488254eec81f25a3de28ed392c2be886a
parent6880bceda2df17f68e319c86a78642125086e0b8
llvm-lib: Disallow mixing object files with different machine types

lib.exe doesn't allow creating .lib files with object files that have
differing machine types. Update llvm-lib to match.

The motivation is to make it possible to infer the machine type of a
.lib file in lld, so that it can warn when e.g. a 32-bit .lib file is
passed to a 64-bit link (PR38965).

Fixes PR38782.

Differential Revision: https://reviews.llvm.org/D62913

llvm-svn: 362798
llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt
llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt
llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
llvm/test/tools/llvm-lib/Inputs/arm64.ll [new file with mode: 0644]
llvm/test/tools/llvm-lib/Inputs/i386.ll [new file with mode: 0644]
llvm/test/tools/llvm-lib/Inputs/x86_64.ll [new file with mode: 0644]
llvm/test/tools/llvm-lib/machine-mismatch.test [new file with mode: 0644]
llvm/utils/gn/secondary/llvm/lib/ToolDrivers/llvm-lib/BUILD.gn