blob: 8e72c6dcd0a59401e11cdc3fa21b7fd72145d30f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
Grabbed from Fedora: https://src.fedoraproject.org/rpms/gperftools/blob/rawhide/f/gperftools-2.7.90-disable-generic-dynamic-tls.patch
Allows consumers to work correctly on arm64.
--- a/configure.ac
+++ b/configure.ac
@@ -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])
--- a/src/base/basictypes.h
+++ b/src/base/basictypes.h
@@ -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
|