diff options
author | Keith Smiley <keithbsmiley@gmail.com> | 2022-01-30 13:38:03 -0800 |
---|---|---|
committer | Keith Smiley <keithbsmiley@gmail.com> | 2022-02-04 10:54:27 -0800 |
commit | dbed14d215fed740e0e26784e7b8b00b68f5e680 (patch) | |
tree | 7d01585fce71d35f109a3c3d1e67121c4dfc1a9f /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | |
parent | e55ace6c3729822d26feeeb74f81f3bd4872eaea (diff) | |
download | llvm-dbed14d215fed740e0e26784e7b8b00b68f5e680.zip llvm-dbed14d215fed740e0e26784e7b8b00b68f5e680.tar.gz llvm-dbed14d215fed740e0e26784e7b8b00b68f5e680.tar.bz2 |
[llvm-libtool-darwin] Fix crash with bitcode asm module
When using llvm-libtool-darwin with LTO building llvm itself, it crashed
on a file with an asm module in the bitcode. This fixes that by
correctly registering the targets for this.
Differential Revision: https://reviews.llvm.org/D118575
Diffstat (limited to 'llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp')
-rw-r--r-- | llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp index 8b6b264..cd56e10 100644 --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -21,6 +21,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/LineIterator.h" +#include "llvm/Support/TargetSelect.h" #include "llvm/Support/VirtualFileSystem.h" #include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" @@ -682,6 +683,10 @@ int main(int Argc, char **Argv) { if (VersionOption) cl::PrintVersionMessage(); + llvm::InitializeAllTargetInfos(); + llvm::InitializeAllTargetMCs(); + llvm::InitializeAllAsmParsers(); + Config C = *ConfigOrErr; switch (LibraryOperation) { case Operation::None: |