llvm-project/llvm/tools/llvm-objcopy
Chris Bieneman f06abbb393 LLVM Driver Multicall tool
This patch adds an llvm-driver multicall tool that can combine multiple
LLVM-based tools. The build infrastructure is enabled for a tool by
adding the GENERATE_DRIVER option to the add_llvm_executable CMake
call, and changing the tool's main function to a canonicalized
tool_name_main format (i.e. llvm_ar_main, clang_main, etc...).

As currently implemented llvm-driver contains dsymutil, llvm-ar,
llvm-cxxfilt, llvm-objcopy, and clang (if clang is included in the
build).

llvm-driver can be enabled from builds by setting
LLVM_TOOL_LLVM_DRIVER_BUILD=On.

There are several limitations in the current implementation, which can
be addressed in subsequent patches:

(1) the multicall binary cannot currently properly handle
multi-dispatch tools. This means symlinking llvm-ranlib to llvm-driver
will not properly result in llvm-ar's main being called.
(2) the multicall binary cannot be comprised of tools containing
conflicting cl::opt options as the global cl::opt option list cannot
contain duplicates.

These limitations can be addressed in subsequent patches.

Differential revision: https://reviews.llvm.org/D109977
2022-06-06 04:27:32 +00:00
..
BitcodeStripOpts.td [llvm] add -r functionality to llvm-bitcode-strip 2022-03-04 13:28:28 -08:00
CMakeLists.txt LLVM Driver Multicall tool 2022-06-06 04:27:32 +00:00
CommonOpts.td [llvm-objcopy][MachO] Add support for --keep-undefined 2021-03-08 18:57:25 -08:00
InstallNameToolOpts.td [llvm-install-name-tool] Add -prepend_rpath option 2020-10-23 15:01:03 -07:00
ObjcopyOptions.cpp [llvm-objcopy] Make llvm-strip --only-keep-debug suppress default --strip-all 2022-04-18 14:16:10 -07:00
ObjcopyOptions.h [llvm] add -r functionality to llvm-bitcode-strip 2022-03-04 13:28:28 -08:00
ObjcopyOpts.td [llvm-objcopy][docs] Update --update-section description 2022-04-04 16:18:17 +01:00
StripOpts.td
llvm-objcopy.cpp LLVM Driver Multicall tool 2022-06-06 04:27:32 +00:00