You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/10/17 18:48:16 UTC

[kudu] branch master updated: build: tinker with gold linker detection

This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 91f638f  build: tinker with gold linker detection
91f638f is described below

commit 91f638f1d0b5206fdde23b6645741c0d5617975c
Author: Adar Dembo <ad...@cloudera.com>
AuthorDate: Wed Oct 16 21:56:11 2019 -0700

    build: tinker with gold linker detection
    
    Our precommit builds have the "optional and buggy" gold, yet were dropping
    tcmalloc despite not actually using gold. This patch adjusts the detection
    to allow for gold to be used in such situations.
    
    Change-Id: I69fc0ed78731d7ce452e751bab414ae98284886a
    Reviewed-on: http://gerrit.cloudera.org:8080/14481
    Tested-by: Adar Dembo <ad...@cloudera.com>
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 CMakeLists.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 324e6fc..e253cb4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -491,11 +491,11 @@ endif()
 if (GOLD_VERSION)
   # Older versions of the gold linker are vulnerable to a bug [1] which
   # prevents weak symbols from being overridden properly. This leads to
-  # omitting of Kudu's tcmalloc dependency.
+  # omitting of Kudu's tcmalloc dependency if using dynamic linking.
   #
   # How we handle this situation depends on other factors:
   # - If gold is optional, we won't use it.
-  # - If gold is required, we'll either:
+  # - If gold is required and we're using dynamic linking, we'll either:
   #   - Raise an error in RELEASE builds (we shouldn't release such a product), or
   #   - Drop tcmalloc in all other builds.
   #
@@ -505,13 +505,13 @@ if (GOLD_VERSION)
   endif()
   if (MUST_USE_GOLD)
     message("Using hard-wired gold linker (version ${GOLD_VERSION})")
-    if (KUDU_BUGGY_GOLD)
-      if ("${KUDU_LINK}" STREQUAL "d" AND
-          "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
+    if (KUDU_BUGGY_GOLD AND "${KUDU_LINK}" STREQUAL "d")
+      if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
         message(SEND_ERROR "Configured to use buggy gold with dynamic linking "
           "in a RELEASE build; this would cause tcmalloc symbols to get dropped")
       endif()
       message("Hard-wired gold linker is buggy, dropping tcmalloc dependency")
+      set(GOLD_INCOMPATIBLE_WITH_TCMALLOC 1)
     endif()
   elseif (NOT KUDU_BUGGY_GOLD)
     # The Gold linker must be manually enabled.
@@ -1126,7 +1126,7 @@ ADD_THIRDPARTY_LIB(krb5
 ## earlier comment).
 if (NOT "${KUDU_USE_ASAN}" AND
     NOT "${KUDU_USE_TSAN}" AND
-    NOT ("${KUDU_BUGGY_GOLD}" AND "${KUDU_LINK}" STREQUAL "d"))
+    NOT "${GOLD_INCOMPATIBLE_WITH_TCMALLOC}")
   find_package(GPerf REQUIRED)
   ADD_THIRDPARTY_LIB(tcmalloc
     STATIC_LIB "${TCMALLOC_STATIC_LIB}"