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 <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored and rok committed May 8, 2024
1 parent d5bf40a commit b53258e
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 b53258e

Please sign in to comment.