From 6e98e9ca9237eb6a9830e9c65006a3ca534c94d0 Mon Sep 17 00:00:00 2001 From: Leo Le Bouter Date: Sat, 6 Feb 2021 20:02:31 +0100 Subject: gnu: glibc: Fix ldd path on powerpc*. This should avoid some problems, such as "not a dynamic executable" errors. * gnu/packages/patches/glibc-ldd-powerpc.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/base.scm: (glibc)[native-inputs]: Add it. [arguments]: When building for powerpc* apply it. * gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash, glibc-final)[native-inputs]: Add patch conditionally. This patch has been adjusted to apply to master. Signed-off-by: Chris Marusich Signed-off-by: Efraim Flashner --- gnu/local.mk | 1 + gnu/packages/base.scm | 16 +++++++++++++++- gnu/packages/commencement.scm | 10 +++++++++- gnu/packages/patches/glibc-ldd-powerpc.patch | 10 ++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/glibc-ldd-powerpc.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7891c58dfa..14d228cfa4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1121,6 +1121,7 @@ dist_patch_DATA = \ %D%/packages/patches/glibc-hurd-mach-print.patch \ %D%/packages/patches/glibc-hurd-magic-pid.patch \ %D%/packages/patches/glibc-hurd-signal-sa-siginfo.patch \ + %D%/packages/patches/glibc-ldd-powerpc.patch \ %D%/packages/patches/glibc-ldd-x86_64.patch \ %D%/packages/patches/glibc-locales.patch \ %D%/packages/patches/glibc-locales-2.28.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 9aa69cfe77..7c5ac61f01 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver ;;; Copyright © 2014 Alex Kost ;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis -;;; Copyright © 2016, 2017, 2019, 2020 Efraim Flashner +;;; Copyright © 2016, 2017, 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2016, 2018 Alex Vong ;;; Copyright © 2017 Rene Saavedra @@ -15,6 +15,8 @@ ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; Copyright © 2020 Vitaliy Shatrov +;;; Copyright © 2020 Chris Marusich +;;; Copyright © 2021 Leo Le Bouter ;;; ;;; This file is part of GNU Guix. ;;; @@ -890,6 +892,14 @@ the store.") files))) #t))) + ,@(if (target-powerpc?) + '((add-after 'unpack 'apply-patch + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch (assoc-ref inputs + "powerpc64le-patch"))) + (invoke "patch" "--force" "-p1" + "-i" patch))))) + '()) ,@(if (hurd-target?) '((add-after 'install 'augment-libc.so (lambda* (#:key outputs #:allow-other-keys) @@ -911,6 +921,10 @@ the store.") ("gettext" ,gettext-minimal) ("python" ,python-minimal) + ,@(if (target-powerpc?) + `(("powerpc64le-patch" ,@(search-patches + "glibc-ldd-powerpc.patch"))) + '()) ,@(if (hurd-target?) `(("mig" ,mig) ("perl" ,perl)) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 432910d7a3..93b0c50882 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3313,7 +3313,11 @@ memoized as a function of '%current-system'." `(("bison" ,bison-boot0) ("texinfo" ,texinfo-boot0) ("perl" ,perl-boot0) - ("python" ,python-boot0))) + ("python" ,python-boot0) + ,@(if (target-powerpc?) + `(("powerpc64le-patch" ,@(search-patches + "glibc-ldd-powerpc.patch"))) + '()))) (inputs `( ;; The boot inputs. That includes the bootstrap libc. We don't want ;; it in $CPATH, hence the 'pre-configure' phase above. @@ -3464,6 +3468,10 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; This time we need 'msgfmt' to install all the libc.mo files. (native-inputs `(,@(package-native-inputs glibc-final-with-bootstrap-bash) + ,@(if (target-powerpc?) + `(("powerpc64le-patch" ,@(search-patches + "glibc-ldd-powerpc.patch"))) + '()) ("gettext" ,gettext-boot0))) (propagated-inputs diff --git a/gnu/packages/patches/glibc-ldd-powerpc.patch b/gnu/packages/patches/glibc-ldd-powerpc.patch new file mode 100644 index 0000000000..8e899ee99b --- /dev/null +++ b/gnu/packages/patches/glibc-ldd-powerpc.patch @@ -0,0 +1,10 @@ +diff -r -U3 a/sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed +--- a/sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed 1970-01-01 01:00:00.000000000 +0100 ++++ b/sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed 2020-02-29 00:15:41.080000000 +0100 +@@ -11,5 +11,5 @@ + # this works for /lib64/ld64.so.x and /lib/ld.so.x as input + s_lib64_lib_ + s_64\.so_\.so_ +-s_^RTLDLIST=\(.*lib\)\(/[^/]*\)\(\.so\.[0-9.]*\)[[:blank:]]*$_RTLDLIST="\1\2\3 \164\264\3"_ ++s_^RTLDLIST=\(.*lib\)\(/[^/]*\)\(\.so\.[0-9.]*\)[[:blank:]]*$_RTLDLIST="\1\2\3 \1\264\3"_ + -- cgit 1.4.1