guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

40/63: bootstrap: Add gcc-core-mesboot1.


From: guix-commits
Subject: 40/63: bootstrap: Add gcc-core-mesboot1.
Date: Sun, 24 Nov 2019 06:04:06 -0500 (EST)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit 538978fbf00a4c60e1c55da6591620603c1b5e95
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Fri Nov 22 21:06:06 2019 +0100

    bootstrap: Add gcc-core-mesboot1.
    
    * gnu/packages/commencement.scm (gcc-core-mesboot1): New variable.
    (gmp-boot, mpfr-boot, mpc-boot): Scheme-only bootstrap.
    * gnu/packages/patches/gcc-boot-4.6.4.patch: New file.
    * gnu/packages/patches/gcc-boot-4.7.4.patch: Remove.
    * gnu/local.mk (dist_patch_DATA): Update.
---
 gnu/local.mk                                       |   2 +-
 gnu/packages/commencement.scm                      | 213 +++++++++++++++++----
 .../{gcc-boot-4.7.4.patch => gcc-boot-4.6.4.patch} |  23 +--
 3 files changed, 185 insertions(+), 53 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 12d34a0..0d93739 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -849,7 +849,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.7.4.patch                    \
+  %D%/packages/patches/gcc-boot-4.6.4.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/commencement.scm b/gnu/packages/commencement.scm
index e9c2c36..40ba2b5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1775,6 +1775,185 @@ ac_cv_c_float_format='IEEE (little-endian)'
                   (string-append "SHELL = " shell)))
                #t))))))))
 
