gcc-static-libsanitizer.patch 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. diff --git a/gcc/gcc.c b/gcc/gcc.c
  2. index 0af888c7d78..70c9b3f7e18 100644
  3. --- a/gcc/gcc.c
  4. +++ b/gcc/gcc.c
  5. @@ -733,12 +733,12 @@ proper position among the other output files. */
  6. #ifndef LIBASAN_SPEC
  7. #define STATIC_LIBASAN_LIBS \
  8. - " %{static-libasan|static:%:include(libsanitizer.spec)%(link_libasan)}"
  9. + " %:include(libsanitizer.spec)%(link_libasan)"
  10. #ifdef LIBASAN_EARLY_SPEC
  11. #define LIBASAN_SPEC STATIC_LIBASAN_LIBS
  12. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  13. -#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
  14. - "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
  15. +#define LIBASAN_SPEC LD_STATIC_OPTION \
  16. + " -lasan " LD_DYNAMIC_OPTION \
  17. STATIC_LIBASAN_LIBS
  18. #else
  19. #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
  20. @@ -751,12 +751,12 @@ proper position among the other output files. */
  21. #ifndef LIBHWASAN_SPEC
  22. #define STATIC_LIBHWASAN_LIBS \
  23. - " %{static-libhwasan|static:%:include(libsanitizer.spec)%(link_libhwasan)}"
  24. + " %:include(libsanitizer.spec)%(link_libhwasan)"
  25. #ifdef LIBHWASAN_EARLY_SPEC
  26. #define LIBHWASAN_SPEC STATIC_LIBHWASAN_LIBS
  27. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  28. -#define LIBHWASAN_SPEC "%{static-libhwasan:" LD_STATIC_OPTION \
  29. - "} -lhwasan %{static-libhwasan:" LD_DYNAMIC_OPTION "}" \
  30. +#define LIBHWASAN_SPEC LD_STATIC_OPTION \
  31. + " -lhwasan " LD_DYNAMIC_OPTION \
  32. STATIC_LIBHWASAN_LIBS
  33. #else
  34. #define LIBHWASAN_SPEC "-lhwasan" STATIC_LIBHWASAN_LIBS
  35. @@ -769,12 +769,12 @@ proper position among the other output files. */
  36. #ifndef LIBTSAN_SPEC
  37. #define STATIC_LIBTSAN_LIBS \
  38. - " %{static-libtsan|static:%:include(libsanitizer.spec)%(link_libtsan)}"
  39. + " %:include(libsanitizer.spec)%(link_libtsan)"
  40. #ifdef LIBTSAN_EARLY_SPEC
  41. #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
  42. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  43. -#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
  44. - "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
  45. +#define LIBTSAN_SPEC LD_STATIC_OPTION \
  46. + " -ltsan " LD_DYNAMIC_OPTION \
  47. STATIC_LIBTSAN_LIBS
  48. #else
  49. #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
  50. @@ -787,12 +787,12 @@ proper position among the other output files. */
  51. #ifndef LIBLSAN_SPEC
  52. #define STATIC_LIBLSAN_LIBS \
  53. - " %{static-liblsan|static:%:include(libsanitizer.spec)%(link_liblsan)}"
  54. + " %:include(libsanitizer.spec)%(link_liblsan)"
  55. #ifdef LIBLSAN_EARLY_SPEC
  56. #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
  57. #elif defined(HAVE_LD_STATIC_DYNAMIC)
  58. -#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
  59. - "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
  60. +#define LIBLSAN_SPEC LD_STATIC_OPTION \
  61. + " -llsan " LD_DYNAMIC_OPTION \
  62. STATIC_LIBLSAN_LIBS
  63. #else
  64. #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
  65. @@ -805,10 +805,10 @@ proper position among the other output files. */
  66. #ifndef LIBUBSAN_SPEC
  67. #define STATIC_LIBUBSAN_LIBS \
  68. - " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
  69. + " %:include(libsanitizer.spec)%(link_libubsan)"
  70. #ifdef HAVE_LD_STATIC_DYNAMIC
  71. -#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
  72. - "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
  73. +#define LIBUBSAN_SPEC LD_STATIC_OPTION \
  74. + " -lubsan " LD_DYNAMIC_OPTION \
  75. STATIC_LIBUBSAN_LIBS
  76. #else
  77. #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS