[PATCH] D31053: Do not pass archive files containing non-native object files.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 13:41:10 PDT 2017


ruiu created this revision.
Herald added a subscriber: mehdi_amini.

The MSVC linker doesn't like archive files containing non-native object
files.

When we are doing an LTO build, we may create archive files containing
both LLVM bitcode files and native object files. For example, if a
project contains assembly files and C++ files, we create native object
files for the assembly files and LLVM bitcode files for the C++ files.

With the /msvclto option, LLD passes archive files to the MSVC linker.
Previously, we didn't pass archive files if they contain at least one
bitcode files. That wasn't correct because the native object files that
weren't passed to the MSVC linker may be needed to complete linking.

In this patch, we create new temporary archive files to strip bitcode
files.


https://reviews.llvm.org/D31053

Files:
  lld/COFF/Driver.cpp
  lld/COFF/Error.h
  lld/test/COFF/msvclto-archive.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31053.92046.patch
Type: text/x-patch
Size: 7184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170316/86621792/attachment.bin>


More information about the llvm-commits mailing list