unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: 47182@debbugs.gnu.org
Cc: Leo Le Bouter <lle-bout@zaclys.net>,
	Chris Marusich <cmmarusich@gmail.com>,
	Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#47182] [PATCH 04/18] gnu: glibc: Fix ldd path on powerpc*.
Date: Mon, 15 Mar 2021 23:44:57 -0700	[thread overview]
Message-ID: <20210316064511.2891553-4-cmmarusich@gmail.com> (raw)
In-Reply-To: <20210316064511.2891553-1-cmmarusich@gmail.com>

From: Leo Le Bouter <lle-bout@zaclys.net>

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 <cmmarusich@gmail.com>
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
---
 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 cf8849cf598..4bd333e56f2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1120,6 +1120,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 9aa69cfe773..7c5ac61f01c 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2016, 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016, 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
@@ -15,6 +15,8 @@
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Vitaliy Shatrov <D0dyBo0D0dyBo0@protonmail.com>
+;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
 ;;;
 ;;; 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 432910d7a30..93b0c508822 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 00000000000..8e899ee99b8
--- /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"_
+ 
-- 
2.26.2





  parent reply	other threads:[~2021-03-16  6:48 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  6:28 [bug#47182] [PATCH 00/18] Add support for powerpc64le-linux (wip-ppc64le-for-master) Chris Marusich
2021-03-16  6:44 ` [bug#47182] [PATCH 01/18] gnu: bootstrap: Add support for powerpc64le-linux Chris Marusich
2021-03-16  6:44   ` [bug#47182] [PATCH 02/18] utils: Add target-powerpc? procedure Chris Marusich
2021-03-16  6:44   ` [bug#47182] [PATCH 03/18] gnu: gcc-4.7: On powerpc64le, fix /lib64 references Chris Marusich
2021-03-16  6:44   ` Chris Marusich [this message]
2021-03-16  7:45     ` [bug#47182] [PATCH 04/18] gnu: glibc: Fix ldd path on powerpc* Efraim Flashner
2021-03-16  6:44   ` [bug#47182] [PATCH 05/18] gnu: gcc-boot0: Enable 128-bit long double for POWER9 Chris Marusich
2021-03-16  6:44   ` [bug#47182] [PATCH 06/18] gnu: binutils-final: Provide bash for binary on powerpc-linux Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 07/18] gnu: binutils-final: Support more Power architectures Chris Marusich
2021-03-16  7:49     ` Efraim Flashner
2021-03-18  6:10       ` [bug#47182] [PATCH 00/18] Add support for powerpc64le-linux (wip-ppc64le-for-master) Chris Marusich
2021-03-18  8:29         ` Efraim Flashner
2021-03-16  6:45   ` [bug#47182] [PATCH 08/18] gnu: bdb-4.8: Fix configure on powerpc64le-linux Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 09/18] gnu: guile-avahi: Fix compilation " Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 10/18] gnu: texlive-bin: Fix compilation on powerpc64le* Chris Marusich
2021-03-16  7:53     ` Efraim Flashner
2021-03-18  6:16       ` [bug#47182] [PATCH 00/18] Add support for powerpc64le-linux (wip-ppc64le-for-master) Chris Marusich
2021-03-18  8:34         ` Efraim Flashner
2021-03-19  6:22           ` Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 11/18] gnu: texlive-latex-base: Fix compilation on powerpc64le* Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 12/18] gnu: libelf: Fix compilation for powerpc64le-linux Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 13/18] Add powerpc64le-linux as a supported Guix architecture Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 14/18] syscalls: Fix clone on powerpc64le-linux Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 15/18] syscalls: Fix RNDADDTOENTCNT " Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 16/18] ci: %cross-targets: Add powerpc64le-linux-gnu Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 17/18] utils: Fix target-64bit? on powerpc64le-linux Chris Marusich
2021-03-16  6:45   ` [bug#47182] [PATCH 18/18] gnu: sed: Make it build on SELinux-enabled kernels Chris Marusich
2021-03-16  8:30   ` [bug#47182] [PATCH 01/18] gnu: bootstrap: Add support for powerpc64le-linux Chris Marusich
2021-03-16  9:33 ` [bug#47182] [PATCH 00/18] Add support for powerpc64le-linux (wip-ppc64le-for-master) Léo Le Bouter via Guix-patches via
2021-03-17  6:58   ` Chris Marusich
2021-03-17 20:33     ` Christopher Baines
2021-03-18  6:08       ` Chris Marusich
2021-03-24  6:36 ` bug#47182: Merged to master Chris Marusich

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=20210316064511.2891553-4-cmmarusich@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=47182@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    --cc=lle-bout@zaclys.net \
    /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).