You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2020/07/21 17:14:04 UTC

[qpid-dispatch] branch master updated: DISPATCH-1716 Don't set -Wl, -z, defs in -fsanitize= builds with Clang (#777)

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

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 1fb8b07  DISPATCH-1716 Don't set -Wl,-z,defs in -fsanitize= builds with Clang (#777)
1fb8b07 is described below

commit 1fb8b07482bd8a67a3bff69ccc775e2c82cb4f96
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Tue Jul 21 19:13:33 2020 +0200

    DISPATCH-1716 Don't set -Wl,-z,defs in -fsanitize= builds with Clang (#777)
---
 .travis.yml        | 17 ++++++++++++++++-
 src/CMakeLists.txt | 14 ++++++++++----
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e71f3e4..9244a97 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -52,11 +52,26 @@ jobs:
     os: linux
     env:
     - PATH="/usr/bin:$PATH" PROTON_VERSION=0.31.0 BUILD_TYPE=Coverage
-  - name: "qdrouterd:RelWithDebInfo+MemoryDebug"
+  - name: "qdrouterd:RelWithDebInfo+MemoryDebug (gcc on xenial)"
     os: linux
     env:
     - PATH="/usr/bin:$PATH" PROTON_VERSION=0.31.0 BUILD_TYPE=RelWithDebInfo
     - DISPATCH_CMAKE_ARGS='-DRUNTIME_CHECK=asan -DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG'
+  - name: "qdrouterd:RelWithDebInfo+MemoryDebug (clang on focal)"
+    os: linux
+    dist: focal
+    compiler: clang
+    before_install:
+    - sudo apt-get install clang-10
+    # https://github.com/pypa/virtualenv/issues/1740
+    # https://github.com/pypa/virtualenv/issues/1873
+    - python -m pip install --user --upgrade pip
+    - python -m pip install --user --upgrade tox virtualenv==20.0.23
+    env:
+    - CC=clang-10
+    - CXX=clang++-10
+    - PATH="/usr/bin:$PATH" PROTON_VERSION=master BUILD_TYPE=RelWithDebInfo
+    - DISPATCH_CMAKE_ARGS='-DRUNTIME_CHECK=asan -DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG'
   - name: "qdrouterd:Default Build"
     os: linux
     env:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9ca178b..c73a937 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -143,13 +143,19 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
       PROPERTY COMPILE_FLAGS -Wno-strict-aliasing)
 endif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
 
-# DISPATCH-1384 - for MacOS use flat_namespace instead of 2 level
-# namespace (acts more like linux)
+if ((DEFINED ASAN_LIBRARY) OR (DEFINED UBSAN_LIBRARY) OR (DEFINED TSAN_LIBRARY))
+  set(USING_SANITIZERS TRUE)
+endif()
 if (APPLE)
+  # DISPATCH-1384 - for macOS use flat_namespace instead of 2 level
+  #  namespace (acts more like linux)
   set(QPID_DISPATCH_LIB_LINK_FLAGS "-Wl,-flat_namespace ${QPID_DISPATCH_LIB_LINK_FLAGS}")
-else(APPLE)
+elseif(CMAKE_C_COMPILER_ID MATCHES "Clang" AND USING_SANITIZERS)
+  # https://github.com/google/sanitizers/issues/380 - can't enable error on
+  #  undefined symbols when linking sanitizers with Clang
+else()
   set(QPID_DISPATCH_LIB_LINK_FLAGS "-Wl,-z,defs ${QPID_DISPATCH_LIB_LINK_FLAGS}")
-endif(APPLE)
+endif()
 
 add_library(qpid-dispatch SHARED ${qpid_dispatch_SOURCES})
 target_include_directories(qpid-dispatch PRIVATE ${qpid_dispatch_INCLUDES})


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org