berkeley-db: Correct TLS auto-detection (#32592)

This commit is contained in:
Erik Schnetter 2022-09-14 00:13:50 -04:00 committed by GitHub
parent 4ebdc5643e
commit 9543716d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -39,6 +39,11 @@ class BerkeleyDb(AutotoolsPackage):
build_directory = "build_unix"
patch("drop-docs.patch", when="~docs")
# Correct autoconf macro to detect TLS support.
# Patch developed by @eschnett. There is no upstream issue because
# Oracle's web site does not have instructions for submitting such
# an issue or pull request.
patch("tls.patch")
conflicts("%clang@7:", when="@5.3.28")
conflicts("%gcc@8:", when="@5.3.28")

View File

@ -0,0 +1,24 @@
--- a/dist/aclocal/tls.m4
+++ b/dist/aclocal/tls.m4
@@ -15,7 +15,8 @@
for ax_tls_defn_keyword in $ax_tls_keywords ""; do
test -z "$ax_tls_decl_keyword" &&
test -z "$ax_tls_defn_keyword" && continue
- AC_TRY_COMPILE([template <typename T>class TLSClass {
+ AC_TRY_COMPILE([#include <stdlib.h>
+ template <typename T>class TLSClass {
public: static ] $ax_tls_decl_keyword [ T *tlsvar;
};
class TLSClass2 {
--- a/dist/configure
+++ b/dist/configure
@@ -19044,7 +19044,8 @@
test -z "$ax_tls_defn_keyword" && continue
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-template <typename T>class TLSClass {
+#include <stdlib.h>
+ template <typename T>class TLSClass {
public: static $ax_tls_decl_keyword T *tlsvar;
};
class TLSClass2 {