Blob Blame History Raw
diff -up gperftools-2.7.90/configure.ac.dynload gperftools-2.7.90/configure.ac
--- gperftools-2.7.90/configure.ac.dynload	2020-03-09 10:55:12.212374186 -0400
+++ gperftools-2.7.90/configure.ac	2020-03-09 10:57:25.081830867 -0400
@@ -665,6 +665,17 @@ AS_IF([test "x$enable_aggressive_decommi
                  1,
                  [enable aggressive decommit by default])])
 
+# Enable generic dynamic TLS model by default
+default_enable_generic_dynamic_tls=yes
+AC_ARG_ENABLE([general-dynamic-tls],
+              [AS_HELP_STRING([--disable-general-dynamic-tls],
+                              [Do not use the general dynamic TLS model])],
+              [],
+              [enable_generic_dynamic_tls="$default_enable_generic_dynamic_tls"])
+AS_IF([test "x$enable_generic_dynamic_tls" = xyes],
+      [AC_DEFINE([ENABLE_GENERIC_DYNAMIC_TLS], 1,
+                 [Use the generic dynamic TLS model])])
+
 # Write generated configuration file
 AC_CONFIG_FILES([Makefile
                  src/gperftools/tcmalloc.h src/windows/gperftools/tcmalloc.h])
diff -up gperftools-2.7.90/src/base/basictypes.h.dynload gperftools-2.7.90/src/base/basictypes.h
--- gperftools-2.7.90/src/base/basictypes.h.dynload	2020-02-23 15:15:47.000000000 -0500
+++ gperftools-2.7.90/src/base/basictypes.h	2020-03-09 10:55:12.212374186 -0400
@@ -200,7 +200,7 @@ struct CompileAssert {
 # define ATTRIBUTE_UNUSED
 #endif
 
-#if defined(HAVE___ATTRIBUTE__) && defined(HAVE_TLS)
+#if defined(HAVE___ATTRIBUTE__) && defined(HAVE_TLS) && defined(ENABLE_GENERIC_DYNAMIC_TLS)
 #define ATTR_INITIAL_EXEC __attribute__ ((tls_model ("initial-exec")))
 #else
 #define ATTR_INITIAL_EXEC