summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2021-09-24 17:21:05 -0400
committerMike Frysinger <vapier@gentoo.org>2021-09-24 17:21:05 -0400
commit944788cf8e200dd0a51e14be1ad37753b17bdb4c (patch)
tree60f649ab1cfcc014fb2cd4c431c9b3f857122de3
parentdarwin20-conf: add variant for libtool 2.2.7(a) (diff)
downloadelt-patches-944788cf8e200dd0a51e14be1ad37753b17bdb4c.tar.gz
elt-patches-944788cf8e200dd0a51e14be1ad37753b17bdb4c.tar.bz2
elt-patches-944788cf8e200dd0a51e14be1ad37753b17bdb4c.zip
backport -fsanitize & -fuse-ld for 2.4.620210924
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--eltpatch.in5
-rw-r--r--patches/fsanitize/2.4.637
-rw-r--r--patches/fuse-ld/2.4.636
3 files changed, 77 insertions, 1 deletions
diff --git a/eltpatch.in b/eltpatch.in
index 0765d49..7fa21bc 100644
--- a/eltpatch.in
+++ b/eltpatch.in
@@ -125,7 +125,10 @@ elibtoolize() {
local deptoremove=
local do_shallow="no"
local force="false"
- local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed target-nm ppc64le"
+ local elt_patches="
+ install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed target-nm ppc64le
+ fsanitize fuse-ld
+ "
for x in "$@" ; do
case ${x} in
diff --git a/patches/fsanitize/2.4.6 b/patches/fsanitize/2.4.6
new file mode 100644
index 0000000..f5113f5
--- /dev/null
+++ b/patches/fsanitize/2.4.6
@@ -0,0 +1,37 @@
+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
+---
+ build-aux/ltmain.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index 1cbe875dfd86..2a5aaadd68c0 100644
+--- ltmain.sh
++++ ltmain.sh
+@@ -5382,10 +5382,11 @@ func_mode_link ()
+ # -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"
+--
+2.33.0
+
diff --git a/patches/fuse-ld/2.4.6 b/patches/fuse-ld/2.4.6
new file mode 100644
index 0000000..c8f107c
--- /dev/null
+++ b/patches/fuse-ld/2.4.6
@@ -0,0 +1,36 @@
+From f9970d99293faf908fdc153a653fa5781095fb7a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 13 Feb 2016 02:14:29 -0500
+Subject: [PATCH] libtool: pass through -fuse-ld flags
+
+Starting with gcc-4.8, there's a -fuse-ld flag that can be used to
+select between bfd & gold. Make sure we pass it through to the
+linking stage.
+
+* build-aux/ltmain.in (func_mode_link): Pass -fuse-ld=* flags
+through.
+Copyright-paperwork-exempt: Yes
+---
+ build-aux/ltmain.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index 40eb0297f37d..26015641925e 100644
+--- ltmain.sh
++++ ltmain.sh
+@@ -5383,10 +5383,11 @@ func_mode_link ()
+ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
++ # -fuse-ld=* Linker select flags for GCC
+ -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=*|-fsanitize=*)
++ -specs=*|-fsanitize=*|-fuse-ld=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+--
+2.33.0
+