janneke pushed a commit to branch wip-bootstrap in repository guix. commit c981fa7d389925a6cc6d3cb0d7aa2217672909a1 Author: Jan Nieuwenhuizen <jann...@gnu.org> Date: Sat Jun 23 21:26:29 2018 +0200
gnu: Add gcc-mesboot 4.1.0. * gnu/packages/mes.scm (gcc-mesboot0): Rename from gcc-mesboot. (gcc-mesboot): New package. * gnu/packages/patches/gcc-boot-4.1.0.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/mes.scm | 291 +++++++++++++++++++++++------- gnu/packages/patches/gcc-boot-4.1.0.patch | 30 +++ 3 files changed, 259 insertions(+), 63 deletions(-) diff --git a/gnu/local.mk b/gnu/local.mk index 76e6bbc..8dc23fe 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -698,6 +698,7 @@ dist_patch_DATA = \ %D%/packages/patches/gcc-arm-link-spec-fix.patch \ %D%/packages/patches/gcc-asan-missing-include.patch \ %D%/packages/patches/gcc-boot-2.95.3.patch \ + %D%/packages/patches/gcc-boot-4.1.0.patch \ %D%/packages/patches/gcc-cross-environment-variables.patch \ %D%/packages/patches/gcc-fix-texi2pod.patch \ %D%/packages/patches/gcc-4.8-libsanitizer-fix.patch \ diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm index 696f589..e6a35d3 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -31,6 +31,7 @@ #:use-module (gnu packages m4) #:use-module (gnu packages make-bootstrap) #:use-module (gnu packages man) + #:use-module (gnu packages multiprecision) #:use-module (gnu packages package-management) #:use-module (gnu packages perl) #:use-module (gnu packages texinfo) @@ -709,67 +710,6 @@ standard.") "--target=i386-unknown-linux" (string-append "--prefix=" out)))))))))))) -(define-public binutils-mesboot - (package-with-bootstrap-guile - (package - (inherit binutils-mesboot0) - (name "binutils-mesboot") - (native-inputs `(("binutils-mesboot" ,binutils-mesboot0) - ("glibc-mesboot" ,glibc-mesboot) - ("gcc-mesboot" ,gcc-mesboot) - ("kernel-headers" ,(linux-libre-headers-boot0)))) - (arguments - `(#:parallel-build? #f - #:configure-flags '("--enable-deterministic-archives" - "--disable-nls" - "--disable-shared" - "--disable-werror" - "--host=i386-unknown-linux" - "--target=i386-unknown-linux" - "--enable-static" - "--enable-compressed-debug-sections=no" - "--disable-gold" - "--disable-plugins" - "--disable-x86-relax-relocations" - "--with-system-libz") - #:phases - (modify-phases %standard-phases - (add-before 'configure 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (gcc (assoc-ref %build-inputs "gcc-mesboot")) - (glibc (assoc-ref %build-inputs "glibc-mesboot")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "C_INCLUDE_PATH" - (string-append glibc "/include" - ":" kernel-headers "/include" - ":" gcc "/include")) - (setenv "LIBRARY_PATH" - (string-append glibc "/lib" - ":" gcc "/lib")) - (setenv "CPP" (string-append "gcc -E")) - (setenv "AR" "ar") - (setenv "RANLIB" "true") - (setenv "PATH" - (string-append - (assoc-ref %build-inputs "binutils-mesboot") "/bin" - ":" (assoc-ref %build-inputs "gcc-mesboot") "/bin" - - ;; more bootstrap cheats - ":" (assoc-ref %build-inputs "bash") "/bin" - ":" (assoc-ref %build-inputs "coreutils") "/bin" - ":" (assoc-ref %build-inputs "diffutils") "/bin" - ":" (assoc-ref %build-inputs "file") "/bin" - ":" (assoc-ref %build-inputs "gawk") "/bin" - ":" (assoc-ref %build-inputs "grep") "/bin" - ":" (assoc-ref %build-inputs "gzip") "/bin" - ":" (assoc-ref %build-inputs "make") "/bin" - ":" (assoc-ref %build-inputs "sed") "/bin" - ":" (assoc-ref %build-inputs "tar") "/bin")) - (format (current-error-port) "PATH=~a\n" (getenv "PATH")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH"))))))))))) - (define-public gcc-core-mesboot (package (inherit gcc) @@ -973,10 +913,10 @@ ac_cv_c_float_format='IEEE (little-endian)' (zero? (apply system* "./configure" configure-flags))))))))) -(define-public gcc-mesboot +(define-public gcc-mesboot0 (package (inherit gcc-core-mesboot) - (name "gcc-mesboot") + (name "gcc-mesboot0") (version "2.95.3") (source (origin (method url-fetch) @@ -1026,6 +966,7 @@ ac_cv_c_float_format='IEEE (little-endian)' ;; more bootstrap cheats ":" (assoc-ref %build-inputs "bash") "/bin" ":" (assoc-ref %build-inputs "coreutils") "/bin" + ":" (assoc-ref %build-inputs "diffutils") "/bin" ":" (assoc-ref %build-inputs "grep") "/bin" ":" (assoc-ref %build-inputs "gzip") "/bin" ":" (assoc-ref %build-inputs "make") "/bin" @@ -1075,6 +1016,230 @@ ac_cv_c_float_format='IEEE (little-endian)' (zero? (system (string-append "set -x; cd tmp && ar r " gcc-dir "/libgcc.a *.o"))) (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a"))))))))))) + +(define-public binutils-mesboot + (package-with-bootstrap-guile + (package + (inherit binutils-mesboot0) + (name "binutils-mesboot") + (native-inputs `(("binutils-mesboot" ,binutils-mesboot0) + ("glibc-mesboot" ,glibc-mesboot) + ("gcc-mesboot" ,gcc-mesboot0) + ("kernel-headers" ,(linux-libre-headers-boot0)))) + (arguments + `(#:parallel-build? #f + #:configure-flags '("--enable-deterministic-archives" + "--disable-nls" + "--disable-shared" + "--disable-werror" + "--host=i386-unknown-linux" + "--target=i386-unknown-linux" + "--enable-static" + "--enable-compressed-debug-sections=no" + "--disable-gold" + "--disable-plugins" + "--disable-x86-relax-relocations" + "--with-system-libz") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (gcc (assoc-ref %build-inputs "gcc-mesboot")) + (glibc (assoc-ref %build-inputs "glibc-mesboot")) + (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) + (setenv "C_INCLUDE_PATH" + (string-append glibc "/include" + ":" kernel-headers "/include" + ":" gcc "/include")) + (setenv "LIBRARY_PATH" + (string-append glibc "/lib" + ":" gcc "/lib")) + (setenv "CPP" (string-append "gcc -E")) + (setenv "AR" "ar") + (setenv "RANLIB" "true") + (setenv "PATH" + (string-append + (assoc-ref %build-inputs "binutils-mesboot") "/bin" + ":" (assoc-ref %build-inputs "gcc-mesboot") "/bin" + + ;; more bootstrap cheats + ":" (assoc-ref %build-inputs "bash") "/bin" + ":" (assoc-ref %build-inputs "coreutils") "/bin" + ":" (assoc-ref %build-inputs "diffutils") "/bin" + ":" (assoc-ref %build-inputs "file") "/bin" + ":" (assoc-ref %build-inputs "gawk") "/bin" + ":" (assoc-ref %build-inputs "grep") "/bin" + ":" (assoc-ref %build-inputs "gzip") "/bin" + ":" (assoc-ref %build-inputs "make") "/bin" + ":" (assoc-ref %build-inputs "sed") "/bin" + ":" (assoc-ref %build-inputs "tar") "/bin")) + (format (current-error-port) "PATH=~a\n" (getenv "PATH")) + (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) + (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH"))))))))))) + +(define gmp-boot + (package + (inherit gmp) + (version "4.3.2") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gmp/gmp-" version + ".tar.gz")) + (sha256 (base32 + "15rwq54fi3s11izas6g985y9jklm3xprfsmym3v1g6xr84bavqvv")))))) + +(define mpfr-boot + (package + (inherit mpfr) + (version "2.4.2") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/mpfr/mpfr-" version + ".tar.gz")) + (sha256 (base32 + "0dxn4904dra50xa22hi047lj8kkpr41d6vb9sd4grca880c7wv94")))))) + +(define-public gcc-mesboot + (package-with-bootstrap-guile + (package + (inherit gcc-mesboot0) + (name "gcc-mesboot") + (version "4.1.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gcc/gcc-4.1.0/gcc-core-" + version + ".tar.bz2")) + (patches (search-patches "gcc-boot-4.1.0.patch")) + (sha256 + (base32 + "089zy7akf1xlk87s4jmmfpz3bla1f3ji3fgr4wk7yznc6ih0blql")))) + (supported-systems '("i686-linux")) + (native-inputs `(("binutils-boot" ,binutils-mesboot) + ("gcc-boot" ,gcc-mesboot0) + ("glibc-boot" ,glibc-mesboot) + ("kernel-headers" ,(linux-libre-headers-boot0)))) + (inputs `(("gmp-source" ,(package-source gmp-boot)) + ("mpfr-source" ,(package-source mpfr-boot)) + ("mpc-source" ,(package-source mpc)))) + (outputs '("out")) + (arguments + `(#:tests? #f ; runtest: command not found + #:parallel-build? #f + #:strip-binaries? #f + #:configure-flags + (let ((out (assoc-ref %outputs "out")) + (glibc (assoc-ref %build-inputs "glibc-boot"))) + (list "--disable-shared" + "--enable-static" + "--host=i386-unknown-linux" + "--target=i386-unknown-linux" + (string-append "--with-native-system-header-dir=" glibc "/include") + (string-append "--with-build-sysroot=" glibc "/include") + "--disable-plugin" + "--enable-languages=c" + "--disable-multilib" + + ;; No pre-compiled libstdc++ headers, to save space. + "--disable-libstdcxx-pch" + + "--disable-threads" + "--disable-libmudflap" + "--disable-libatomic" + "--disable-libsanitizer" + "--disable-libitm" + "--disable-libgomp" + "--disable-libcilkrts" + "--disable-libvtv" + "--disable-libssp" + "--disable-libquadmath" + "--disable-decimal-float" + (string-append "--prefix=" out))) + #:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + + ;; c&p from commencement.scm:gcc-boot0 + (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"))) + + ;; To reduce the set of pre-built bootstrap inputs, build + ;; GMP & co. from GCC. + (for-each (lambda (source) + (or (zero? (system* "tar" "xvf" source)) + (error "failed to unpack tarball" + source))) + (list gmp mpfr mpc)) + + ;; Create symlinks like `gmp' -> `gmp-x.y.z'. + ,@(map (lambda (lib) + ;; Drop trailing letters, as gmp-6.0.0a unpacks + ;; into gmp-6.0.0. + `(symlink ,(string-trim-right + (package-full-name lib) + char-set:letter) + ,(package-name lib))) + (list gmp-boot mpfr-boot mpc))))) + + (add-before 'configure 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (binutils (assoc-ref %build-inputs "binutils-boot")) + (gcc (assoc-ref %build-inputs "gcc-boot")) + (glibc (assoc-ref %build-inputs "glibc-boot")) + (headers (assoc-ref %build-inputs "kernel-headers"))) + + (setenv "CPP" (string-append "gcc -E")) + (setenv "AR" "ar") + (setenv "RANLIB" "true") + (setenv "PATH" + (string-append + (assoc-ref %build-inputs "binutils-boot") "/bin" + ":" (assoc-ref %build-inputs "gcc-boot") "/bin" + + ;; more bootstrap cheats + ":" (assoc-ref %build-inputs "bash") "/bin" + ":" (assoc-ref %build-inputs "coreutils") "/bin" + ":" (assoc-ref %build-inputs "diffutils") "/bin" + ;; ":" (assoc-ref %build-inputs "file") "/bin" + ;; ":" (assoc-ref %build-inputs "findutils") "/bin" + ":" (assoc-ref %build-inputs "gawk") "/bin" + ":" (assoc-ref %build-inputs "grep") "/bin" + ":" (assoc-ref %build-inputs "gzip") "/bin" + ":" (assoc-ref %build-inputs "make") "/bin" + ":" (assoc-ref %build-inputs "sed") "/bin" + ":" (assoc-ref %build-inputs "tar") "/bin")) + (format (current-error-port) "PATH=~a\n" (getenv "PATH")) + (setenv "CONFIG_SHELL" (string-append + (assoc-ref %build-inputs "bash") + "/bin/sh")) + (setenv "C_INCLUDE_PATH" (string-append + gcc "/lib/gcc-lib/i386-unknown-linux/2.95.3/include" + ":" headers "/include" + ":" glibc "/include" + ":" (getcwd) "/mpfr/src" + )) + (setenv "LIBRARY_PATH" (string-append glibc "/lib" + ":" gcc "/lib")) + + (setenv "NATIVE_SYSTEM_HEADER_DIR" (string-append glibc "/include")) + + (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) + (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH"))))) + (replace 'configure + (lambda* (#:key configure-flags #:allow-other-keys) + (let ((flags (filter (lambda (flag) + (not (string-prefix? "--build=" flag))) + configure-flags))) + (zero? + (apply system* "./configure" configure-flags))))))))))) + ;;; (define-public nyacc diff --git a/gnu/packages/patches/gcc-boot-4.1.0.patch b/gnu/packages/patches/gcc-boot-4.1.0.patch new file mode 100644 index 0000000..e39586f --- /dev/null +++ b/gnu/packages/patches/gcc-boot-4.1.0.patch @@ -0,0 +1,30 @@ +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 27dd5ab9fe9..4ca7ddb4bb3 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -383,7 +383,7 @@ PARTITION_H = $(srcdir)/../include/partition.h + MD5_H = $(srcdir)/../include/md5.h + + # Default native SYSTEM_HEADER_DIR, to be overridden by targets. +-NATIVE_SYSTEM_HEADER_DIR = /usr/include ++# NATIVE_SYSTEM_HEADER_DIR = /usr/include + # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + +diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c +index 795bb552234..dced63146ba 100644 +--- a/gcc/config/host-linux.c ++++ b/gcc/config/host-linux.c +@@ -26,6 +26,12 @@ + #include "hosthooks.h" + #include "hosthooks-def.h" + ++// ../.././gcc/config/host-linux.c:213: `SSIZE_MAX' undeclared (first ++// use in this function) ++#include <limits.h> ++#ifndef SSIZE_MAX ++# define SSIZE_MAX LONG_MAX ++#endif + + /* Linux has a feature called exec-shield-randomize that perturbs the + address of non-fixed mapped segments by a (relatively) small amount.