+(define gmp-boot
+  (package
+    (inherit gmp)
+    (version "4.3.2")
+    (source (bootstrap-origin
+             (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 (bootstrap-origin
+             (origin
+               (method url-fetch)
+               (uri (string-append "mirror://gnu/mpfr/mpfr-" version
+                                   ".tar.gz"))
+               (sha256 (base32
+                        
"0dxn4904dra50xa22hi047lj8kkpr41d6vb9sd4grca880c7wv94")))))))
+
+(define mpc-boot
+  (package
+    (inherit mpc)
+    (version "1.0.3")
+    (source (bootstrap-origin
+             (origin
+               (method url-fetch)
+               (uri (string-append
+                     "mirror://gnu/mpc/mpc-" version ".tar.gz"))
+               (sha256
+                (base32
+                 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1")))))))
+
+(define gcc-core-mesboot1
+  ;; GCC 4.6.4 is the latest modular distribution.  This package is not
+  ;; stricly needed, but very helpful for development because it builds
+  ;; relatively fast.  If this configures and builds then gcc-mesboot1 also
+  ;; builds.
+  (package-with-bootstrap-guile
+   (package
+     (inherit gcc-mesboot0)
+     (name "gcc-core-mesboot1")
+     (version "4.6.4")
+     (source (bootstrap-origin
+              (origin
+                (method url-fetch)
+                (uri (string-append "mirror://gnu/gcc/gcc-"
+                                    version "/gcc-core-" version ".tar.gz"))
+                (sha256
+                 (base32
+                  "173kdb188qg79pcz073cj9967rs2vzanyjdjyxy9v0xb0p5sad75"))
+                ;; Patch needs XZ
+                ;; (patches (search-patches "gcc-boot-4.6.4.patch"))
+                )))
+     (inputs `(("gmp-source" ,(package-source gmp-boot))
+               ("mpfr-source" ,(package-source mpfr-boot))
+               ("mpc-source" ,(package-source mpc-boot))))
+     (native-inputs
+      `(("boot-patch" ,(search-patch "gcc-boot-4.6.4.patch"))
+        ("bash" ,bash-mesboot)
+        ("binutils" ,binutils-mesboot0)
+        ("coreutils" ,coreutils-mesboot0)
+        ("diffutils" ,diffutils-mesboot)
+
+        ("gawk" ,gawk-mesboot)
+        ("gcc" ,gcc-mesboot0)
+        ("gzip" ,gzip-mesboot0)
+        ("grep" ,grep-mesboot)
+        ("libc" ,glibc-mesboot0)
+        ("make" ,make-mesboot)
+        ("patch" ,patch-mesboot0)
+        ("sed" ,sed-mesboot)
+        ("tar" ,tar-mesboot)
+
+        ("kernel-headers" ,%bootstrap-linux-libre-headers)))
+     (arguments
+      `(#:implicit-inputs? #f
+        #:guile ,%bootstrap-guile
+        #:tests? #f
+        #:modules ((guix build gnu-build-system)
+                   (guix build utils)
+                   (srfi srfi-1))
+        #:parallel-build? #f            ; for debugging
+        #:make-flags
+        (let* ((libc (assoc-ref %build-inputs "libc"))
+               (ldflags (string-append
+                         "-B" libc "/lib "
+                         "-Wl,-dynamic-linker "
+                         "-Wl," libc
+                         ,(glibc-dynamic-linker "i686-linux"))))
+          (list (string-append "LDFLAGS=" ldflags)
+                (string-append "LDFLAGS_FOR_TARGET=" ldflags)))
+        #:configure-flags
+        (let ((out (assoc-ref %outputs "out"))
+              (glibc (assoc-ref %build-inputs "libc")))
+          (list (string-append "--prefix=" out)
+                "--build=i686-unknown-linux-gnu"
+                "--host=i686-unknown-linux-gnu"
+                (string-append "--with-native-system-header-dir=" glibc 
"/include")
+                (string-append "--with-build-sysroot=" glibc "/include")
+                "--disable-bootstrap"
+                "--disable-decimal-float"
+                "--disable-libatomic"
+                "--disable-libcilkrts"
+                "--disable-libgomp"
+                "--disable-libitm"
+                "--disable-libmudflap"
+                "--disable-libquadmath"
+                "--disable-libsanitizer"
+                "--disable-libssp"
+                "--disable-libvtv"
+                "--disable-lto"
+                "--disable-lto-plugin"
+                "--disable-multilib"
+                "--disable-plugin"
+                "--disable-threads"
+                "--enable-languages=c"
+                "--enable-static"
+                "--disable-shared"
+                "--enable-threads=single"
+                "--disable-libstdcxx-pch"
+                "--disable-build-with-cxx"))
+        #:phases
+        (modify-phases %standard-phases
+          (add-after 'unpack 'apply-boot-patch
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((patch-file (assoc-ref inputs "boot-patch")))
+                (format (current-error-port) "patch file=~s\n" patch-file)
+                (system* "patch" "--force" "-p1" "-i" patch-file))
+              #t))
+          ;; 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 (invoke "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-boot))
+                #t)))
+          (add-before 'configure 'setenv
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (binutils (assoc-ref %build-inputs "binutils"))
+                     (bash (assoc-ref %build-inputs "bash"))
+                     (gcc (assoc-ref %build-inputs "gcc"))
+                     (glibc (assoc-ref %build-inputs "libc"))
+                     (kernel-headers (assoc-ref %build-inputs 
"kernel-headers")))
+                (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+                (setenv "C_INCLUDE_PATH" (string-append
+                                          gcc 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
+                                          ":" kernel-headers "/include"
+                                          ":" glibc "/include"
+                                          ":" (getcwd) "/mpfr/src"))
+                (setenv "LIBRARY_PATH" (string-append glibc "/lib"
+                                                      ":" gcc "/lib"))
+                (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv 
"C_INCLUDE_PATH"))
+                (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv 
"LIBRARY_PATH"))
+                #t)))))))))
+
 (define binutils-mesboot
   (package
     (inherit binutils-mesboot0)
@@ -1798,40 +1977,6 @@ ac_cv_c_float_format='IEEE (little-endian)'
                "--host=i686-unknown-linux-gnu"
                "--with-sysroot=/"))))))
 
-(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 mpc-boot
-  (package
-    (inherit mpc)
-    (version "1.0.3")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "mirror://gnu/mpc/mpc-" version ".tar.gz"))
-              (sha256
-               (base32
-                "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))))
-
 (define gcc-mesboot1
   (package
     (inherit gcc-mesboot0)
diff --git a/gnu/packages/patches/gcc-boot-4.7.4.patch 
b/gnu/packages/patches/gcc-boot-4.6.4.patch
similarity index 70%
rename from gnu/packages/patches/gcc-boot-4.7.4.patch
rename to gnu/packages/patches/gcc-boot-4.6.4.patch
index 3e51e31..4ab0bf8 100644
--- a/gnu/packages/patches/gcc-boot-4.7.4.patch
+++ b/gnu/packages/patches/gcc-boot-4.6.4.patch
@@ -1,4 +1,4 @@
-This patch enables building gcc-4.7.4 using gcc-2.95.3 and glibc-2.2.5
+This patch enables building gcc-4.6.4 using gcc-2.95.3 and glibc-2.2.5
 
   * Tweak Makefile to allow overriding NATIVE_SYSTEM_HEADER_DIR using 
#:makeflags
   * Add missing limits.h include.
@@ -14,12 +14,12 @@ diff --git a/gcc/Makefile.in b/gcc/Makefile.in
 index f3cc49fdb18..bc5718fc9a6 100644
 --- a/gcc/Makefile.in
 +++ b/gcc/Makefile.in
-@@ -458,7 +458,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+@@ -440,7 +440,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
  LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
  
  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
--NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
-+# NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
+-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@
  
@@ -40,24 +40,11 @@ index 94b7a0b89a7..ab2baab55ca 100644
  
  /* Linux has a feature called exec-shield-randomize that perturbs the
     address of non-fixed mapped segments by a (relatively) small amount.
-diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
-index c301ff03cae..f86318c3bd5 100644
---- a/libgcc/Makefile.in
-+++ b/libgcc/Makefile.in
-@@ -225,7 +225,7 @@ endif
- LIBGCC2_DEBUG_CFLAGS = -g
- LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) 
\
-                $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
--               -fbuilding-libgcc -fno-stack-protector \
-+               -fno-stack-protector \
-                $(INHIBIT_LIBC_CFLAGS)
- 
- # Additional options to use when compiling libgcc2.a.
 diff --git a/libgcc/generic-morestack-thread.c 
b/libgcc/generic-morestack-thread.c
 index bbe6dd12b5a..1d1d48223d7 100644
 --- a/libgcc/generic-morestack-thread.c
 +++ b/libgcc/generic-morestack-thread.c
-@@ -35,7 +35,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
+@@ -34,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
     will want to define inhibit_libc while building a compiler which
     can build glibc.  */
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]