Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elt-patches:master commit in: /, patches/fsanitize/, patches/fuse-ld/
Date: Fri, 24 Sep 2021 21:24:53
Message-Id: 1632518465.944788cf8e200dd0a51e14be1ad37753b17bdb4c.vapier@gentoo
1 commit: 944788cf8e200dd0a51e14be1ad37753b17bdb4c
2 Author: Mike Frysinger <vapier <AT> chromium <DOT> org>
3 AuthorDate: Fri Sep 24 21:21:05 2021 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 24 21:21:05 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/elt-patches.git/commit/?id=944788cf
7
8 backport -fsanitize & -fuse-ld for 2.4.6
9
10 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
11
12 eltpatch.in | 5 ++++-
13 patches/fsanitize/2.4.6 | 37 +++++++++++++++++++++++++++++++++++++
14 patches/fuse-ld/2.4.6 | 36 ++++++++++++++++++++++++++++++++++++
15 3 files changed, 77 insertions(+), 1 deletion(-)
16
17 diff --git a/eltpatch.in b/eltpatch.in
18 index 0765d49..7fa21bc 100644
19 --- a/eltpatch.in
20 +++ b/eltpatch.in
21 @@ -125,7 +125,10 @@ elibtoolize() {
22 local deptoremove=
23 local do_shallow="no"
24 local force="false"
25 - local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed target-nm ppc64le"
26 + local elt_patches="
27 + install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed target-nm ppc64le
28 + fsanitize fuse-ld
29 + "
30
31 for x in "$@" ; do
32 case ${x} in
33
34 diff --git a/patches/fsanitize/2.4.6 b/patches/fsanitize/2.4.6
35 new file mode 100644
36 index 0000000..f5113f5
37 --- /dev/null
38 +++ b/patches/fsanitize/2.4.6
39 @@ -0,0 +1,37 @@
40 +From a5c6466528c060cc4660ad0319c00740db0e42ba Mon Sep 17 00:00:00 2001
41 +From: Jeremy Huddleston Sequoia <jeremyhu@××××××××.org>
42 +Date: Sun, 18 Oct 2015 21:55:39 -0700
43 +Subject: [PATCH] libtool: fix GCC/clang linking with -fsanitize=*
44 +
45 +References:
46 +https://lists.gnu.org/archive/html/libtool/2014-04/msg00026.html
47 +
48 +* build-aux/ltmain.in (func_mode_link): Pass -fsanitize=* to the
49 +linker to allow trivial use of the clang address sanitizer.
50 +
51 +Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@××××××××.org>
52 +Copyright-paperwork-exempt: Yes
53 +---
54 + build-aux/ltmain.in | 3 ++-
55 + 1 file changed, 2 insertions(+), 1 deletion(-)
56 +
57 +diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
58 +index 1cbe875dfd86..2a5aaadd68c0 100644
59 +--- ltmain.sh
60 ++++ ltmain.sh
61 +@@ -5382,10 +5382,11 @@ func_mode_link ()
62 + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
63 + # -specs=* GCC specs files
64 + # -stdlib=* select c++ std lib with clang
65 ++ # -fsanitize=* Clang/GCC memory and address sanitizer
66 + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
67 + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
68 + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
69 +- -specs=*)
70 ++ -specs=*|-fsanitize=*)
71 + func_quote_for_eval "$arg"
72 + arg=$func_quote_for_eval_result
73 + func_append compile_command " $arg"
74 +--
75 +2.33.0
76 +
77
78 diff --git a/patches/fuse-ld/2.4.6 b/patches/fuse-ld/2.4.6
79 new file mode 100644
80 index 0000000..c8f107c
81 --- /dev/null
82 +++ b/patches/fuse-ld/2.4.6
83 @@ -0,0 +1,36 @@
84 +From f9970d99293faf908fdc153a653fa5781095fb7a Mon Sep 17 00:00:00 2001
85 +From: Mike Frysinger <vapier@g.o>
86 +Date: Sat, 13 Feb 2016 02:14:29 -0500
87 +Subject: [PATCH] libtool: pass through -fuse-ld flags
88 +
89 +Starting with gcc-4.8, there's a -fuse-ld flag that can be used to
90 +select between bfd & gold. Make sure we pass it through to the
91 +linking stage.
92 +
93 +* build-aux/ltmain.in (func_mode_link): Pass -fuse-ld=* flags
94 +through.
95 +Copyright-paperwork-exempt: Yes
96 +---
97 + build-aux/ltmain.in | 3 ++-
98 + 1 file changed, 2 insertions(+), 1 deletion(-)
99 +
100 +diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
101 +index 40eb0297f37d..26015641925e 100644
102 +--- ltmain.sh
103 ++++ ltmain.sh
104 +@@ -5383,10 +5383,11 @@ func_mode_link ()
105 + # -specs=* GCC specs files
106 + # -stdlib=* select c++ std lib with clang
107 + # -fsanitize=* Clang/GCC memory and address sanitizer
108 ++ # -fuse-ld=* Linker select flags for GCC
109 + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
110 + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
111 + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
112 +- -specs=*|-fsanitize=*)
113 ++ -specs=*|-fsanitize=*|-fuse-ld=*)
114 + func_quote_for_eval "$arg"
115 + arg=$func_quote_for_eval_result
116 + func_append compile_command " $arg"
117 +--
118 +2.33.0
119 +