0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From 64f209a51a7277d778c196c31c58422a04a69238 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. gcc/gcc.c | 16 ++++++++--------
  8. 1 file changed, 8 insertions(+), 8 deletions(-)
  9. diff --git a/gcc/gcc.c b/gcc/gcc.c
  10. index 6920bec0fa0..40e07354b3d 100644
  11. --- a/gcc/gcc.c
  12. +++ b/gcc/gcc.c
  13. @@ -696,10 +696,10 @@ proper position among the other output files. */
  14. #define LIBASAN_SPEC STATIC_LIBASAN_LIBS
  15. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  16. #define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
  17. - " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
  18. + " %{!static-libasan:--push-state --no-as-needed}" \
  19. " -lasan " \
  20. " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
  21. - " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
  22. + " %{!static-libasan:--pop-state}" \
  23. STATIC_LIBASAN_LIBS
  24. #else
  25. #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
  26. @@ -717,10 +717,10 @@ proper position among the other output files. */
  27. #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
  28. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  29. #define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
  30. - " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
  31. + " %{!static-libtsan:--push-state --no-as-needed}" \
  32. " -ltsan " \
  33. " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
  34. - " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
  35. + " %{!static-libtsan:--pop-state}" \
  36. STATIC_LIBTSAN_LIBS
  37. #else
  38. #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
  39. @@ -738,10 +738,10 @@ proper position among the other output files. */
  40. #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
  41. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  42. #define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
  43. - " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
  44. + " %{!static-liblsan:--push-state --no-as-needed}" \
  45. " -llsan " \
  46. " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
  47. - " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
  48. + " %{!static-liblsan:--pop-state}" \
  49. STATIC_LIBLSAN_LIBS
  50. #else
  51. #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
  52. @@ -757,10 +757,10 @@ proper position among the other output files. */
  53. " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
  54. #ifdef HAVE_LD_STATIC_DYNAMIC
  55. #define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
  56. - " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
  57. + " %{!static-libubsan:--push-state --no-as-needed}" \
  58. " -lubsan " \
  59. " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
  60. - " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
  61. + " %{!static-libubsan:--pop-state}" \
  62. STATIC_LIBUBSAN_LIBS
  63. #else
  64. #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
  65. --
  66. 2.29.2