GNU bug report logs - #47615
[PATCH 0/9] Add 32-bit powerpc support

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Tue, 6 Apr 2021 12:26:02 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: guix-devel <at> gnu.org, 47615 <at> debbugs.gnu.org
Subject: [bug#47615] [PATCH 3/9] gnu: binutils: Adjust test suite on powerpc-linux.
Date: Sat, 17 Apr 2021 13:02:34 -0700
[Message part 1 (text/plain, inline)]
Chris Marusich <cmmarusich <at> gmail.com> writes:

> (define binutils-boot0
>   (package
>     (inherit binutils)
>     (source (bootstrap-origin (package-source binutils)))
>     (name "binutils-cross-boot0")
>     (arguments
>      `(#:guile ,%bootstrap-guile
>        #:implicit-inputs? #f
>
>        #:modules ((guix build gnu-build-system)
>                   (guix build utils)
>                   (ice-9 ftw))                    ; for 'scandir'
>
>        ,@(substitute-keyword-arguments (package-arguments binutils)
>            ((#:configure-flags cf)
>             `(cons ,(string-append "--target=" (boot-triplet))
>                    ,cf))
>            ;; The presence of '%standard-phases as the default value here is
>            ;; important.  It ensures that even when (package-argument
>            ;; binutils) does not already contain the #:phases keyword
>            ;; argument, the substitution will occur.  If you omit a default
>            ;; value and (package-arguments binutils) does not contain the
>            ;; #:phases keyword argument (e.g., on an x86_64-linux system),
>            ;; then the substitution will not occur, and no phases at all will
>            ;; be added.
>            ((#:phases phases '%standard-phases)
>             `(modify-phases ,phases
>                ,@(if (string=? (%current-system) "powerpc-linux")
>                      '((add-after 'unpack 'disable-rust-libiberty-test
>                          (lambda _
>                            (substitute* "libiberty/testsuite/Makefile.in"
>                              ((" check-rust-demangle ") ""))
>                            #t)))
>                      '())
>                (add-after 'install 'add-symlinks
>                  (lambda* (#:key outputs #:allow-other-keys)
>                    ;; The cross-gcc invokes 'as', 'ld', etc, without the
>                    ;; triplet prefix, so add symlinks.
>                    (let ((out (assoc-ref outputs "out"))
>                          (triplet-prefix (string-append ,(boot-triplet) "-")))
>                      (define (has-triplet-prefix? name)
>                        (string-prefix? triplet-prefix name))
>                      (define (remove-triplet-prefix name)
>                        (substring name (string-length triplet-prefix)))
>                      (with-directory-excursion (string-append out "/bin")
>                        (for-each
>                         (lambda (name)
>                           (symlink name (remove-triplet-prefix name)))
>                         (scandir "." has-triplet-prefix?)))))))))))
>
>     (inputs (%boot0-inputs))))

Sorry, I meant to write this instead:

(define binutils-boot0
  (package
    (inherit binutils)
    (source (bootstrap-origin (package-source binutils)))
    (name "binutils-cross-boot0")
    (arguments
     `(#:guile ,%bootstrap-guile
       #:implicit-inputs? #f

       #:modules ((guix build gnu-build-system)
                  (guix build utils)
                  (ice-9 ftw))                    ; for 'scandir'

       ,@(substitute-keyword-arguments (package-arguments binutils)
           ((#:configure-flags cf)
            `(cons ,(string-append "--target=" (boot-triplet))
                   ,cf))
           ;; The presence of '%standard-phases as the default value here is
           ;; important.  It ensures that even when (package-argument
           ;; binutils) does not already contain the #:phases keyword
           ;; argument, the substitution will occur.  If you omit a default
           ;; value and (package-arguments binutils) does not contain the
           ;; #:phases keyword argument (e.g., on an x86_64-linux system),
           ;; then the substitution will not occur, and no phases at all will
           ;; be added.
           ((#:phases phases '%standard-phases)
            `(modify-phases ,phases
               (add-after 'install 'add-symlinks
                 (lambda* (#:key outputs #:allow-other-keys)
                   ;; The cross-gcc invokes 'as', 'ld', etc, without the
                   ;; triplet prefix, so add symlinks.
                   (let ((out (assoc-ref outputs "out"))
                         (triplet-prefix (string-append ,(boot-triplet) "-")))
                     (define (has-triplet-prefix? name)
                       (string-prefix? triplet-prefix name))
                     (define (remove-triplet-prefix name)
                       (substring name (string-length triplet-prefix)))
                     (with-directory-excursion (string-append out "/bin")
                       (for-each
                        (lambda (name)
                          (symlink name (remove-triplet-prefix name)))
                        (scandir "." has-triplet-prefix?)))))))))))

    (inputs (%boot0-inputs))))

The point is that we can probably "inherit" the phases, so we wouldn't
have to repeat ourselves.

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

This bug report was last modified 4 years and 54 days ago.

Previous Next


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