summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/berkeley-db/package.py5
-rw-r--r--var/spack/repos/builtin/packages/berkeley-db/tls.patch24
2 files changed, 29 insertions, 0 deletions
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 <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 {