summaryrefslogtreecommitdiff
path: root/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
blob: 853a22eff54f6bc2c504109ce5324432c7c0640b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
https://bugs.gentoo.org/573744

From a5c6466528c060cc4660ad0319c00740db0e42ba Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
Date: Sun, 18 Oct 2015 21:55:39 -0700
Subject: [PATCH] libtool: fix GCC/clang linking with -fsanitize=*

References:
https://lists.gnu.org/archive/html/libtool/2014-04/msg00026.html

* build-aux/ltmain.in (func_mode_link): Pass -fsanitize=* to the
linker to allow trivial use of the clang address sanitizer.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
Copyright-paperwork-exempt: Yes

--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -5362,10 +5362,11 @@
       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
       # -specs=*             GCC specs files
       # -stdlib=*            select c++ std lib with clang
+      # -fsanitize=*         Clang/GCC memory and address sanitizer
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-      -specs=*)
+      -specs=*|-fsanitize=*)
         func_quote_for_eval "$arg"
 	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
--- a/build-aux/ltmain.sh
+++ b/build-aux/ltmain.sh
@@ -7274,10 +7274,11 @@
       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
       # -specs=*             GCC specs files
       # -stdlib=*            select c++ std lib with clang
+      # -fsanitize=*         Clang/GCC memory and address sanitizer
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-      -specs=*)
+      -specs=*|-fsanitize=*)
         func_quote_for_eval "$arg"
 	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"