aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-05-06 10:43:32 +0100
committerfanquake <fanquake@gmail.com>2022-05-12 08:21:16 +0100
commit88fd3f81ec626c363a5846089d99305a9a9b343d (patch)
treea7399dbcdd9050353aebdbde20e9135b4e0d993d /contrib
parent0e51913595c4fbe32ce9811e3ff5bcf1ed5f9ddc (diff)
downloadbitcoin-88fd3f81ec626c363a5846089d99305a9a9b343d.tar.xz
guix: use -fcommon when building glibc 2.24
GCC 10 started using -fno-common by default, which causes issues with the powerpc builds using gibc 2.24. A patch was commited to glibc to fix the issue, 18363b4f010da9ba459b13310b113ac0647c2fcc but is non-trvial to backport, and was broken in at least one way, see the followup in commit 7650321ce037302bfc2f026aa19e0213b8d02fe6. For now, retain the legacy GCC behaviour by passing -fcommon when building glibc 2.24. https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html. https://sourceware.org/git/?p=glibc.git;a=commit;h=18363b4f010da9ba459b13310b113ac0647c2fcc https://sourceware.org/git/?p=glibc.git;a=commit;h=7650321ce037302bfc2f026aa19e0213b8d02fe6
Diffstat (limited to 'contrib')
-rw-r--r--contrib/guix/manifest.scm3
-rw-r--r--contrib/guix/patches/glibc-2.24-fcommon.patch32
2 files changed, 34 insertions, 1 deletions
diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
index d930b7596b..0b585af3e0 100644
--- a/contrib/guix/manifest.scm
+++ b/contrib/guix/manifest.scm
@@ -537,7 +537,8 @@ inspecting signatures in Mach-O binaries.")
(patches (search-our-patches "glibc-ldd-x86_64.patch"
"glibc-versioned-locpath.patch"
"glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch"
- "glibc-2.24-no-build-time-cxx-header-run.patch"))))))
+ "glibc-2.24-no-build-time-cxx-header-run.patch"
+ "glibc-2.24-fcommon.patch"))))))
(define-public glibc-2.27/bitcoin-patched
(package
diff --git a/contrib/guix/patches/glibc-2.24-fcommon.patch b/contrib/guix/patches/glibc-2.24-fcommon.patch
new file mode 100644
index 0000000000..2bc32ede90
--- /dev/null
+++ b/contrib/guix/patches/glibc-2.24-fcommon.patch
@@ -0,0 +1,32 @@
+commit 264a4a0dbe1f4369db315080034b500bed66016c
+Author: fanquake <fanquake@gmail.com>
+Date: Fri May 6 11:03:04 2022 +0100
+
+ build: use -fcommon to retain legacy behaviour with GCC 10
+
+ GCC 10 started using -fno-common by default, which causes issues with
+ the powerpc builds using gibc 2.24. A patch was commited to glibc to fix
+ the issue, 18363b4f010da9ba459b13310b113ac0647c2fcc but is non-trvial
+ to backport, and was broken in at least one way, see the followup in
+ commit 7650321ce037302bfc2f026aa19e0213b8d02fe6.
+
+ For now, retain the legacy GCC behaviour by passing -fcommon when
+ building glibc.
+
+ https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html.
+ https://sourceware.org/git/?p=glibc.git;a=commit;h=18363b4f010da9ba459b13310b113ac0647c2fcc
+ https://sourceware.org/git/?p=glibc.git;a=commit;h=7650321ce037302bfc2f026aa19e0213b8d02fe6
+
+diff --git a/Makeconfig b/Makeconfig
+index ee379f5852..63c4a2f234 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -824,7 +824,7 @@ ifeq "$(strip $(+cflags))" ""
+ +cflags := $(default_cflags)
+ endif # $(+cflags) == ""
+
+-+cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags)
+++cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) -fcommon
+ +gcc-nowarn := -w
+
+ # Don't duplicate options if we inherited variables from the parent.