[llvm] r317272 - [tools] Add option to install binutils symlinks
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 14:43:32 PDT 2017
Author: smeenai
Date: Thu Nov 2 14:43:32 2017
New Revision: 317272
URL: http://llvm.org/viewvc/llvm-project?rev=317272&view=rev
Log:
[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
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/docs/CMake.rst
llvm/trunk/tools/llvm-ar/CMakeLists.txt
llvm/trunk/tools/llvm-cxxfilt/CMakeLists.txt
llvm/trunk/tools/llvm-dwp/CMakeLists.txt
llvm/trunk/tools/llvm-nm/CMakeLists.txt
llvm/trunk/tools/llvm-objcopy/CMakeLists.txt
llvm/trunk/tools/llvm-objdump/CMakeLists.txt
llvm/trunk/tools/llvm-readobj/CMakeLists.txt
llvm/trunk/tools/llvm-size/CMakeLists.txt
llvm/trunk/tools/llvm-strings/CMakeLists.txt
llvm/trunk/tools/llvm-symbolizer/CMakeLists.txt
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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)
Modified: llvm/trunk/docs/CMake.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.rst (original)
+++ llvm/trunk/docs/CMake.rst Thu Nov 2 14:43:32 2017
@@ -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
Modified: llvm/trunk/tools/llvm-ar/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-ar/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-cxxfilt/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxfilt/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cxxfilt/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-cxxfilt/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-dwp/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-dwp/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-nm/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-nm/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-objcopy/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-objcopy/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-objdump/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-objdump/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-readobj/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-readobj/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-size/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-size/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-size/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-size/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-strings/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-strings/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-strings/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-strings/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
Modified: llvm/trunk/tools/llvm-symbolizer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/CMakeLists.txt?rev=317272&r1=317271&r2=317272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-symbolizer/CMakeLists.txt Thu Nov 2 14:43:32 2017
@@ -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()
More information about the llvm-commits
mailing list