guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: glibc@2.31: Fix build error.


From: guix-commits
Subject: 01/03: gnu: glibc@2.31: Fix build error.
Date: Wed, 8 Sep 2021 15:46:45 -0400 (EDT)

civodul pushed a commit to branch core-updates-frozen
in repository guix.

commit 6d8c1a5e2302d8c1223ea9a4da44975931bad383
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Sep 8 16:07:48 2021 +0200

    gnu: glibc@2.31: Fix build error.
    
    * gnu/packages/patches/glibc-skip-c++.patch: New file.
    * gnu/packages/base.scm (glibc-2.31)[source]: Use it.
    * gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                              |  1 +
 gnu/packages/base.scm                     |  1 +
 gnu/packages/patches/glibc-skip-c++.patch | 31 +++++++++++++++++++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 2b21455..07e6787 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1146,6 +1146,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/glibc-locales.patch                     \
   %D%/packages/patches/glibc-locales-2.28.patch                        \
   %D%/packages/patches/glibc-reinstate-prlimit64-fallback.patch        \
+  %D%/packages/patches/glibc-skip-c++.patch                    \
   %D%/packages/patches/glibc-versioned-locpath.patch           \
   %D%/packages/patches/glibc-2.29-git-updates.patch            \
   %D%/packages/patches/glibc-2.29-supported-locales.patch      \
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 4a8fabf..695a056 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -946,6 +946,7 @@ with the Linux kernel.")
                (base32
                 "05zxkyz9bv3j9h0xyid1rhvh3klhsmrpkf3bcs6frvlgyr2gwilj"))
               (patches (search-patches
+                        "glibc-skip-c++.patch"
                         "glibc-ldd-powerpc.patch"
                         "glibc-ldd-x86_64.patch"
                         "glibc-dl-cache.patch"
diff --git a/gnu/packages/patches/glibc-skip-c++.patch 
b/gnu/packages/patches/glibc-skip-c++.patch
new file mode 100644
index 0000000..b2cbe76
--- /dev/null
+++ b/gnu/packages/patches/glibc-skip-c++.patch
@@ -0,0 +1,31 @@
+When building, say, glibc 2.31 using a compiler that's itself linked
+against 2.33, linking fails with:
+
+  gcc 
-Wl,-rpath-link=/tmp/guix-build-glibc-2.31.drv-0/build:/tmp/guix-build-glibc-2.31.drv-0/build/math:/tmp/guix-build-glibc-2.31.drv-0/build/elf:/tmp/guix-build-glibc-2.31.drv-0/build/dlfcn:/tmp/guix-build-glibc-2.31.drv-0/build/nss:/tmp/guix-build-glibc-2.31.drv-0/build/nis:/tmp/guix-build-glibc-2.31.drv-0/build/rt:/tmp/guix-build-glibc-2.31.drv-0/build/resolv:/tmp/guix-build-glibc-2.31.drv-0/build/mathvec:/tmp/guix-build-glibc-2.31.drv-0/build/support:/tmp/guix-build-glibc-2.31.drv-
 [...]
+  ld: 
/gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so:
 undefined reference to `fstat64@GLIBC_2.33'
+  ld: 
/gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so:
 undefined reference to `lstat@GLIBC_2.33'
+  ld: 
/gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so:
 undefined reference to `stat@GLIBC_2.33'
+  collect2: error: ld returned 1 exit status
+
+This is unsurprising given that libstdc++.so here is linked against 2.33,
+whereas libc.so.6 here is 2.31.
+
+This patch works around it by not building the offending program.
+
+diff --git a/support/Makefile b/support/Makefile
+index bb9889ef..6614943b 100644
+--- a/support/Makefile
++++ b/support/Makefile
+@@ -210,12 +210,7 @@ CFLAGS-support_paths.c = \
+ # -fexcess-precision=standard.
+ CFLAGS-timespec.c += -fexcess-precision=standard
+ 
+-ifeq (,$(CXX))
+ LINKS_DSO_PROGRAM = links-dso-program-c
+-else
+-LINKS_DSO_PROGRAM = links-dso-program
+-LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
+-endif
+ 
+ ifeq (yes,$(have-selinux))
+ LDLIBS-$(LINKS_DSO_PROGRAM) += -lselinux



reply via email to

[Prev in Thread] Current Thread [Next in Thread]