mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 07:31:28 +00:00
[llvm-{debuginfod,ml,objdump,symbolizer}, dsymutil] Enable multicall driver
Differential Revision: https://reviews.llvm.org/D157670
This commit is contained in:
parent
de2be3e469
commit
2628fa3351
@ -36,9 +36,10 @@ add_llvm_tool(dsymutil
|
||||
intrinsics_gen
|
||||
${tablegen_deps}
|
||||
DsymutilTableGen
|
||||
GENERATE_DRIVER
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
|
||||
target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation")
|
||||
endif(APPLE)
|
||||
|
||||
|
@ -595,7 +595,7 @@ getOutputFileName(StringRef InputFile, const DsymutilOptions &Options) {
|
||||
return OutputLocation(std::string(Path.str()), ResourceDir);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int dsymutil_main(int argc, char **argv, const llvm::ToolContext &) {
|
||||
InitLLVM X(argc, argv);
|
||||
|
||||
// Parse arguments.
|
||||
|
@ -11,8 +11,13 @@ add_llvm_tool(llvm-debuginfod
|
||||
|
||||
DEPENDS
|
||||
DebugInfodOptsTableGen
|
||||
GENERATE_DRIVER
|
||||
)
|
||||
target_link_libraries(llvm-debuginfod PRIVATE LLVMDebuginfod)
|
||||
|
||||
if(NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
|
||||
target_link_libraries(llvm-debuginfod PRIVATE LLVMDebuginfod)
|
||||
endif()
|
||||
|
||||
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
|
||||
add_llvm_tool_symlink(debuginfod llvm-debuginfod)
|
||||
endif()
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "llvm/Option/Option.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/InitLLVM.h"
|
||||
#include "llvm/Support/LLVMDriver.h"
|
||||
#include "llvm/Support/ThreadPool.h"
|
||||
|
||||
using namespace llvm;
|
||||
@ -119,7 +120,7 @@ static void parseArgs(int argc, char **argv) {
|
||||
HostInterface = Args.getLastArgValue(OPT_host_interface, "0.0.0.0");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int llvm_debuginfod_main(int argc, char **argv, const llvm::ToolContext &) {
|
||||
InitLLVM X(argc, argv);
|
||||
HTTPClient::initialize();
|
||||
parseArgs(argc, argv);
|
||||
|
@ -25,6 +25,12 @@ target_sources(llvm-driver PRIVATE llvm-driver.cpp)
|
||||
set_target_properties(llvm-driver PROPERTIES OUTPUT_NAME llvm)
|
||||
|
||||
target_link_libraries(llvm-driver PUBLIC ${LLVM_DRIVER_OBJLIBS})
|
||||
target_link_libraries(llvm-driver PUBLIC LLVMDebuginfod)
|
||||
|
||||
if(LLVM_HAVE_LIBXAR)
|
||||
# used by llvm-objdump
|
||||
target_link_libraries(llvm-driver PUBLIC ${XAR_LIB})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# dsymutil uses some CoreFoundation stuff on Darwin...
|
||||
|
@ -18,4 +18,5 @@ add_public_tablegen_target(MLTableGen)
|
||||
add_llvm_tool(llvm-ml
|
||||
llvm-ml.cpp
|
||||
Disassembler.cpp
|
||||
GENERATE_DRIVER
|
||||
)
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "llvm/Support/FormatVariadic.h"
|
||||
#include "llvm/Support/FormattedStream.h"
|
||||
#include "llvm/Support/InitLLVM.h"
|
||||
#include "llvm/Support/LLVMDriver.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include "llvm/Support/Process.h"
|
||||
@ -185,7 +186,7 @@ static int AssembleInput(StringRef ProgName, const Target *TheTarget,
|
||||
return Res;
|
||||
}
|
||||
|
||||
int main(int Argc, char **Argv) {
|
||||
int llvm_ml_main(int Argc, char **Argv, const llvm::ToolContext &) {
|
||||
InitLLVM X(Argc, Argv);
|
||||
StringRef ProgName = sys::path::filename(Argv[0]);
|
||||
|
||||
|
@ -34,11 +34,14 @@ add_llvm_tool(llvm-objdump
|
||||
DEPENDS
|
||||
ObjdumpOptsTableGen
|
||||
OtoolOptsTableGen
|
||||
GENERATE_DRIVER
|
||||
)
|
||||
|
||||
target_link_libraries(llvm-objdump PRIVATE LLVMDebuginfod)
|
||||
if(NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
|
||||
target_link_libraries(llvm-objdump PRIVATE LLVMDebuginfod)
|
||||
endif()
|
||||
|
||||
if(LLVM_HAVE_LIBXAR)
|
||||
if(LLVM_HAVE_LIBXAR AND NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
|
||||
target_link_libraries(llvm-objdump PRIVATE ${XAR_LIB})
|
||||
endif()
|
||||
|
||||
|
@ -73,6 +73,7 @@
|
||||
#include "llvm/Support/FormatVariadic.h"
|
||||
#include "llvm/Support/GraphWriter.h"
|
||||
#include "llvm/Support/InitLLVM.h"
|
||||
#include "llvm/Support/LLVMDriver.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/SourceMgr.h"
|
||||
#include "llvm/Support/StringSaver.h"
|
||||
@ -3247,7 +3248,7 @@ static void parseObjdumpOptions(const llvm::opt::InputArgList &InputArgs) {
|
||||
InputFilenames.push_back("a.out");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int llvm_objdump_main(int argc, char **argv, const llvm::ToolContext &) {
|
||||
using namespace llvm;
|
||||
InitLLVM X(argc, argv);
|
||||
|
||||
|
@ -20,9 +20,12 @@ add_llvm_tool(llvm-symbolizer
|
||||
|
||||
DEPENDS
|
||||
SymbolizerOptsTableGen
|
||||
GENERATE_DRIVER
|
||||
)
|
||||
|
||||
target_link_libraries(llvm-symbolizer PRIVATE LLVMDebuginfod)
|
||||
if(NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
|
||||
target_link_libraries(llvm-symbolizer PRIVATE LLVMDebuginfod)
|
||||
endif()
|
||||
|
||||
add_llvm_tool_symlink(llvm-addr2line llvm-symbolizer)
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
#include "llvm/Support/InitLLVM.h"
|
||||
#include "llvm/Support/LLVMDriver.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include "llvm/Support/StringSaver.h"
|
||||
#include "llvm/Support/WithColor.h"
|
||||
@ -395,7 +396,7 @@ static void filterMarkup(const opt::InputArgList &Args, LLVMSymbolizer &Symboliz
|
||||
Filter.finish();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int llvm_symbolizer_main(int argc, char **argv, const llvm::ToolContext &) {
|
||||
InitLLVM X(argc, argv);
|
||||
sys::InitializeCOMRAII COM(sys::COMThreadingMode::MultiThreaded);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user