From 9543716d81bc51c17e2849bb8e071f5bba641ea4 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 14 Sep 2022 00:13:50 -0400 Subject: berkeley-db: Correct TLS auto-detection (#32592) --- .../repos/builtin/packages/berkeley-db/package.py | 5 +++++ .../repos/builtin/packages/berkeley-db/tls.patch | 24 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 var/spack/repos/builtin/packages/berkeley-db/tls.patch diff --git a/var/spack/repos/builtin/packages/berkeley-db/package.py b/var/spack/repos/builtin/packages/berkeley-db/package.py index 9d0f89c4c2..5a35b7fa64 100644 --- a/var/spack/repos/builtin/packages/berkeley-db/package.py +++ b/var/spack/repos/builtin/packages/berkeley-db/package.py @@ -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") diff --git a/var/spack/repos/builtin/packages/berkeley-db/tls.patch b/var/spack/repos/builtin/packages/berkeley-db/tls.patch new file mode 100644 index 0000000000..7e308a72fc --- /dev/null +++ b/var/spack/repos/builtin/packages/berkeley-db/tls.patch @@ -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 class TLSClass { ++ AC_TRY_COMPILE([#include ++ template 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 class TLSClass { ++#include ++ template class TLSClass { + public: static $ax_tls_decl_keyword T *tlsvar; + }; + class TLSClass2 { -- cgit v1.2.3-60-g2f50