~ruther/guix-local

062134985802d85066418f6ee2f327122166a567 — Ludovic Courtès 12 years ago 7db9608
gnu: Switch to GCC 4.8 as the default compiler.

* build-aux/download.scm (file-name->uri): Update URL to /20131110.
* gnu-system.am (nodist_bootstrap_x86_64_linux_DATA,
  nodist_bootstrap_i686_linux_DATA): Change base name to
  'guile-2.0.9.tar.xz'.
  (gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz,
  gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz): New targets.
  (gnu/packages/bootstrap/x86_64-linux/guile-2.0.7.tar.xz,
  gnu/packages/bootstrap/i686-linux/guile-2.0.7.tar.xz): Remove.
  (gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz): Update
  hash.
* gnu/packages/base.scm (gcc-boot0): Base upon GCC-4.8.  Enable C++, and
  add a few --disable flags.  Remove MPFR workaround.
  (cross-gcc-wrapper): Base upon GCC-4.8.  Wrap both 'gcc' and 'g++'.
  (libstdc++): New variable.
  (gcc-final): Add it as an input; pass corresponding -I and -L flags.
* gnu/packages/bootstrap.scm (%bootstrap-guile): Always use
  "guile-2.0.9.tar.xz.
  (%bootstrap-coreutils&co): Update hashes.
  (%bootstrap-binutils): Update URL and hashes.
  (%bootstrap-glibc): Likewise.
  (%bootstrap-gcc): Likewise.
* gnu/packages/gcc.scm (gcc-4.7): Add LDFLAGS.
  Add --disable-libstdcxx-pch.
  Modify the GNU_USER*_SPEC macros from gnu-user*.h instead of the raw
  _SPEC macros.
5 files changed, 119 insertions(+), 95 deletions(-)

M build-aux/download.scm
M gnu-system.am
M gnu/packages/base.scm
M gnu/packages/bootstrap.scm
M gnu/packages/gcc.scm
M build-aux/download.scm => build-aux/download.scm +1 -6
@@ 45,12 45,7 @@
  (match (string-tokenize file (char-set-complement (char-set #\/)))
    ((_ ... system basename)
     (string->uri (string-append %url-base "/" system
                                 (match system
                                   ("mips64el-linux"
                                    "/20131017/")
                                   (_
                                    "/20130105/"))
                                 basename)))))
                                 "/20131110/" basename)))))

