From e6fb099e982239ba55af9006e8647687416aa34e Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Wed, 7 Oct 2015 22:39:17 +0000 Subject: [PATCH] Stop linking all target libraries in llvm-nm and llvm-objdump. llvm-nm only needs the target to parse module level assembly in bitcode. It doesn't need a disassembler or codegen. llvm-objdump needs to be able to disassemble a file, but doesn't need asm parsers or codegen. This reduces the sizes of these tools by a few MB each, depending on how many backends are linked in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249632 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-nm/CMakeLists.txt | 4 +++- tools/llvm-objdump/CMakeLists.txt | 5 ++++- tools/llvm-objdump/llvm-objdump.cpp | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/llvm-nm/CMakeLists.txt b/tools/llvm-nm/CMakeLists.txt index 20293bb88f0..22b7bd3e35e 100644 --- a/tools/llvm-nm/CMakeLists.txt +++ b/tools/llvm-nm/CMakeLists.txt @@ -1,5 +1,7 @@ set(LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} + AllTargetsAsmParsers + AllTargetsDescs + AllTargetsInfos Core Object Support diff --git a/tools/llvm-objdump/CMakeLists.txt b/tools/llvm-objdump/CMakeLists.txt index 1f2721ab545..d0dd4ac0182 100644 --- a/tools/llvm-objdump/CMakeLists.txt +++ b/tools/llvm-objdump/CMakeLists.txt @@ -1,5 +1,8 @@ set(LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} + AllTargetsAsmPrinters + AllTargetsDescs + AllTargetsDisassemblers + AllTargetsInfos CodeGen DebugInfoDWARF MC diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index 169e5c0d9ac..7292841c55a 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -1582,7 +1582,6 @@ int main(int argc, char **argv) { // Initialize targets and assembly printers/parsers. llvm::InitializeAllTargetInfos(); llvm::InitializeAllTargetMCs(); - llvm::InitializeAllAsmParsers(); llvm::InitializeAllDisassemblers(); // Register the target printer for --version. -- 2.34.1