# DP: Use --push-state/--pop-state for gold as well when linking libtsan.

--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -795,10 +795,10 @@ proper position among the other output f
 #define LIBASAN_SPEC STATIC_LIBASAN_LIBS
 #elif defined(HAVE_LD_STATIC_DYNAMIC)
 #define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
-		     " %{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+		     " %{!static-libasan:--push-state --no-as-needed}" \
 		     " -lasan " \
 		     " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
-		     " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+		     " %{!static-libasan:--pop-state}" \
 		     STATIC_LIBASAN_LIBS
 #else
 #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -834,10 +834,10 @@ proper position among the other output f
 #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
 #elif defined(HAVE_LD_STATIC_DYNAMIC)
 #define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
-		     " %{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+		     " %{!static-libtsan:--push-state --no-as-needed}" \
 		     " -ltsan " \
 		     " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
-		     " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+		     " %{!static-libtsan:--pop-state}" \
 		     STATIC_LIBTSAN_LIBS
 #else
 #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -855,10 +855,10 @@ proper position among the other output f
 #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
 #elif defined(HAVE_LD_STATIC_DYNAMIC)
 #define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
-		     " %{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+		     " %{!static-liblsan:--push-state --no-as-needed}" \
 		     " -llsan " \
 		     " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
-		     " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+		     " %{!static-liblsan:--pop-state}" \
 		     STATIC_LIBLSAN_LIBS
 #else
 #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -874,10 +874,10 @@ proper position among the other output f
   " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
 #ifdef HAVE_LD_STATIC_DYNAMIC
 #define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
-		     " %{!static-libubsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+		     " %{!static-libubsan:--push-state --no-as-needed}" \
 		     " -lubsan " \
 		     " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
-		     " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+		     " %{!static-libubsan:--pop-state}" \
 		     STATIC_LIBUBSAN_LIBS
 #else
 #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--- a/src/gcc/config/gnu-user.h
+++ b/src/gcc/config/gnu-user.h
@@ -137,22 +137,22 @@ see the files COPYING3 and COPYING.RUNTI
 #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
   "%{static-libasan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+  LD_DYNAMIC_OPTION "}}%{!static-libasan:--push-state --no-as-needed -lasan --pop-state}"
 #undef LIBHWASAN_EARLY_SPEC
 #define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
   "%{static-libhwasan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-libhwasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lhwasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+  LD_DYNAMIC_OPTION "}}%{!static-libhwasan:--push-state --no-as-needed -lhwasan --pop-state}"
 #undef LIBTSAN_EARLY_SPEC
 #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
   "%{static-libtsan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+  LD_DYNAMIC_OPTION "}}%{!static-libtsan:--push-state --no-as-needed -ltsan --pop-state}"
 #undef LIBLSAN_EARLY_SPEC
 #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
   "%{static-liblsan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+  LD_DYNAMIC_OPTION "}}%{!static-liblsan:--push-state --no-as-needed -llsan --pop-state}"
 #endif
 
 #undef TARGET_F951_OPTIONS
