Skip to content

Commit

Permalink
KUDU-3145 Skip old gold in our list of candidate linkers
Browse files Browse the repository at this point in the history
Older versions of the gold linker are vulnerable to a bug which
prevents weak symbols from being overridden properly. This leads to
omitting of Kudu's tcmalloc dependency if using dynamic linking,
and some related tests failed in DEBUG build mode.

This change moves KUDU_LINK setting before choosing the linker
to make sure to skip old gold if using dynamic linking.

Change-Id: I2d7dbd6a828f14a6790be657b0f497a4887a6f82
Reviewed-on: http://gerrit.cloudera.org:8080/16049
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
  • Loading branch information
huangtianhua authored and alexeyserbin committed Jun 12, 2020
1 parent 621cc24 commit 3d50fb1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,19 @@ if (${KUDU_USE_TSAN})
endif()
endif()

# If we still don't know what kind of linking to perform, choose based on
# build type (developers like fast builds).
if ("${KUDU_LINK}" STREQUAL "a")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "FASTDEBUG")
message("Using dynamic linking for ${CMAKE_BUILD_TYPE} builds")
set(KUDU_LINK "d")
else()
message("Using static linking for ${CMAKE_BUILD_TYPE} builds")
set(KUDU_LINK "s")
endif()
endif()

include("KuduLinker")
APPEND_LINKER_FLAGS()

Expand Down Expand Up @@ -473,19 +486,6 @@ if ("${KUDU_GENERATE_COVERAGE}")
endif()
endif()

# If we still don't know what kind of linking to perform, choose based on
# build type (developers like fast builds).
if ("${KUDU_LINK}" STREQUAL "a")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "FASTDEBUG")
message("Using dynamic linking for ${CMAKE_BUILD_TYPE} builds")
set(KUDU_LINK "d")
else()
message("Using static linking for ${CMAKE_BUILD_TYPE} builds")
set(KUDU_LINK "s")
endif()
endif()

# Having set KUDU_LINK due to build type and/or sanitizer, it's now safe to
# act on its value.
if ("${KUDU_LINK}" STREQUAL "d")
Expand Down

0 comments on commit 3d50fb1

Please sign in to comment.