unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jakub Kądziołka" <kuba@kadziolka.net>
To: 44440@debbugs.gnu.org
Subject: [bug#44440] [WIP PATCH 2/2] gnu: bdb: Fix building with GCC 9.
Date: Wed,  4 Nov 2020 14:36:30 +0100	[thread overview]
Message-ID: <20201104133630.4121575-1-kuba@kadziolka.net> (raw)
In-Reply-To: <20201104133427.4120918-1-kuba@kadziolka.net>

* gnu/packages/dbm.scm (bdb-4.8, bdb-5.3)[source]: Apply patch.
* gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register new file.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/dbm.scm                          |  8 +++++--
 .../patches/bdb-5.3-atomics-on-gcc-9.patch    | 22 +++++++++++++++++++
 3 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8c93e19b72..5bcb39dc9a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -817,6 +817,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/bastet-change-source-of-unordered_set.patch	\
   %D%/packages/patches/bazaar-CVE-2017-14176.patch		\
   %D%/packages/patches/bc-fix-cross-compilation.patch		\
+  %D%/packages/patches/bdb-5.3-atomics-on-gcc-9.patch		\
   %D%/packages/patches/beancount-disable-googleapis-fonts.patch	\
   %D%/packages/patches/beets-werkzeug-compat.patch		\
   %D%/packages/patches/behave-skip-a-couple-of-tests.patch	\
diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
index ea812c9715..a1df028d02 100644
--- a/gnu/packages/dbm.scm
+++ b/gnu/packages/dbm.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,7 +46,8 @@
                                  version ".tar.gz"))
              (sha256
               (base32
-               "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"))))
+               "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"))
+             (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))
     (build-system gnu-build-system)
     (outputs '("out"                             ; programs, libraries, headers
                "doc"))                           ; 94 MiB of HTML docs
@@ -108,7 +110,9 @@ SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))))))
+                "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))
+              (patch-flags '("-p0"))
+              (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))))
 
 (define-public bdb-6
   (package (inherit bdb-4.8)
diff --git a/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
new file mode 100644
index 0000000000..56d404da15
--- /dev/null
+++ b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
@@ -0,0 +1,22 @@
+Patch borrowed from Arch Linux. Allows compiling bdb 5.3 and earlier with GCC newer than 7.
+
+--- src/dbinc/atomic.h	2013-03-12 14:07:22.000000000 -0400
++++ src/dbinc/atomic.h.change	2013-03-12 14:06:35.000000000 -0400
+@@ -144,7 +144,7 @@
+ #define	atomic_inc(env, p)	__atomic_inc(p)
+ #define	atomic_dec(env, p)	__atomic_dec(p)
+ #define	atomic_compare_exchange(env, p, o, n)	\
+-	__atomic_compare_exchange((p), (o), (n))
++	__atomic_compare_exchange_db((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ 	int	temp;
+@@ -176,7 +176,7 @@
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __atomic_compare_exchange_db(
+ 	db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ 	atomic_value_t was;
-- 
2.29.1





  reply	other threads:[~2020-11-04 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 13:34 [bug#44440] [WIP PATCH 1/2] gnu: Use GCC 9 as the default compiler Jakub Kądziołka
2020-11-04 13:36 ` Jakub Kądziołka [this message]
2020-12-16 23:19   ` bug#44440: [WIP PATCH 2/2] gnu: bdb: Fix building with GCC 9 Marius Bakke
2020-11-10 22:21 ` [bug#44440] [WIP PATCH 1/2] gnu: Use GCC 9 as the default compiler Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201104133630.4121575-1-kuba@kadziolka.net \
    --to=kuba@kadziolka.net \
    --cc=44440@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).