(match (command-line)
  ((_ file expected-hash)

M gnu-system.am => gnu-system.am +7 -7
@@ 296,9 296,9 @@ dist_bootstrap_mips64el_linux_DATA =		\
# Big bootstrap binaries are not included in the tarball.  Instead, they
# are downloaded.
nodist_bootstrap_x86_64_linux_DATA =					\
  gnu/packages/bootstrap/x86_64-linux/guile-2.0.7.tar.xz
  gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz
nodist_bootstrap_i686_linux_DATA =					\
  gnu/packages/bootstrap/i686-linux/guile-2.0.7.tar.xz
  gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz
nodist_bootstrap_mips64el_linux_DATA =					\
  gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz



@@ 318,12 318,12 @@ DOWNLOAD_FILE =								\
  $(GUILE) --no-auto-compile -L "$(top_builddir)" -L "$(top_srcdir)"	\
           "$(top_srcdir)/build-aux/download.scm"

gnu/packages/bootstrap/x86_64-linux/guile-2.0.7.tar.xz:
gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz:
	$(MKDIR_P) `dirname "$@"`
	$(DOWNLOAD_FILE) "$@" "bc43210dcd146d242bef4d354b0aeac12c4ef3118c07502d17ffa8d49e15aa2c"
gnu/packages/bootstrap/i686-linux/guile-2.0.7.tar.xz:
	$(DOWNLOAD_FILE) "$@" "037b103522a2d0d7d69c7ffd8de683dfe5bb4b59c1fafd70b4ffd397fd2f57f0"
gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz:
	$(MKDIR_P) `dirname "$@"`
	$(DOWNLOAD_FILE) "$@" "f9a7c6f4c556eaafa2a69bcf07d4ffbb6682ea831d4c9da9ba095aca3ccd217c"
	$(DOWNLOAD_FILE) "$@" "b757cd46bf13ecac83fb8e955fb50096ac2d17bb610ca8eb816f29302a00a846"
gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz:
	$(MKDIR_P) `dirname "$@"`
	$(DOWNLOAD_FILE) "$@" "1735d8b3f94749a4a349b6135f3aaa089f65dc62951c89c6c43ba0f2fc34211d"
	$(DOWNLOAD_FILE) "$@" "994680f0001346864aa2c2cc5110f380ee7518dcd701c614291682b8e948f73b"

M gnu/packages/base.scm => gnu/packages/base.scm +76 -37
@@ 644,7 644,7 @@ identifier SYSTEM."

(define gcc-boot0
  (package-with-bootstrap-guile
   (package (inherit gcc-4.7)
   (package (inherit gcc-4.8)
     (name "gcc-cross-boot0")
     (arguments
      `(#:guile ,%bootstrap-guile


@@ 654,7 654,7 @@ identifier SYSTEM."
                   (ice-9 regex)
                   (srfi srfi-1)
                   (srfi srfi-26))
        ,@(substitute-keyword-arguments (package-arguments gcc-4.7)
        ,@(substitute-keyword-arguments (package-arguments gcc-4.8)
            ((#:configure-flags flags)
             `(append (list ,(string-append "--target=" (boot-triplet))



@@ 663,8 663,18 @@ identifier SYSTEM."

                            ;; Disable features not needed at this stage.
                            "--disable-shared"
                            "--enable-languages=c"
                            "--enable-languages=c,c++"

                            ;; libstdc++ cannot be built at this stage
                            ;; ("Link tests are not allowed after
                            ;; GCC_NO_EXECUTABLES.").
                            "--disable-libstdc++-v3"

                            "--disable-threads"
                            "--disable-libmudflap"
                            "--disable-libatomic"
                            "--disable-libsanitizer"
                            "--disable-libitm"
                            "--disable-libgomp"
                            "--disable-libssp"
                            "--disable-libquadmath"


@@ 691,24 701,7 @@ identifier SYSTEM."
                   ,@(map (lambda (lib)
                            `(symlink ,(package-full-name lib)
                                      ,(package-name lib)))
                          (list gmp mpfr mpc))

                   ;; MPFR headers/lib are found under $(MPFR)/src, but
                   ;; `configure' wrongfully tells MPC too look under
                   ;; $(MPFR), so fix that.
                   (substitute* "configure"
                     (("extra_mpc_mpfr_configure_flags(.+)--with-mpfr-include=([^/]+)/mpfr(.*)--with-mpfr-lib=([^ ]+)/mpfr"
                       _ equals include middle lib)
                      (string-append "extra_mpc_mpfr_configure_flags" equals
                                     "--with-mpfr-include=" include
                                     "/mpfr/src" middle
                                     "--with-mpfr-lib=" lib
                                     "/mpfr/src"))
                     (("gmpinc='-I([^ ]+)/mpfr -I([^ ]+)/mpfr" _ a b)
                      (string-append "gmpinc='-I" a "/mpfr/src "
                                     "-I" b "/mpfr/src"))
                     (("gmplibs='-L([^ ]+)/mpfr" _ a)
                      (string-append "gmplibs='-L" a "/mpfr/src")))))
                          (list gmp mpfr mpc))))
               (alist-cons-after
                'install 'symlink-libgcc_eh
                (lambda* (#:key outputs #:allow-other-keys)


@@ 718,7 711,7 @@ identifier SYSTEM."
                    (with-directory-excursion
                        (string-append out "/lib/gcc/"
                                       ,(boot-triplet)
                                       "/" ,(package-version gcc-4.7))
                                       "/" ,(package-version gcc-4.8))
                      (symlink "libgcc.a" "libgcc_eh.a"))))
                ,phases))))))



@@ 734,7 727,7 @@ identifier SYSTEM."

     ;; No need for Texinfo at this stage.
     (native-inputs (alist-delete "texinfo"
                                  (package-native-inputs gcc-4.7))))))
                                  (package-native-inputs gcc-4.8))))))

