0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch (3019B)
1 From 4841bee243517cd52504f97ea934f44bc0c1fd5c Mon Sep 17 00:00:00 2001 2 From: Ariadne Conill <ariadne@dereferenced.org> 3 Date: Fri, 21 Aug 2020 07:03:42 +0000 4 Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when 5 linking libtsan. 6 7 --- 8 gcc/gcc.c | 16 ++++++++-------- 9 1 file changed, 8 insertions(+), 8 deletions(-) 10 11 diff --git a/gcc/gcc.c b/gcc/gcc.c 12 index 6920bec0fa0..40e07354b3d 100644 13 --- a/gcc/gcc.c 14 +++ b/gcc/gcc.c 15 @@ -696,10 +696,10 @@ proper position among the other output files. */ 16 #define LIBASAN_SPEC STATIC_LIBASAN_LIBS 17 #elif defined(HAVE_LD_STATIC_DYNAMIC) 18 #define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \ 19 - " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ 20 + " %{!static-libasan:--push-state --no-as-needed}" \ 21 " -lasan " \ 22 " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ 23 - " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ 24 + " %{!static-libasan:--pop-state}" \ 25 STATIC_LIBASAN_LIBS 26 #else 27 #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS 28 @@ -717,10 +717,10 @@ proper position among the other output files. */ 29 #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS 30 #elif defined(HAVE_LD_STATIC_DYNAMIC) 31 #define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \ 32 - " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ 33 + " %{!static-libtsan:--push-state --no-as-needed}" \ 34 " -ltsan " \ 35 " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ 36 - " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ 37 + " %{!static-libtsan:--pop-state}" \ 38 STATIC_LIBTSAN_LIBS 39 #else 40 #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS 41 @@ -738,10 +738,10 @@ proper position among the other output files. */ 42 #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS 43 #elif defined(HAVE_LD_STATIC_DYNAMIC) 44 #define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \ 45 - " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ 46 + " %{!static-liblsan:--push-state --no-as-needed}" \ 47 " -llsan " \ 48 " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ 49 - " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ 50 + " %{!static-liblsan:--pop-state}" \ 51 STATIC_LIBLSAN_LIBS 52 #else 53 #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS 54 @@ -757,10 +757,10 @@ proper position among the other output files. */ 55 " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}" 56 #ifdef HAVE_LD_STATIC_DYNAMIC 57 #define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \ 58 - " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ 59 + " %{!static-libubsan:--push-state --no-as-needed}" \ 60 " -lubsan " \ 61 " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ 62 - " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ 63 + " %{!static-libubsan:--pop-state}" \ 64 STATIC_LIBUBSAN_LIBS 65 #else 66 #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS 67 -- 68 2.31.1 69