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