GNU bug report logs - #44440
[WIP PATCH 1/2] gnu: Use GCC 9 as the default compiler.

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Wed, 4 Nov 2020 13:35:02 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <marius <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44440 in the body.
You can then email your comments to 44440 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#44440; Package guix-patches. (Wed, 04 Nov 2020 13:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 04 Nov 2020 13:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [WIP PATCH 1/2] gnu: Use GCC 9 as the default compiler.
Date: Wed,  4 Nov 2020 14:34:27 +0100
* gnu/packages/commencement.scm
(gcc-toolchain-7): Use MAKE-GCC-TOOLCHAIN.
(gcc-toolchain-9): Change to GCC-TOOLCHAIN.
* gnu/packages/gcc (gcc): Change from GCC-7 to GCC-9.
(gcc-objc): Change to GCC-OBJC-9.
(gcc-objc++): Change to GCC-OBJC++-9.
---

Dear Guix,

this short patchstack switches the default toolchain to GCC 9 and fixes
enough to get hello to compile.

If my memory is correct, one of the cross-compiling target still breaks.
I'm not interested in trying to figure out why, so I'm sending the WIP
patches your way.

Regards,
Jakub Kądziołka

 gnu/packages/commencement.scm |  4 ++--
 gnu/packages/gcc.scm          | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 1e1c370aa8..6347dd2e1d 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3868,13 +3868,13 @@ is the GNU Compiler Collection.")
   (make-gcc-toolchain gcc-6))
 
 (define-public gcc-toolchain-7
-  gcc-toolchain)
+  (make-gcc-toolchain gcc-7))
 
 (define-public gcc-toolchain-8
   (make-gcc-toolchain gcc-8))
 
 (define-public gcc-toolchain-9
-  (make-gcc-toolchain gcc-9))
+  gcc-toolchain)
 
 (define-public gcc-toolchain-10
   (make-gcc-toolchain gcc-10))
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 4d5aaa7070..ea576dfb8d 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2020 Joseph LaFreniere <joseph <at> lafreniere.xyz>
 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury <at> disroot.org>
 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -585,10 +586,9 @@ It also includes runtime support libraries for these languages.")))
             (patches (search-patches "gcc-9-strmov-store-file-names.patch"
                                      "gcc-5.0-libvtv-runpath.patch"))))))
 
-;; Note: When changing the default gcc version, update
-;;       the gcc-toolchain-* definitions and the gfortran definition
-;;       accordingly.
-(define-public gcc gcc-7)
+;; Note: When changing the default gcc version, update the definitions
+;;       for gcc-toolchain-{old,new}, gcc-objc and gcc-objc++.
+(define-public gcc gcc-9)
 
 (define-public (make-libstdc++ gcc)
   "Return a libstdc++ package based on GCC.  The primary use case is when
@@ -826,7 +826,7 @@ provides the GNU compiler for the Go programming language."))
   (custom-gcc gcc-10 "gcc-objc" '("objc")
               %objc-search-paths))
 
-(define-public gcc-objc gcc-objc-7)
+(define-public gcc-objc gcc-objc-9)
 
 (define %objc++-search-paths
   (list (search-path-specification
@@ -868,7 +868,7 @@ provides the GNU compiler for the Go programming language."))
   (custom-gcc gcc-10 "gcc-objc++" '("obj-c++")
               %objc++-search-paths))
 
-(define-public gcc-objc++ gcc-objc++-7)
+(define-public gcc-objc++ gcc-objc++-9)
 
 (define (make-libstdc++-doc gcc)
   "Return a package with the libstdc++ documentation for GCC."
-- 
2.29.1





Information forwarded to guix-patches <at> gnu.org:
bug#44440; Package guix-patches. (Wed, 04 Nov 2020 13:37:03 GMT) Full text and rfc822 format available.

Message #8 received at 44440 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 44440 <at> debbugs.gnu.org
Subject: [WIP PATCH 2/2] gnu: bdb: Fix building with GCC 9.
Date: Wed,  4 Nov 2020 14:36:30 +0100
* 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 <at> flashner.co.il>
 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke <at> fastmail.com>
 ;;; Copyright © 2018 Mark H Weaver <mhw <at> netris.org>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#44440; Package guix-patches. (Tue, 10 Nov 2020 22:22:02 GMT) Full text and rfc822 format available.

Message #11 received at 44440 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 44440 <at> debbugs.gnu.org
Subject: Re: [bug#44440] [WIP PATCH 1/2] gnu: Use GCC 9 as the default
 compiler.
Date: Tue, 10 Nov 2020 23:21:13 +0100
Hi Jakub,

Jakub Kądziołka <kuba <at> kadziolka.net> skribis:

> this short patchstack switches the default toolchain to GCC 9 and fixes
> enough to get hello to compile.
>
> If my memory is correct, one of the cross-compiling target still breaks.
> I'm not interested in trying to figure out why, so I'm sending the WIP
> patches your way.

Thanks for sharing!  I’ll give it a spin on ‘core-updates’ soonish if
nobody beats me at it.

Ludo’.

PS: Congrats for getting #44440! :-)




Reply sent to Marius Bakke <marius <at> gnu.org>:
You have taken responsibility. (Wed, 16 Dec 2020 23:20:01 GMT) Full text and rfc822 format available.

Notification sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
bug acknowledged by developer. (Wed, 16 Dec 2020 23:20:01 GMT) Full text and rfc822 format available.

Message #16 received at 44440-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>,
 44440-done <at> debbugs.gnu.org
Subject: Re: [bug#44440] [WIP PATCH 2/2] gnu: bdb: Fix building with GCC 9.
Date: Thu, 17 Dec 2020 00:19:17 +0100
[Message part 1 (text/plain, inline)]
Jakub Kądziołka <kuba <at> kadziolka.net> skriver:

> * 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.

I pushed this patch in 04496dc5743d54134405c604ca863ce913283a0e.  The
incomplete GCC 9 patch will be dropped in favor of a switch to GCC 10;
closing this issue.

Thanks!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Jan 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.