(define (linux-libre-headers-boot0)
  "Return Linux-Libre header files for the bootstrap environment."


@@ 800,7 793,7 @@ identifier SYSTEM."
(define (cross-gcc-wrapper gcc binutils glibc bash)
  "Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC
that makes it available under the native tool names."
  (package (inherit gcc-4.7)
  (package (inherit gcc-4.8)
    (name (string-append (package-name gcc) "-wrapped"))
    (source #f)
    (build-system trivial-build-system)


@@ 817,27 810,29 @@ that makes it available under the native tool names."
                          (out      (assoc-ref %outputs "out"))
                          (bindir   (string-append out "/bin"))
                          (triplet  ,(boot-triplet)))
                     (mkdir-p bindir)
                     (with-directory-excursion bindir
                       (for-each (lambda (tool)
                                   (symlink (string-append binutils "/bin/"
                                                           triplet "-" tool)
                                            tool))
                                 '("ar" "ranlib"))

                     (define (wrap-program program)
                       ;; GCC-BOOT0 is a libc-less cross-compiler, so it
                       ;; needs to be told where to find the crt files and
                       ;; the dynamic linker.
                       (call-with-output-file "gcc"
                       (call-with-output-file program
                         (lambda (p)
                           (format p "#!~a/bin/bash
exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
                                   bash
                                   gcc triplet
                                   gcc triplet program
                                   libc libc
                                   ,(glibc-dynamic-linker))))

                       (chmod "gcc" #o555))))))
                       (chmod program #o555))

                     (mkdir-p bindir)
                     (with-directory-excursion bindir
                       (for-each (lambda (tool)
                                   (symlink (string-append binutils "/bin/"
                                                           triplet "-" tool)
                                            tool))
                                 '("ar" "ranlib"))
                       (for-each wrap-program '("gcc" "g++")))))))
    (native-inputs
     `(("binutils" ,binutils)
       ("gcc" ,gcc)


@@ 893,6 888,36 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
        ,@(package-arguments binutils)))
     (inputs %boot2-inputs))))

(define libstdc++
  ;; Intermediate libstdc++ that will allow us to build the final GCC
  ;; (remember that GCC-BOOT0 cannot build libstdc++.)
  (package-with-bootstrap-guile
   (package (inherit gcc-4.8)
     (name "libstdc++")
     (arguments
      `(#:guile ,%bootstrap-guile
        #:implicit-inputs? #f

        #:out-of-source? #t
        #:phases (alist-cons-before
                  'configure 'chdir
                  (lambda _
                    (chdir "libstdc++-v3"))
                  %standard-phases)
        #:configure-flags `("--disable-shared"
                            "--disable-libstdcxx-threads"
                            "--disable-libstdcxx-pch"
                            ,(string-append "--with-gxx-include-dir="
                                            (assoc-ref %outputs "out")
                                            "/include"
                                            ;; "/include/c++/"
                                            ;; ,(package-version gcc-4.8)
                                            ))))
     (inputs %boot2-inputs)
     (native-inputs '())
     (propagated-inputs '())
     (synopsis "GNU C++ standard library (intermediate)"))))

(define-public gcc-final
  ;; The final GCC.
  (package (inherit gcc-boot0)


@@ 906,12 931,25 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
       ;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.)
       ,@(substitute-keyword-arguments (package-arguments gcc-boot0)
           ((#:configure-flags boot-flags)
            (let loop ((args (package-arguments gcc-4.7)))
            (let loop ((args (package-arguments gcc-4.8)))
              (match args
                ((#:configure-flags normal-flags _ ...)
                 normal-flags)
                ((_ rest ...)
                 (loop rest)))))
           ((#:make-flags flags)
            ;; Since $LIBRARY_PATH and $CPATH are not honored, add the
            ;; relevant flags.
            `(cons (string-append "CPPFLAGS=-I"
                                  (assoc-ref %build-inputs "libstdc++")
                                  "/include")
                   (map (lambda (flag)
                          (if (string-prefix? "LDFLAGS=" flag)
                              (string-append flag " -L"
                                             (assoc-ref %build-inputs "libstdc++")
                                             "/lib")
                              flag))
                        ,flags)))
           ((#:phases phases)
            `(alist-delete 'symlink-libgcc_eh ,phases)))))



@@ 919,6 957,7 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
              ("mpfr-source" ,(package-source mpfr))
              ("mpc-source" ,(package-source mpc))
              ("binutils" ,binutils-final)
              ("libstdc++" ,libstdc++)
              ,@%boot2-inputs))))

(define ld-wrapper-boot3

M gnu/packages/bootstrap.scm => gnu/packages/bootstrap.scm +17 -38
@@ 180,12 180,7 @@ check whether everything is alright."
                              (xz    (->store "xz"))
                              (mkdir (->store "mkdir"))
                              (bash  (->store "bash"))
                              (guile (->store
                                      (match (%current-system)
                                        ("mips64el-linux"
                                         "guile-2.0.9.tar.xz")
                                        (_
                                         "guile-2.0.7.tar.xz"))))
                              (guile (->store "guile-2.0.9.tar.xz"))
                              (builder
                               (add-text-to-store store
                                                  "build-bootstrap-guile.sh"


@@ 224,23 219,19 @@ $out/bin/guile --version~%"
                          (origin
                           (method url-fetch)
                           (uri (map (cut string-append <> "/" system
                                          (match system
                                            ("mips64el-linux"
                                             "/20131017/static-binaries.tar.xz")
                                            (_
                                             "/20130105/static-binaries.tar.xz")))
                                          "/20131110/static-binaries.tar.xz")
                                     %bootstrap-base-urls))
                           (sha256
                            (match system
                              ("x86_64-linux"
                               (base32
                                "0md23alzy6nc5f16pric7mkagczdzr8xbh074sb3rjzrls06j1ls"))
                                "0c533p9dhczzcsa1117gmfq3pc8w362g4mx84ik36srpr7cx2bg4"))
                              ("i686-linux"
                               (base32
                                "0nzj1lmm9b94g7k737cr4w1dv282w5nmhb53238ikax9r6pkc0yb"))
                                "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak"))
                              ("mips64el-linux"
                               (base32
                                "17k5f1322b7n1difhlyw4cghxvq8fxj7wlhzghh4y362fshvvw1c"))))))
                                "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753"))))))
                        "true"                    ; the program to test
                        "Bootstrap binaries of Coreutils, Awk, etc."))



@@ 250,23 241,19 @@ $out/bin/guile --version~%"
                          (origin
                           (method url-fetch)
                           (uri (map (cut string-append <> "/" system
                                          (match system
                                            ("mips64el-linux"
                                             "/20131017/binutils-2.23.2.tar.xz")
                                            (_
                                             "/20130105/binutils-2.22.tar.xz")))
                                          "/20131110/binutils-2.23.2.tar.xz")
                                     %bootstrap-base-urls))
                           (sha256
                            (match system
                              ("x86_64-linux"
                               (base32
                                "1ffmk2yy2pxvkqgzrkzp3s4jpn4qaaksyk3b5nsc5cjwfm7qkgzh"))
                                "1j5yivz7zkjqfsfmxzrrrffwyayjqyfxgpi89df0w4qziqs2dg20"))
                              ("i686-linux"
                               (base32
                                "1rafk6aq4sayvv3r3d2khn93nkyzf002xzh0xadlyci4mznr6b0a"))
                                "14jgwf9gscd7l2pnz610b1zia06dvcm2qyzvni31b8zpgmcai2v9"))
                              ("mips64el-linux"
                               (base32
                                "1dpnmscgg1fxg9xmlbvcm1d8h8brjgqwaal748w3v3qf33is4sl6"))))))
                                "1x8kkhcxmfyzg1ddpz2pxs6fbdl6412r7x0nzbmi5n7mj8zw2gy7"))))))
                        "ld"                      ; the program to test
                        "Bootstrap binaries of the GNU Binutils"))



