1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

[tools] Add option to install binutils symlinks

The LLVM tools can be used as a replacement for binutils, in which case
it's convenient to create symlinks with the binutils names. Add support
for these symlinks in the build system. As with any other llvm tool
symlinks, the user can limit the installed symlinks by only adding the
desired ones to `LLVM_TOOLCHAIN_TOOLS`.

Differential Revision: https://reviews.llvm.org/D39530

llvm-svn: 317272
This commit is contained in:
Shoaib Meenai 2017-11-02 21:43:32 +00:00
parent 3022c20faf
commit 8e98660f03
12 changed files with 48 additions and 0 deletions

View File

@ -179,6 +179,9 @@ set(CMAKE_MODULE_PATH
# for use by clang_complete, YouCompleteMe, etc.
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
option(LLVM_INSTALL_BINUTILS_SYMLINKS
"Install symlinks from the binutils tool names to the corresponding LLVM tools." OFF)
option(LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OFF)
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)

View File

@ -224,6 +224,10 @@ LLVM-specific variables
Generate build targets for the LLVM tools. Defaults to ON. You can use this
option to disable the generation of build targets for the LLVM tools.
**LLVM_INSTALL_BINUTILS_SYMLINKS**:BOOL
Install symlinks from the binutils tool names to the corresponding LLVM tools.
For example, ar will be symlinked to llvm-ar.
**LLVM_BUILD_EXAMPLES**:BOOL
Build LLVM examples. Defaults to OFF. Targets for building each example are
generated in any case. See documentation for *LLVM_BUILD_TOOLS* above for more

View File

@ -17,3 +17,9 @@ add_llvm_tool(llvm-ar
add_llvm_tool_symlink(llvm-ranlib llvm-ar)
add_llvm_tool_symlink(llvm-lib llvm-ar)
add_llvm_tool_symlink(llvm-dlltool llvm-ar)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(ar llvm-ar)
add_llvm_tool_symlink(dlltool llvm-ar)
add_llvm_tool_symlink(ranlib llvm-ar)
endif()

View File

@ -6,3 +6,7 @@ set(LLVM_LINK_COMPONENTS
add_llvm_tool(llvm-cxxfilt
llvm-cxxfilt.cpp
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(c++filt llvm-cxxfilt)
endif()

View File

@ -15,3 +15,7 @@ add_llvm_tool(llvm-dwp
DEPENDS
intrinsics_gen
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(dwp llvm-dwp)
endif()

View File

@ -14,3 +14,7 @@ add_llvm_tool(llvm-nm
DEPENDS
intrinsics_gen
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(nm llvm-nm)
endif()

View File

@ -7,3 +7,7 @@ add_llvm_tool(llvm-objcopy
llvm-objcopy.cpp
Object.cpp
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(objcopy llvm-objcopy)
endif()

View File

@ -25,3 +25,7 @@ add_llvm_tool(llvm-objdump
if(HAVE_LIBXAR)
target_link_libraries(llvm-objdump ${XAR_LIB})
endif()
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(objdump llvm-objdump)
endif()

View File

@ -23,3 +23,7 @@ add_llvm_tool(llvm-readobj
)
add_llvm_tool_symlink(llvm-readelf llvm-readobj)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(readelf llvm-readobj)
endif()

View File

@ -6,3 +6,7 @@ set(LLVM_LINK_COMPONENTS
add_llvm_tool(llvm-size
llvm-size.cpp
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(size llvm-size)
endif()

View File

@ -8,3 +8,6 @@ add_llvm_tool(llvm-strings
llvm-strings.cpp
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(strings llvm-strings)
endif()

View File

@ -14,3 +14,7 @@ set(LLVM_LINK_COMPONENTS
add_llvm_tool(llvm-symbolizer
llvm-symbolizer.cpp
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(addr2line llvm-symbolizer)
endif()