@@ -98,3 +98,7 @@ see the files COPYING3 and COPYING.RUNTIME
respectively. If not, see
#define TARGET_C99_FUNCTIONS 1
#define TARGET_HAS_SINCOS 1
+
+/* Additional libraries needed by -static-libasan. */
+#undef STATIC_LIBASAN_LIBS
+#define STATIC_LIBASAN_LIBS "-ldl -lpthread"
@@ -546,8 +546,12 @@ proper position among the other output files. */
#ifndef LIBASAN_SPEC
#ifdef HAVE_LD_STATIC_DYNAMIC
+#ifndef STATIC_LIBASAN_LIBS
+#define STATIC_LIBASAN_LIBS
+#endif
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}"
+ "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION \
+ " " STATIC_LIBASAN_LIBS "}"
#else
#define LIBASAN_SPEC "-lasan"
#endif