Skip to content

Commit

Permalink
apacheGH-41061: [C++] Ignore ARROW_USE_MOLD/ARROW_USE_LLD with clang …
Browse files Browse the repository at this point in the history
…< 12 (apache#41062)

### Rationale for this change

`--ld-path` is available since clang 12 or later.

### What changes are included in this PR?

Ignore `ARROW_USE_MOLD`/`ARROW_USE_LLD` with clang < 12.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* GitHub Issue: apache#41061

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored and tolleybot committed May 4, 2024
1 parent 3dc8e8b commit 19bfeb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpp/cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,12 @@ if(ARROW_USE_LLD)
)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(LLD_LINKER_FLAGS "--ld-path=${LD_LLD}")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.0.0")
set(LLD_LINKER_FLAGS "--ld-path=${LD_LLD}")
else()
message(STATUS "Need clang 12.0.0 or later to use LLD linker: ${CMAKE_CXX_COMPILER_VERSION}"
)
endif()
else()
message(STATUS "Using the default linker because compiler doesn't support LLD: ${CMAKE_CXX_COMPILER_ID}"
)
Expand Down

0 comments on commit 19bfeb5

Please sign in to comment.