GNU bug report logs - #47349
[PATCH] gnu: cross-base: Relax check for powerpc64le

Previous Next

Package: guix-patches;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Tue, 23 Mar 2021 16:05:02 UTC

Severity: normal

Tags: patch

Done: Carl Dong <contact <at> carldong.me>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47349 in the body.
You can then email your comments to 47349 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47349; Package guix-patches. (Tue, 23 Mar 2021 16:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Dong <contact <at> carldong.me>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 23 Mar 2021 16:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <contact <at> carldong.me>
To: guix-patches <at> gnu.org
Cc: Carl Dong <contact <at> carldong.me>
Subject: [PATCH] gnu: cross-base: Relax check for powerpc64le
Date: Tue, 23 Mar 2021 12:02:13 -0400
The canonical triplet for powerpc64le-linux-gnu is actually
powerpc64le-unknown-linux-gnu, we should relax our matching here.

* gnu/packages/cross-base.scm (cross-gcc-arguments): Check for
"powerpc64le-" prefix for "--with-long-double-128" instead of matching
full target.
---
 gnu/packages/cross-base.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index bea2d69876..180594509b 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -153,7 +153,7 @@ base compiler and using LIBC (which may be either a libc package or #f.)"
                                "--disable-decimal-float" ;would need libc
                                "--disable-libcilkrts"
 
-                              ,@(if (equal? "powerpc64le-linux-gnu" target)
+                              ,@(if (string-prefix? "powerpc64le-" target)
                                    ;; On POWER9 (little endian) glibc needs
                                    ;; the 128-bit long double type.
                                    '("--with-long-double-128")
-- 
2.30.1





Information forwarded to guix-patches <at> gnu.org:
bug#47349; Package guix-patches. (Thu, 25 Mar 2021 16:10:03 GMT) Full text and rfc822 format available.

Message #8 received at 47349 <at> debbugs.gnu.org (full text, mbox):

From: Léo Le Bouter <lle-bout <at> zaclys.net>
To: 47349 <at> debbugs.gnu.org
Cc: Chris Marusich <cmmarusich <at> gmail.com>
Subject: [PATCH] gnu: cross-base: Relax check for powerpc64le
Date: Thu, 25 Mar 2021 17:09:30 +0100
[Message part 1 (text/plain, inline)]
LGTM!

But also wait for marusich's input.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47349; Package guix-patches. (Fri, 26 Mar 2021 06:28:01 GMT) Full text and rfc822 format available.

Message #11 received at 47349 <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Carl Dong <contact <at> carldong.me>
Cc: 47349 <at> debbugs.gnu.org
Subject: Re: bug#47349: [PATCH] gnu: cross-base: Relax check for powerpc64le
Date: Thu, 25 Mar 2021 23:27:06 -0700
[Message part 1 (text/plain, inline)]
Hi people,

Carl Dong <contact <at> carldong.me> writes:

> * gnu/packages/cross-base.scm (cross-gcc-arguments): Check for
> "powerpc64le-" prefix for "--with-long-double-128" instead of matching
> full target.

This patch looks good to me.  I confirmed it doesn't rebuild the world.
We can apply it to master.  I will do this in the next few days unless
somebody else has further comments on this patch specifically.

While reviewing this patch, I noticed that surprisingly, we do not use
--with-long-double in the following places:

- The gcc package (a GCC v7.5.0 native compiler) on powerpc64le-linux
  systems.

- The gcc-final package (a GCC v7.5.0 native compiler) on
  powerpc64le-linux systems.

- The %bootstrap-gcc package (a GCC v5.5.0 native compiler) on
  powerpc64le-linux systems.

- The %gcc-static package (a GCC v5.5.0 native compiler), when
  cross-compiled for the powerpc64le-linux-gnu target on an x86_64-linux
  system.  (Note that this is actually the same GCC that on
  powerpc64le-linux systems is known as %bootstrap-gcc.)

Obviously, %bootstrap-gcc is good enough to build gcc-final, and
gcc-final is good enough to build various things, including GNU Hello
and GNU Guix itself.  We have verified this.  However, Leo, do you think
it would be a good idea to add --with-long-double to the gcc and
gcc-final package definitions on powerpc64le-linux, anyway?  Perhaps it
actually is needed, but we just haven't yet encountered the problems
that it would solve.  What do you think, Leo?

You can inspect the packages to see this yourself, but you can also ask
Guix to tell you about the configure options.  Here is what Guix says
about the configure options for the gcc and gcc-final packages on a
powerpc64le-linux system using commit
b0eb525ddba77420ff8c0930b9173b10f9ae342d:

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,pp (bag-arguments (package->bag (@ (gnu packages gcc) gcc)))
$3 = (#:system
 "powerpc64le-linux"
 #:out-of-source?
 #t
 #:configure-flags
 `("--enable-plugin"
   "--enable-languages=c,c++"
   "--disable-multilib"
   "--with-system-zlib"
   "--disable-libstdcxx-pch"
   "--with-local-prefix=/no-gcc-local-prefix"
   ,(string-append
      "--with-gxx-include-dir="
      (assoc-ref %outputs "out")
      "/include/c++")
   ,(let ((libc (assoc-ref %build-inputs "libc")))
      (if libc
        (string-append
          "--with-native-system-header-dir="
          libc
          "/include")
        "--without-headers")))
 #:make-flags
 (let* ((libc (assoc-ref %build-inputs "libc"))
        (libc-native
          (or (assoc-ref %build-inputs "libc-native") libc)))
   `(,@(if libc
         (list (string-append
                 "LDFLAGS_FOR_TARGET="
                 "-B"
                 libc
                 "/lib "
                 "-Wl,-dynamic-linker "
                 "-Wl,"
                 libc
                 "/lib/ld64.so.2"))
         '())
     ,(string-append
        "LDFLAGS="
        "-Wl,-rpath="
        libc-native
        "/lib "
        "-Wl,-dynamic-linker "
        "-Wl,"
        libc-native
        "/lib/ld64.so.2")
     ,(string-append "BOOT_CFLAGS=-O2 " "-g0")))
 #:tests?
 #f
 #:phases
 (modify-phases
   %standard-phases
   (add-before
     'configure
     'pre-configure
     (lambda* (#:key inputs outputs #:allow-other-keys)
       (let ((libdir
               (or (assoc-ref outputs "lib")
                   (assoc-ref outputs "out")))
             (libc (assoc-ref inputs "libc")))
         (when libc
               (for-each
                 (lambda (x)
                   (substitute*
                     (find-files
                       "gcc/config"
                       "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
                     (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$"
                       _
                       line)
                      line)))
                 '(1 2 3))
               (substitute*
                 (find-files
                   "gcc/config"
                   "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
                 (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
                   _
                   gnu-user
                   suffix)
                  (format
                    #f
                    "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
                    gnu-user
                    suffix
                    (string-append libc "/lib/ld64.so.2"))))
               (substitute*
                 (find-files "gcc/config" "^gnu-user.*\\.h$")
                 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$"
                   _
                   suffix)
                  (format
                    #f
                    "#define GNU_USER_TARGET_LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
                    libc
                    libc
                    libdir
                    suffix))
                 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$"
                   line)
                  (format
                    #f
                    "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
                    libc
                    line)))
               (substitute*
                 "gcc/config/rs6000/sysv4.h"
                 (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
                  (format
                    #f
                    "#define LIB_LINUX_SPEC \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
                    libc
                    libc
                    libdir
                    suffix))
                 (("#define\tSTARTFILE_LINUX_SPEC.*$" line)
                  (format
                    #f
                    "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
                    libc
                    line))))
         (when (file-exists? "gcc/config/rs6000")
               (substitute*
                 (find-files "gcc/config/rs6000")
                 (("/lib64") "/lib")))
         (substitute*
           "fixincludes/fixincl.x"
           (("static char const sed_cmd_z\\[\\] =.*;")
            "static char const sed_cmd_z[] = \"sed\";"))
         (when (file-exists? "gcc/config/aarch64")
               (substitute*
                 "gcc/config/aarch64/t-aarch64-linux"
                 (("lib64") "lib")))
         (when (file-exists? "libbacktrace")
               (substitute*
                 "libbacktrace/configure"
                 (("WARN_FLAGS=(.*)-Werror" _ flags)
                  (string-append "WARN_FLAGS=" flags)))
               (when (file-exists? "libsanitizer/libbacktrace")
                     (substitute*
                       "libsanitizer/libbacktrace/Makefile.in"
                       (("-Werror") ""))))
         (substitute*
           "libstdc++-v3/src/Makefile.in"
           (("^OPT_LDFLAGS = ")
            "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
         (substitute*
           "libstdc++-v3/python/Makefile.in"
           (("pythondir = .*$")
            (string-append
              "pythondir = "
              libdir
              "/share"
              "/gcc-$(gcc_version)/python\n")))
         (substitute*
           "gcc/config.in"
           (("PREFIX_INCLUDE_DIR")
            "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
         #t)))
   (add-after
     'configure
     'post-configure
     (lambda _
       (substitute*
         "Makefile"
         (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
          "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
       #t))))
scheme@(guix-user)> ,pp (bag-arguments (package->bag (@@ (gnu packages commencement) gcc-final)))
$4 = (#:system
 "powerpc64le-linux"
 #:guile
 #<package guile-bootstrap <at> 2.0 gnu/packages/bootstrap.scm:478 7fff75bdcf00>
 #:allowed-references
 ("out"
  "lib"
  #<package zlib <at> 1.2.11 gnu/packages/commencement.scm:3562 7fff692745a0>
  #<package glibc <at> 2.31 gnu/packages/commencement.scm:3462 7fff69274820>
  #<package bash-static <at> 5.0.16 gnu/packages/commencement.scm:3402 7fff69274960>)
 #:validate-runpath?
 #f
 #:out-of-source?
 #t
 #:configure-flags
 `("--enable-plugin"
   "--enable-languages=c,c++"
   "--disable-multilib"
   "--with-system-zlib"
   "--disable-libstdcxx-pch"
   "--with-local-prefix=/no-gcc-local-prefix"
   ,(string-append
      "--with-gxx-include-dir="
      (assoc-ref %outputs "out")
      "/include/c++")
   ,(let ((libc (assoc-ref %build-inputs "libc")))
      (if libc
        (string-append
          "--with-native-system-header-dir="
          libc
          "/include")
        "--without-headers")))
 #:make-flags
 (let ((zlib (assoc-ref %build-inputs "zlib")))
   (map (lambda (flag)
          (if (string-prefix? "LDFLAGS=" flag)
            (string-append
              flag
              " -L"
              (assoc-ref %build-inputs "libstdc++")
              "/lib -L"
              zlib
              "/lib -Wl,-rpath="
              zlib
              "/lib")
            flag))
        (let* ((libc (assoc-ref %build-inputs "libc"))
               (libc-native
                 (or (assoc-ref %build-inputs "libc-native") libc)))
          `(,@(if libc
                (list (string-append
                        "LDFLAGS_FOR_TARGET="
                        "-B"
                        libc
                        "/lib "
                        "-Wl,-dynamic-linker "
                        "-Wl,"
                        libc
                        "/lib/ld64.so.2"))
                '())
            ,(string-append
               "LDFLAGS="
               "-Wl,-rpath="
               libc-native
               "/lib "
               "-Wl,-dynamic-linker "
               "-Wl,"
               libc-native
               "/lib/ld64.so.2")
            ,(string-append "BOOT_CFLAGS=-O2 " "-g0")))))
 #:tests?
 #f
 #:phases
 (modify-phases
   (modify-phases
     %standard-phases
     (add-before
       'configure
       'pre-configure
       (lambda* (#:key inputs outputs #:allow-other-keys)
         (let ((libdir
                 (or (assoc-ref outputs "lib")
                     (assoc-ref outputs "out")))
               (libc (assoc-ref inputs "libc")))
           (when libc
                 (for-each
                   (lambda (x)
                     (substitute*
                       (find-files
                         "gcc/config"
                         "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
                       (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$"
                         _
                         line)
                        line)))
                   '(1 2 3))
                 (substitute*
                   (find-files
                     "gcc/config"
                     "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
                   (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
                     _
                     gnu-user
                     suffix)
                    (format
                      #f
                      "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
                      gnu-user
                      suffix
                      (string-append libc "/lib/ld64.so.2"))))
                 (substitute*
                   (find-files "gcc/config" "^gnu-user.*\\.h$")
                   (("#define GNU_USER_TARGET_LIB_SPEC (.*)$"
                     _
                     suffix)
                    (format
                      #f
                      "#define GNU_USER_TARGET_LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
                      libc
                      libc
                      libdir
                      suffix))
                   (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$"
                     line)
                    (format
                      #f
                      "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
                      libc
                      line)))
                 (substitute*
                   "gcc/config/rs6000/sysv4.h"
                   (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
                    (format
                      #f
                      "#define LIB_LINUX_SPEC \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
                      libc
                      libc
                      libdir
                      suffix))
                   (("#define\tSTARTFILE_LINUX_SPEC.*$" line)
                    (format
                      #f
                      "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
                      libc
                      line))))
           (when (file-exists? "gcc/config/rs6000")
                 (substitute*
                   (find-files "gcc/config/rs6000")
                   (("/lib64") "/lib")))
           (substitute*
             "fixincludes/fixincl.x"
             (("static char const sed_cmd_z\\[\\] =.*;")
              "static char const sed_cmd_z[] = \"sed\";"))
           (when (file-exists? "gcc/config/aarch64")
                 (substitute*
                   "gcc/config/aarch64/t-aarch64-linux"
                   (("lib64") "lib")))
           (when (file-exists? "libbacktrace")
                 (substitute*
                   "libbacktrace/configure"
                   (("WARN_FLAGS=(.*)-Werror" _ flags)
                    (string-append "WARN_FLAGS=" flags)))
                 (when (file-exists? "libsanitizer/libbacktrace")
                       (substitute*
                         "libsanitizer/libbacktrace/Makefile.in"
                         (("-Werror") ""))))
           (substitute*
             "libstdc++-v3/src/Makefile.in"
             (("^OPT_LDFLAGS = ")
              "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
           (substitute*
             "libstdc++-v3/python/Makefile.in"
             (("pythondir = .*$")
              (string-append
                "pythondir = "
                libdir
                "/share"
                "/gcc-$(gcc_version)/python\n")))
           (substitute*
             "gcc/config.in"
             (("PREFIX_INCLUDE_DIR")
              "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
           #t)))
     (add-after
       'configure
       'post-configure
       (lambda _
         (substitute*
           "Makefile"
           (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
            "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
         #t)))
   (add-after
     'unpack
     'unpack-gmp&co
     (lambda* (#:key inputs #:allow-other-keys)
       (let ((gmp (assoc-ref %build-inputs "gmp-source"))
             (mpfr (assoc-ref %build-inputs "mpfr-source"))
             (mpc (assoc-ref %build-inputs "mpc-source")))
         (for-each
           (lambda (source) (invoke "tar" "xvf" source))
           (list gmp mpfr mpc))
         (symlink "gmp-6.0.0" "gmp")
         (symlink "mpfr-4.0.2" "mpfr")
         (symlink "mpc-1.1.0" "mpc")
         #t)))))
scheme@(guix-user)>
--8<---------------cut here---------------end--------------->8---

And here is what Guix says about the configure options for %gcc-static,
when cross-compiled for powerpc64le-linux-gnu on an x86_64-linux system
using commit 662e7e28d576ada91fc9dec7d27c100666114f03, which is the one
we used to build the powerpc64le-linux bootstrap binaries:

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> package->bag
$1 = #<procedure package->bag (package #:optional system target #:key graft?)>
scheme@(guix-user)> ,pp (bag-arguments (package->bag (@@ (gnu packages make-bootstrap) %gcc-static) "x86_64-linux" "powerpc64le-linux-gnu"))
$2 = (#:system
 "x86_64-linux"
 #:target
 "powerpc64le-linux-gnu"
 #:modules
 ((srfi srfi-1)
  (srfi srfi-26)
  (ice-9 regex)
  (guix build gnu-build-system)
  (guix build utils)
  (guix build gremlin)
  (guix elf))
 #:out-of-source?
 #t
 #:configure-flags
 (append
   (list "--disable-bootstrap"
         "--with-stage1-ldflags=-static"
         "--enable-languages=c,c++"
         "--disable-lto"
         "--disable-shared"
         "--disable-plugin"
         "--disable-libmudflap"
         "--disable-libatomic"
         "--disable-libsanitizer"
         "--disable-libitm"
         "--disable-libgomp"
         "--disable-libcilkrts"
         "--disable-libvtv"
         "--disable-libssp"
         "--disable-libquadmath")
   (remove
     (cut string-match
          "--(.*plugin|enable-languages)"
          <>)
     `("--enable-plugin"
       "--enable-languages=c,c++"
       "--disable-multilib"
       "--with-system-zlib"
       "--disable-libstdcxx-pch"
       "--with-local-prefix=/no-gcc-local-prefix"
       ,(string-append
          "--with-gxx-include-dir="
          (assoc-ref %outputs "out")
          "/include/c++")
       ,(let ((libc (assoc-ref %build-inputs "libc")))
          (if libc
            (string-append
              "--with-native-system-header-dir="
              libc
              "/include")
            "--without-headers"))
       "CC_FOR_TARGET=powerpc64le-linux-gnu-gcc"
       "CXX_FOR_TARGET=powerpc64le-linux-gnu-g++"
       "LD_FOR_TARGET=powerpc64le-linux-gnu-ld"
       "AR_FOR_TARGET=powerpc64le-linux-gnu-ar"
       "NM_FOR_TARGET=powerpc64le-linux-gnu-nm"
       "OBJDUMP_FOR_TARGET=powerpc64le-linux-gnu-objdump"
       "RANLIB_FOR_TARGET=powerpc64le-linux-gnu-ranlib"
       "STRIP_FOR_TARGET=powerpc64le-linux-gnu-strip")))
 #:make-flags
 '("CFLAGS=-g0 -O2")
 #:tests?
 #f
 #:phases
 (modify-phases
   (modify-phases
     %standard-phases
     (add-before
       'configure
       'pre-configure
       (lambda* (#:key inputs outputs #:allow-other-keys)
         (let ((libdir
                 (string-append
                   (or (assoc-ref outputs "lib")
                       (assoc-ref outputs "out"))
                   "/"
                   "powerpc64le-linux-gnu"))
               (libc (assoc-ref inputs "libc")))
           (when libc
                 (for-each
                   (lambda (x)
                     (substitute*
                       (find-files
                         "gcc/config"
                         "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
                       (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$"
                         _
                         line)
                        line)))
                   '(1 2 3))
                 (substitute*
                   (find-files
                     "gcc/config"
                     "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
                   (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
                     _
                     gnu-user
                     suffix)
                    (format
                      #f
                      "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
                      gnu-user
                      suffix
                      (string-append libc "/lib/ld64.so.2"))))
                 (substitute*
                   (find-files "gcc/config" "^gnu-user.*\\.h$")
                   (("#define GNU_USER_TARGET_LIB_SPEC (.*)$"
                     _
                     suffix)
                    (format
                      #f
                      "#define GNU_USER_TARGET_LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
                      libc
                      libc
                      libdir
                      suffix))
                   (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$"
                     line)
                    (format
                      #f
                      "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
                      libc
                      line)))
                 (substitute*
                   "gcc/config/rs6000/sysv4.h"
                   (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
                    (format
                      #f
                      "#define LIB_LINUX_SPEC \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
                      libc
                      libc
                      libdir
                      suffix))
                   (("#define\tSTARTFILE_LINUX_SPEC.*$" line)
                    (format
                      #f
                      "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
                      libc
                      line))))
           (substitute*
             "fixincludes/fixincl.x"
             (("static char const sed_cmd_z\\[\\] =.*;")
              "static char const sed_cmd_z[] = \"sed\";"))
           (when (file-exists? "gcc/config/aarch64")
                 (substitute*
                   "gcc/config/aarch64/t-aarch64-linux"
                   (("lib64") "lib")))
           (when (file-exists? "libbacktrace")
                 (substitute*
                   "libbacktrace/configure"
                   (("WARN_FLAGS=(.*)-Werror" _ flags)
                    (string-append "WARN_FLAGS=" flags)))
                 (when (file-exists? "libsanitizer/libbacktrace")
                       (substitute*
                         "libsanitizer/libbacktrace/Makefile.in"
                         (("-Werror") ""))))
           (substitute*
             "libstdc++-v3/src/Makefile.in"
             (("^OPT_LDFLAGS = ")
              "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
           (substitute*
             "libstdc++-v3/python/Makefile.in"
             (("pythondir = .*$")
              (string-append
                "pythondir = "
                libdir
                "/share"
                "/gcc-$(gcc_version)/python\n")))
           (substitute*
             "gcc/config.in"
             (("PREFIX_INCLUDE_DIR")
              "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
           #t)))
     (add-after
       'configure
       'post-configure
       (lambda _
         (substitute*
           "Makefile"
           (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
            "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
         #t)))
   (add-after
     'pre-configure
     'remove-lgcc_s
     (lambda _
       (substitute*
         (cons "gcc/config/rs6000/sysv4.h"
               (find-files "gcc/config" "^gnu-user.*\\.h$"))
         ((" -lgcc_s}}") "}}"))
       #t)))
 #:guile
 #f)
scheme@(guix-user)>
--8<---------------cut here---------------end--------------->8---

As you can see, --with-long-double-128 is missing in all three cases.
And yet, the packages appear to work correctly.  I do not know why, but
I wonder if perhaps we should add --with-long-double-128 for gcc and
gcc-static on powerpc64le-linux.

A thought occurred to me: can we remove the --with-long-double-128 from
cross-base.scm and commencement.scm?  As an experiment, I have tried
removing it, and I can confirm that we do need it in both places.
Removing it from cross-base.scm breaks the ability to create
cross-compilers for the powerpc64le-linux-gnu target, and removing it
from commencement.scm breaks the ability to build essentially anything
on powerpc64le-linux.  The failure mode in both cases is similar; in any
case, we do need it in both of those places.

I just don't understand why we apparently do NOT need this option in
gcc, gcc-final, and %bootstrap-gcc on powerpc64le-linux.  Like I
said...maybe it really IS required there, too, but we just haven't
encountered any problems yet...  I don't know, and would welcome your
thoughts.

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

Information forwarded to guix-patches <at> gnu.org:
bug#47349; Package guix-patches. (Fri, 26 Mar 2021 10:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 47349 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: 47349 <at> debbugs.gnu.org, Carl Dong <contact <at> carldong.me>
Subject: Re: [bug#47349] [PATCH] gnu: cross-base: Relax check for powerpc64le
Date: Fri, 26 Mar 2021 11:31:16 +0100
Hello Chris,

I have no idea about cross compilers, but it would certainly be nice if
the final gcc supported long doubles.

As a check, you can have a look at the log file for building gmp,
obtained with "guix build --log-file gmp". If you grep for "long double",
it should contain a line
   checking for long double... yes
Hm, just "having" long double is maybe not all we want.

From the gcc documentation at https://gcc.gnu.org/install/configure.html:
--with-long-double-128
    Specify if long double type should be 128-bit by default on selected GNU/Linux architectures. If using --without-long-double-128, long double will be by default 64-bit, the same as double type. When neither of these configure options are used, the default will be 128-bit long double when built against GNU C Library 2.4 and later, 64-bit long double otherwise.

Of course we would like long double to have 128 bits, since otherwise there
is no difference with double. And at least with the current gcc and a glibc
from 2006 or later, the flag should not be neeed.

On my x86_64 machine, sizeof(long double) is 16 bytes with gcc <at> 10, 5 or 7.
Could you try to compile and run the trivial program
#include <stdio.h>
void main () {
   printf ("long double %i\n", sizeof (long double));
}
and see what it outputs on powerpc?

Well, while --with-long-double-128 should not be needed since it should be
the default, you may as well add it to the flags, since it is the desired
behaviour.

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#47349; Package guix-patches. (Fri, 26 Mar 2021 14:34:02 GMT) Full text and rfc822 format available.

Message #17 received at 47349 <at> debbugs.gnu.org (full text, mbox):

From: Léo Le Bouter <lle-bout <at> zaclys.net>
To: Chris Marusich <cmmarusich <at> gmail.com>, Carl Dong <contact <at> carldong.me>
Cc: 47349 <at> debbugs.gnu.org
Subject: Re: [bug#47349] [PATCH] gnu: cross-base: Relax check for powerpc64le
Date: Fri, 26 Mar 2021 15:33:03 +0100
[Message part 1 (text/plain, inline)]
On Thu, 2021-03-25 at 23:27 -0700, Chris Marusich wrote:
> Hi people,
> 
> Carl Dong <contact <at> carldong.me> writes:
> 
> > * gnu/packages/cross-base.scm (cross-gcc-arguments): Check for
> > "powerpc64le-" prefix for "--with-long-double-128" instead of
> > matching
> > full target.
> 
> This patch looks good to me.  I confirmed it doesn't rebuild the
> world.
> We can apply it to master.  I will do this in the next few days
> unless
> somebody else has further comments on this patch specifically.
> 
> While reviewing this patch, I noticed that surprisingly, we do not
> use
> --with-long-double in the following places:
> 
> - The gcc package (a GCC v7.5.0 native compiler) on powerpc64le-linux
>   systems.
> 
> - The gcc-final package (a GCC v7.5.0 native compiler) on
>   powerpc64le-linux systems.
> 
> - The %bootstrap-gcc package (a GCC v5.5.0 native compiler) on
>   powerpc64le-linux systems.
> 
> - The %gcc-static package (a GCC v5.5.0 native compiler), when
>   cross-compiled for the powerpc64le-linux-gnu target on an x86_64-
> linux
>   system.  (Note that this is actually the same GCC that on
>   powerpc64le-linux systems is known as %bootstrap-gcc.)
> 
> Obviously, %bootstrap-gcc is good enough to build gcc-final, and
> gcc-final is good enough to build various things, including GNU Hello
> and GNU Guix itself.  We have verified this.  However, Leo, do you
> think
> it would be a good idea to add --with-long-double to the gcc and
> gcc-final package definitions on powerpc64le-linux, anyway?  Perhaps
> it
> actually is needed, but we just haven't yet encountered the problems
> that it would solve.  What do you think, Leo?
> 
> You can inspect the packages to see this yourself, but you can also
> ask
> Guix to tell you about the configure options.  Here is what Guix says
> about the configure options for the gcc and gcc-final packages on a
> powerpc64le-linux system using commit
> b0eb525ddba77420ff8c0930b9173b10f9ae342d:
> 
> --8<---------------cut here---------------start------------->8---
> scheme@(guix-user)> ,pp (bag-arguments (package->bag (@ (gnu packages
> gcc) gcc)))
> $3 = (#:system
>  "powerpc64le-linux"
>  #:out-of-source?
>  #t
>  #:configure-flags
>  `("--enable-plugin"
>    "--enable-languages=c,c++"
>    "--disable-multilib"
>    "--with-system-zlib"
>    "--disable-libstdcxx-pch"
>    "--with-local-prefix=/no-gcc-local-prefix"
>    ,(string-append
>       "--with-gxx-include-dir="
>       (assoc-ref %outputs "out")
>       "/include/c++")
>    ,(let ((libc (assoc-ref %build-inputs "libc")))
>       (if libc
>         (string-append
>           "--with-native-system-header-dir="
>           libc
>           "/include")
>         "--without-headers")))
>  #:make-flags
>  (let* ((libc (assoc-ref %build-inputs "libc"))
>         (libc-native
>           (or (assoc-ref %build-inputs "libc-native") libc)))
>    `(,@(if libc
>          (list (string-append
>                  "LDFLAGS_FOR_TARGET="
>                  "-B"
>                  libc
>                  "/lib "
>                  "-Wl,-dynamic-linker "
>                  "-Wl,"
>                  libc
>                  "/lib/ld64.so.2"))
>          '())
>      ,(string-append
>         "LDFLAGS="
>         "-Wl,-rpath="
>         libc-native
>         "/lib "
>         "-Wl,-dynamic-linker "
>         "-Wl,"
>         libc-native
>         "/lib/ld64.so.2")
>      ,(string-append "BOOT_CFLAGS=-O2 " "-g0")))
>  #:tests?
>  #f
>  #:phases
>  (modify-phases
>    %standard-phases
>    (add-before
>      'configure
>      'pre-configure
>      (lambda* (#:key inputs outputs #:allow-other-keys)
>        (let ((libdir
>                (or (assoc-ref outputs "lib")
>                    (assoc-ref outputs "out")))
>              (libc (assoc-ref inputs "libc")))
>          (when libc
>                (for-each
>                  (lambda (x)
>                    (substitute*
>                      (find-files
>                        "gcc/config"
>                        "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
>                      (("(#define
> (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$"
>                        _
>                        line)
>                       line)))
>                  '(1 2 3))
>                (substitute*
>                  (find-files
>                    "gcc/config"
>                    "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
>                  (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^
> \t]*).*$"
>                    _
>                    gnu-user
>                    suffix)
>                   (format
>                     #f
>                     "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
>                     gnu-user
>                     suffix
>                     (string-append libc "/lib/ld64.so.2"))))
>                (substitute*
>                  (find-files "gcc/config" "^gnu-user.*\\.h$")
>                  (("#define GNU_USER_TARGET_LIB_SPEC (.*)$"
>                    _
>                    suffix)
>                   (format
>                     #f
>                     "#define GNU_USER_TARGET_LIB_SPEC \"-L~a/lib
> %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \"
> ~a"
>                     libc
>                     libc
>                     libdir
>                     suffix))
>                  (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$"
>                    line)
>                   (format
>                     #f
>                     "#define STANDARD_STARTFILE_PREFIX_1
> \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
>                     libc
>                     line)))
>                (substitute*
>                  "gcc/config/rs6000/sysv4.h"
>                  (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
>                   (format
>                     #f
>                     "#define LIB_LINUX_SPEC \"-L~a/lib %{!static:-
> rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
>                     libc
>                     libc
>                     libdir
>                     suffix))
>                  (("#define\tSTARTFILE_LINUX_SPEC.*$" line)
>                   (format
>                     #f
>                     "#define STANDARD_STARTFILE_PREFIX_1
> \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
>                     libc
>                     line))))
>          (when (file-exists? "gcc/config/rs6000")
>                (substitute*
>                  (find-files "gcc/config/rs6000")
>                  (("/lib64") "/lib")))
>          (substitute*
>            "fixincludes/fixincl.x"
>            (("static char const sed_cmd_z\\[\\] =.*;")
>             "static char const sed_cmd_z[] = \"sed\";"))
>          (when (file-exists? "gcc/config/aarch64")
>                (substitute*
>                  "gcc/config/aarch64/t-aarch64-linux"
>                  (("lib64") "lib")))
>          (when (file-exists? "libbacktrace")
>                (substitute*
>                  "libbacktrace/configure"
>                  (("WARN_FLAGS=(.*)-Werror" _ flags)
>                   (string-append "WARN_FLAGS=" flags)))
>                (when (file-exists? "libsanitizer/libbacktrace")
>                      (substitute*
>                        "libsanitizer/libbacktrace/Makefile.in"
>                        (("-Werror") ""))))
>          (substitute*
>            "libstdc++-v3/src/Makefile.in"
>            (("^OPT_LDFLAGS = ")
>             "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
>          (substitute*
>            "libstdc++-v3/python/Makefile.in"
>            (("pythondir = .*$")
>             (string-append
>               "pythondir = "
>               libdir
>               "/share"
>               "/gcc-$(gcc_version)/python\n")))
>          (substitute*
>            "gcc/config.in"
>            (("PREFIX_INCLUDE_DIR")
>             "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
>          #t)))
>    (add-after
>      'configure
>      'post-configure
>      (lambda _
>        (substitute*
>          "Makefile"
>          (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
>           "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
>        #t))))
> scheme@(guix-user)> ,pp (bag-arguments (package->bag (@@ (gnu
> packages commencement) gcc-final)))
> $4 = (#:system
>  "powerpc64le-linux"
>  #:guile
>  #<package guile-bootstrap <at> 2.0 gnu/packages/bootstrap.scm:478
> 7fff75bdcf00>
>  #:allowed-references
>  ("out"
>   "lib"
>   #<package zlib <at> 1.2.11 gnu/packages/commencement.scm:3562
> 7fff692745a0>
>   #<package glibc <at> 2.31 gnu/packages/commencement.scm:3462
> 7fff69274820>
>   #<package bash-static <at> 5.0.16 gnu/packages/commencement.scm:3402
> 7fff69274960>)
>  #:validate-runpath?
>  #f
>  #:out-of-source?
>  #t
>  #:configure-flags
>  `("--enable-plugin"
>    "--enable-languages=c,c++"
>    "--disable-multilib"
>    "--with-system-zlib"
>    "--disable-libstdcxx-pch"
>    "--with-local-prefix=/no-gcc-local-prefix"
>    ,(string-append
>       "--with-gxx-include-dir="
>       (assoc-ref %outputs "out")
>       "/include/c++")
>    ,(let ((libc (assoc-ref %build-inputs "libc")))
>       (if libc
>         (string-append
>           "--with-native-system-header-dir="
>           libc
>           "/include")
>         "--without-headers")))
>  #:make-flags
>  (let ((zlib (assoc-ref %build-inputs "zlib")))
>    (map (lambda (flag)
>           (if (string-prefix? "LDFLAGS=" flag)
>             (string-append
>               flag
>               " -L"
>               (assoc-ref %build-inputs "libstdc++")
>               "/lib -L"
>               zlib
>               "/lib -Wl,-rpath="
>               zlib
>               "/lib")
>             flag))
>         (let* ((libc (assoc-ref %build-inputs "libc"))
>                (libc-native
>                  (or (assoc-ref %build-inputs "libc-native") libc)))
>           `(,@(if libc
>                 (list (string-append
>                         "LDFLAGS_FOR_TARGET="
>                         "-B"
>                         libc
>                         "/lib "
>                         "-Wl,-dynamic-linker "
>                         "-Wl,"
>                         libc
>                         "/lib/ld64.so.2"))
>                 '())
>             ,(string-append
>                "LDFLAGS="
>                "-Wl,-rpath="
>                libc-native
>                "/lib "
>                "-Wl,-dynamic-linker "
>                "-Wl,"
>                libc-native
>                "/lib/ld64.so.2")
>             ,(string-append "BOOT_CFLAGS=-O2 " "-g0")))))
>  #:tests?
>  #f
>  #:phases
>  (modify-phases
>    (modify-phases
>      %standard-phases
>      (add-before
>        'configure
>        'pre-configure
>        (lambda* (#:key inputs outputs #:allow-other-keys)
>          (let ((libdir
>                  (or (assoc-ref outputs "lib")
>                      (assoc-ref outputs "out")))
>                (libc (assoc-ref inputs "libc")))
>            (when libc
>                  (for-each
>                    (lambda (x)
>                      (substitute*
>                        (find-files
>                          "gcc/config"
>                          "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
>                        (("(#define
> (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$"
>                          _
>                          line)
>                         line)))
>                    '(1 2 3))
>                  (substitute*
>                    (find-files
>                      "gcc/config"
>                      "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
>                    (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^
> \t]*).*$"
>                      _
>                      gnu-user
>                      suffix)
>                     (format
>                       #f
>                       "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
>                       gnu-user
>                       suffix
>                       (string-append libc "/lib/ld64.so.2"))))
>                  (substitute*
>                    (find-files "gcc/config" "^gnu-user.*\\.h$")
>                    (("#define GNU_USER_TARGET_LIB_SPEC (.*)$"
>                      _
>                      suffix)
>                     (format
>                       #f
>                       "#define GNU_USER_TARGET_LIB_SPEC \"-L~a/lib
> %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \"
> ~a"
>                       libc
>                       libc
>                       libdir
>                       suffix))
>                    (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$"
>                      line)
>                     (format
>                       #f
>                       "#define STANDARD_STARTFILE_PREFIX_1
> \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
>                       libc
>                       line)))
>                  (substitute*
>                    "gcc/config/rs6000/sysv4.h"
>                    (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
>                     (format
>                       #f
>                       "#define LIB_LINUX_SPEC \"-L~a/lib %{!static:-
> rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
>                       libc
>                       libc
>                       libdir
>                       suffix))
>                    (("#define\tSTARTFILE_LINUX_SPEC.*$" line)
>                     (format
>                       #f
>                       "#define STANDARD_STARTFILE_PREFIX_1
> \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
>                       libc
>                       line))))
>            (when (file-exists? "gcc/config/rs6000")
>                  (substitute*
>                    (find-files "gcc/config/rs6000")
>                    (("/lib64") "/lib")))
>            (substitute*
>              "fixincludes/fixincl.x"
>              (("static char const sed_cmd_z\\[\\] =.*;")
>               "static char const sed_cmd_z[] = \"sed\";"))
>            (when (file-exists? "gcc/config/aarch64")
>                  (substitute*
>                    "gcc/config/aarch64/t-aarch64-linux"
>                    (("lib64") "lib")))
>            (when (file-exists? "libbacktrace")
>                  (substitute*
>                    "libbacktrace/configure"
>                    (("WARN_FLAGS=(.*)-Werror" _ flags)
>                     (string-append "WARN_FLAGS=" flags)))
>                  (when (file-exists? "libsanitizer/libbacktrace")
>                        (substitute*
>                          "libsanitizer/libbacktrace/Makefile.in"
>                          (("-Werror") ""))))
>            (substitute*
>              "libstdc++-v3/src/Makefile.in"
>              (("^OPT_LDFLAGS = ")
>               "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
>            (substitute*
>              "libstdc++-v3/python/Makefile.in"
>              (("pythondir = .*$")
>               (string-append
>                 "pythondir = "
>                 libdir
>                 "/share"
>                 "/gcc-$(gcc_version)/python\n")))
>            (substitute*
>              "gcc/config.in"
>              (("PREFIX_INCLUDE_DIR")
>               "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
>            #t)))
>      (add-after
>        'configure
>        'post-configure
>        (lambda _
>          (substitute*
>            "Makefile"
>            (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
>             "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
>          #t)))
>    (add-after
>      'unpack
>      'unpack-gmp&co
>      (lambda* (#:key inputs #:allow-other-keys)
>        (let ((gmp (assoc-ref %build-inputs "gmp-source"))
>              (mpfr (assoc-ref %build-inputs "mpfr-source"))
>              (mpc (assoc-ref %build-inputs "mpc-source")))
>          (for-each
>            (lambda (source) (invoke "tar" "xvf" source))
>            (list gmp mpfr mpc))
>          (symlink "gmp-6.0.0" "gmp")
>          (symlink "mpfr-4.0.2" "mpfr")
>          (symlink "mpc-1.1.0" "mpc")
>          #t)))))
> scheme@(guix-user)>
> --8<---------------cut here---------------end--------------->8---
> 
> And here is what Guix says about the configure options for %gcc-
> static,
> when cross-compiled for powerpc64le-linux-gnu on an x86_64-linux
> system
> using commit 662e7e28d576ada91fc9dec7d27c100666114f03, which is the
> one
> we used to build the powerpc64le-linux bootstrap binaries:
> 
> --8<---------------cut here---------------start------------->8---
> scheme@(guix-user)> package->bag
> $1 = #<procedure package->bag (package #:optional system target #:key
> graft?)>
> scheme@(guix-user)> ,pp (bag-arguments (package->bag (@@ (gnu
> packages make-bootstrap) %gcc-static) "x86_64-linux" "powerpc64le-
> linux-gnu"))
> $2 = (#:system
>  "x86_64-linux"
>  #:target
>  "powerpc64le-linux-gnu"
>  #:modules
>  ((srfi srfi-1)
>   (srfi srfi-26)
>   (ice-9 regex)
>   (guix build gnu-build-system)
>   (guix build utils)
>   (guix build gremlin)
>   (guix elf))
>  #:out-of-source?
>  #t
>  #:configure-flags
>  (append
>    (list "--disable-bootstrap"
>          "--with-stage1-ldflags=-static"
>          "--enable-languages=c,c++"
>          "--disable-lto"
>          "--disable-shared"
>          "--disable-plugin"
>          "--disable-libmudflap"
>          "--disable-libatomic"
>          "--disable-libsanitizer"
>          "--disable-libitm"
>          "--disable-libgomp"
>          "--disable-libcilkrts"
>          "--disable-libvtv"
>          "--disable-libssp"
>          "--disable-libquadmath")
>    (remove
>      (cut string-match
>           "--(.*plugin|enable-languages)"
>           <>)
>      `("--enable-plugin"
>        "--enable-languages=c,c++"
>        "--disable-multilib"
>        "--with-system-zlib"
>        "--disable-libstdcxx-pch"
>        "--with-local-prefix=/no-gcc-local-prefix"
>        ,(string-append
>           "--with-gxx-include-dir="
>           (assoc-ref %outputs "out")
>           "/include/c++")
>        ,(let ((libc (assoc-ref %build-inputs "libc")))
>           (if libc
>             (string-append
>               "--with-native-system-header-dir="
>               libc
>               "/include")
>             "--without-headers"))
>        "CC_FOR_TARGET=powerpc64le-linux-gnu-gcc"
>        "CXX_FOR_TARGET=powerpc64le-linux-gnu-g++"
>        "LD_FOR_TARGET=powerpc64le-linux-gnu-ld"
>        "AR_FOR_TARGET=powerpc64le-linux-gnu-ar"
>        "NM_FOR_TARGET=powerpc64le-linux-gnu-nm"
>        "OBJDUMP_FOR_TARGET=powerpc64le-linux-gnu-objdump"
>        "RANLIB_FOR_TARGET=powerpc64le-linux-gnu-ranlib"
>        "STRIP_FOR_TARGET=powerpc64le-linux-gnu-strip")))
>  #:make-flags
>  '("CFLAGS=-g0 -O2")
>  #:tests?
>  #f
>  #:phases
>  (modify-phases
>    (modify-phases
>      %standard-phases
>      (add-before
>        'configure
>        'pre-configure
>        (lambda* (#:key inputs outputs #:allow-other-keys)
>          (let ((libdir
>                  (string-append
>                    (or (assoc-ref outputs "lib")
>                        (assoc-ref outputs "out"))
>                    "/"
>                    "powerpc64le-linux-gnu"))
>                (libc (assoc-ref inputs "libc")))
>            (when libc
>                  (for-each
>                    (lambda (x)
>                      (substitute*
>                        (find-files
>                          "gcc/config"
>                          "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
>                        (("(#define
> (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$"
>                          _
>                          line)
>                         line)))
>                    '(1 2 3))
>                  (substitute*
>                    (find-files
>                      "gcc/config"
>                      "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
>                    (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^
> \t]*).*$"
>                      _
>                      gnu-user
>                      suffix)
>                     (format
>                       #f
>                       "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
>                       gnu-user
>                       suffix
>                       (string-append libc "/lib/ld64.so.2"))))
>                  (substitute*
>                    (find-files "gcc/config" "^gnu-user.*\\.h$")
>                    (("#define GNU_USER_TARGET_LIB_SPEC (.*)$"
>                      _
>                      suffix)
>                     (format
>                       #f
>                       "#define GNU_USER_TARGET_LIB_SPEC \"-L~a/lib
> %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \"
> ~a"
>                       libc
>                       libc
>                       libdir
>                       suffix))
>                    (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$"
>                      line)
>                     (format
>                       #f
>                       "#define STANDARD_STARTFILE_PREFIX_1
> \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
>                       libc
>                       line)))
>                  (substitute*
>                    "gcc/config/rs6000/sysv4.h"
>                    (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
>                     (format
>                       #f
>                       "#define LIB_LINUX_SPEC \"-L~a/lib %{!static:-
> rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
>                       libc
>                       libc
>                       libdir
>                       suffix))
>                    (("#define\tSTARTFILE_LINUX_SPEC.*$" line)
>                     (format
>                       #f
>                       "#define STANDARD_STARTFILE_PREFIX_1
> \"~a/lib\"\n#define STANDARD_STARTFILE_PREFIX_2 \"\"\n~a"
>                       libc
>                       line))))
>            (substitute*
>              "fixincludes/fixincl.x"
>              (("static char const sed_cmd_z\\[\\] =.*;")
>               "static char const sed_cmd_z[] = \"sed\";"))
>            (when (file-exists? "gcc/config/aarch64")
>                  (substitute*
>                    "gcc/config/aarch64/t-aarch64-linux"
>                    (("lib64") "lib")))
>            (when (file-exists? "libbacktrace")
>                  (substitute*
>                    "libbacktrace/configure"
>                    (("WARN_FLAGS=(.*)-Werror" _ flags)
>                     (string-append "WARN_FLAGS=" flags)))
>                  (when (file-exists? "libsanitizer/libbacktrace")
>                        (substitute*
>                          "libsanitizer/libbacktrace/Makefile.in"
>                          (("-Werror") ""))))
>            (substitute*
>              "libstdc++-v3/src/Makefile.in"
>              (("^OPT_LDFLAGS = ")
>               "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
>            (substitute*
>              "libstdc++-v3/python/Makefile.in"
>              (("pythondir = .*$")
>               (string-append
>                 "pythondir = "
>                 libdir
>                 "/share"
>                 "/gcc-$(gcc_version)/python\n")))
>            (substitute*
>              "gcc/config.in"
>              (("PREFIX_INCLUDE_DIR")
>               "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
>            #t)))
>      (add-after
>        'configure
>        'post-configure
>        (lambda _
>          (substitute*
>            "Makefile"
>            (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
>             "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
>          #t)))
>    (add-after
>      'pre-configure
>      'remove-lgcc_s
>      (lambda _
>        (substitute*
>          (cons "gcc/config/rs6000/sysv4.h"
>                (find-files "gcc/config" "^gnu-user.*\\.h$"))
>          ((" -lgcc_s}}") "}}"))
>        #t)))
>  #:guile
>  #f)
> scheme@(guix-user)>
> --8<---------------cut here---------------end--------------->8---
> 
> As you can see, --with-long-double-128 is missing in all three cases.
> And yet, the packages appear to work correctly.  I do not know why,
> but
> I wonder if perhaps we should add --with-long-double-128 for gcc and
> gcc-static on powerpc64le-linux.
> 
> A thought occurred to me: can we remove the --with-long-double-128
> from
> cross-base.scm and commencement.scm?  As an experiment, I have tried
> removing it, and I can confirm that we do need it in both places.
> Removing it from cross-base.scm breaks the ability to create
> cross-compilers for the powerpc64le-linux-gnu target, and removing it
> from commencement.scm breaks the ability to build essentially
> anything
> on powerpc64le-linux.  The failure mode in both cases is similar; in
> any
> case, we do need it in both of those places.
> 
> I just don't understand why we apparently do NOT need this option in
> gcc, gcc-final, and %bootstrap-gcc on powerpc64le-linux.  Like I
> said...maybe it really IS required there, too, but we just haven't
> encountered any problems yet...  I don't know, and would welcome your
> thoughts.
> 
> -- 
> Chris

Nice tricks to display package definitions, thanks for sharing ways to
do that!

I would say we wait for actual problems before trying to fix anything,
the switch is only needed for compiling Glibc AIUI.

Léo
[signature.asc (application/pgp-signature, inline)]

bug closed, send any further explanations to 47349 <at> debbugs.gnu.org and Carl Dong <contact <at> carldong.me> Request was from Carl Dong <contact <at> carldong.me> to control <at> debbugs.gnu.org. (Mon, 29 Mar 2021 17:55:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Apr 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 358 days ago.

Previous Next


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