@@ 308,23 295,19 @@ $out/bin/guile --version~%"
                    (origin
                     (method url-fetch)
                     (uri (map (cut string-append <> "/" (%current-system)
                                    (match (%current-system)
                                      ("mips64el-linux"
                                       "/20131017/glibc-2.18.tar.xz")
                                      (_
                                       "/20130105/glibc-2.17.tar.xz")))
                                    "/20131110/glibc-2.18.tar.xz")
                               %bootstrap-base-urls))
                     (sha256
                      (match (%current-system)
                        ("x86_64-linux"
                         (base32
                          "18kv1z9d8dr1j3hm9w7663kchqw9p6rsx11n1m143jgba2jz6jy3"))
                          "0jlqrgavvnplj1b083s20jj9iddr4lzfvwybw5xrcis9spbfzk7v"))
                        ("i686-linux"
                         (base32
                          "08hv8i0axwnihrcgbz19x0a7s6zyv3yx38x8r29liwl8h82x9g88"))
                          "1hgrccw1zqdc7lvgivwa54d9l3zsim5pqm0dykxg0z522h6gr05w"))
                        ("mips64el-linux"
                         (base32
                          "1w9x8r2him7qbqlm7ah1aq04kk2ydma44jzgdzsdj3kjx36sqyq1")))))))))
                          "0k97a3whzx3apsi9n2cbsrr79ad6lh00klxph9hw4fqyp1abkdsg")))))))))
    (synopsis "Bootstrap binaries and headers of the GNU C Library")
    (description #f)
    (home-page #f)


@@ 383,23 366,19 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
                    (origin
                     (method url-fetch)
                     (uri (map (cut string-append <> "/" (%current-system)
                                    (match (%current-system)
                                      ("mips64el-linux"
                                       "/20131017/gcc-4.7.3.tar.xz")
                                      (_
                                       "/20130105/gcc-4.7.2.tar.xz")))
                                    "/20131110/gcc-4.8.2.tar.xz")
                               %bootstrap-base-urls))
                     (sha256
                      (match (%current-system)
                        ("x86_64-linux"
                         (base32
                          "1x1p7han5crnbw906iwdifykr6grzm0w27dy9gz75j0q1b32i4px"))
                          "17ga4m6195n4fnbzdkmik834znkhs53nkypp6557pl1ps7dgqbls"))
                        ("i686-linux"
                         (base32
                          "06wqs0xxnpw3hn0xjb4c9cs0899p1xwkcysa2rvzhvpra0c5vsg2"))
                          "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw"))
                        ("mips64el-linux"
                         (base32
                          "0g9z8cdlnlzbg67607rxxfk5vi4xjsdc7c2agvdnyzlp0shib6rb")))))))))
                          "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks")))))))))
    (native-search-paths
     (list (search-path-specification
            (variable "CPATH")

M gnu/packages/gcc.scm => gnu/packages/gcc.scm +18 -7
@@ 73,6 73,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                     "--enable-languages=c,c++"
                     "--disable-multilib"

                     ;; No pre-compiled libstdc++ headers, to save space.
                     "--disable-libstdcxx-pch"

                     "--with-local-prefix=/no-gcc-local-prefix"

                     ,(let ((libc (assoc-ref %build-inputs "libc")))


@@ 115,7 118,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
         #:strip-binaries? ,stripped?
         #:configure-flags ,(configure-flags)
         #:make-flags
         (let ((libc (assoc-ref %build-inputs "libc")))
         (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 "


@@ 123,6 128,12 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                                        "-Wl," libc
                                        ,(glibc-dynamic-linker)))
                   '())

             ;; Native programs like 'genhooks' also need that right.
             ,(string-append "LDFLAGS="
                              "-Wl,-rpath=" libc-native "/lib "
                             "-Wl,-dynamic-linker "
                             "-Wl," libc-native ,(glibc-dynamic-linker))
             ,(string-append "BOOT_CFLAGS=-O2 "
                             ,(if stripped? "-g0" "-g"))))



@@ 148,18 159,18 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                ;; Tell where to find libstdc++, libc, and `?crt*.o', except
                ;; `crt{begin,end}.o', which come with GCC.
                (substitute* (find-files "gcc/config"
                                         "^(gnu-user(64)?|linux-elf)\\.h$")
                  (("#define LIB_SPEC (.*)$" _ suffix)
                                         "^gnu-user.*\\.h$")
                  (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
                   ;; Note that with this "lib" spec, we may still add a
                   ;; RUNPATH to GCC even when `libgcc_s' is not NEEDED.
                   ;; There's not much that can be done to avoid it, though.
                   (format #f "#define LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib \
%{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib}} \" ~a"
                   (format #f "#define GNU_USER_TARGET_LIB_SPEC \
\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib}} \" ~a"
                           libc libc out out suffix))
                  (("#define STARTFILE_SPEC.*$" line)
                  (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
                   (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
#define STANDARD_STARTFILE_PREFIX_2 \"\"
~a~%"
~a"
                           libc line))))

              ;; Don't retain a dependency on the build-time sed.