kou commented on code in PR #40927:
URL: https://github.com/apache/arrow/pull/40927#discussion_r1552654177
##########
cpp/cmake_modules/DefineOptions.cmake:
##########
@@ -170,6 +170,8 @@ takes precedence over ccache if a storage backend is
configured" ON)
define_option(ARROW_USE_LD_GOLD "Use ld.gold for linking on Linux (if
available)" OFF)
+ define_option(ARROW_USE_LLD "Use the LLVM lld for linking on Linux (if
available)" OFF)
Review Comment:
```suggestion
define_option(ARROW_USE_LLD "Use the LLVM lld for linking (if available)"
OFF)
```
##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -656,6 +656,34 @@ if(NOT WIN32 AND NOT APPLE)
endif()
endif()
+if(ARROW_USE_LLD)
+ find_program(LD_LLD ld.lld)
+ if(LD_LLD)
+ unset(LLD_LINKER_FLAGS)
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.1.0")
+ set(LLD_LINKER_FLAGS "-fuse-ld=lld")
+ else()
+ message(STATUS "Need GCC 9.1.0 or later to use LLD linker:
${CMAKE_CXX_COMPILER_VERSION}"
+ )
+ endif()
+ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ set(MOLD_LINKER_FLAGS "--ld-path=${LD_LLD}")
Review Comment:
```suggestion
set(LLD_LINKER_FLAGS "--ld-path=${LD_LLD}")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]