[Pkg-cmake-commits] [cmake] 04/05: Fix broken binaries when using clang with -fsanitize.

Felix Geyer fgeyer at moszumanska.debian.org
Sun Sep 11 18:17:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

fgeyer pushed a commit to branch master
in repository cmake.

commit bee75f6baa93f08e274a27b7ddd851f38d36ead1
Author: Felix Geyer <fgeyer at debian.org>
Date:   Sun Sep 11 17:25:27 2016 +0200

    Fix broken binaries when using clang with -fsanitize.
    
    * Fix broken binaries when using clang with -fsanitize. (Closes: #835426)
      - Add CMakeParseImplicitLinkInfo_Exclude_libclang_rt.patch,
        cherry-picked from upstream.
---
 debian/changelog                                   |  3 ++
 ...ParseImplicitLinkInfo_Exclude_libclang_rt.patch | 47 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 51 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index bdd52b1..4fd15b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 cmake (3.6.2-1) UNRELEASED; urgency=medium
 
   * New upstream release.
+  * Fix broken binaries when using clang with -fsanitize. (Closes: #835426)
+    - Add CMakeParseImplicitLinkInfo_Exclude_libclang_rt.patch,
+      cherry-picked from upstream.
 
  -- Felix Geyer <fgeyer at debian.org>  Sun, 11 Sep 2016 17:22:48 +0200
 
diff --git a/debian/patches/CMakeParseImplicitLinkInfo_Exclude_libclang_rt.patch b/debian/patches/CMakeParseImplicitLinkInfo_Exclude_libclang_rt.patch
new file mode 100644
index 0000000..de97ae6
--- /dev/null
+++ b/debian/patches/CMakeParseImplicitLinkInfo_Exclude_libclang_rt.patch
@@ -0,0 +1,47 @@
+From 353222262a77e0c9f23dfde1dfb78bfb3fe96c31 Mon Sep 17 00:00:00 2001
+From: Brad King <brad.king at kitware.com>
+Date: Mon, 11 Jul 2016 16:28:24 -0400
+Subject: [PATCH] CMakeParseImplicitLinkInfo: Exclude libclang_rt libraries
+
+These libraries are used for Clang runtime analysis support with
+flags like `-fsanitize=memory` and are not actually implicitly
+linked libraries.
+
+Fixes #16194.
+---
+ Modules/CMakeParseImplicitLinkInfo.cmake       | 2 +-
+ Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
+index ef9a2eb..da029bc 100644
+--- a/Modules/CMakeParseImplicitLinkInfo.cmake
++++ b/Modules/CMakeParseImplicitLinkInfo.cmake
+@@ -124,7 +124,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
+   # We remove items that are not language-specific.
+   set(implicit_libs "")
+   foreach(lib IN LISTS implicit_libs_tmp)
+-    if("x${lib}" MATCHES "^x(crt.*\\.o|gcc.*|System.*)$")
++    if("x${lib}" MATCHES "^x(crt.*\\.o|gcc.*|System.*|.*libclang_rt.*)$")
+       set(log "${log}  remove lib [${lib}]\n")
+     elseif(IS_ABSOLUTE "${lib}")
+       get_filename_component(abs "${lib}" ABSOLUTE)
+diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+index da614e9..1313dbf 100644
+--- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
++++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+@@ -112,6 +112,12 @@ set(linux64_test3_libs "gfortran;m;quadmath;m;c")
+ set(linux64_test3_dirs "/usr/lib/gcc/x86_64-redhat-linux/5.1.1;/usr/lib64;/lib64;/usr/lib")
+ list(APPEND platforms linux64_test3)
+ 
++# clang -fsanitize=memory
++set(linux64_clang_sanitize_memory_text [[ "/usr/bin/ld" --hash-style=both --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu -L [...]
++set(linux64_clang_sanitize_memory_libs "pthread;rt;m;dl;c")
++set(linux64_clang_sanitize_memory_dirs "/usr/lib/gcc/x86_64-linux-gnu/5.4.0;/usr/lib/x86_64-linux-gnu;/lib/x86_64-linux-gnu;/lib64;/usr/lib;/usr/lib/llvm-3.8/lib;/lib")
++list(APPEND platforms linux64_clang_sanitize_memory)
++
+ #-----------------------------------------------------------------------------
+ # Mac
+ 
+--
+libgit2 0.24.0
diff --git a/debian/patches/series b/debian/patches/series
index e9e2070..59fe4c0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 FindBoost_add_-lpthread_#563479.diff
 qt_import_dir_variable.diff
 fix-ftbfs-on-kfreebsd.patch
+CMakeParseImplicitLinkInfo_Exclude_libclang_rt.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cmake/cmake.git



More information about the Pkg-cmake-commits mailing list