[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: WIP: build gcc-core-4.6.4 as gcc-mesboot1 for coreutils test purp
From: |
guix-commits |
Subject: |
02/02: WIP: build gcc-core-4.6.4 as gcc-mesboot1 for coreutils test purposes |
Date: |
Fri, 11 Jan 2019 07:48:46 -0500 (EST) |
janneke pushed a commit to branch wip-bootstrap
in repository guix.
commit fdf61d64237bc8ee957cbf36ad808ea88245a182
Author: Jan Nieuwenhuizen <address@hidden>
Date: Fri Jan 11 07:42:35 2019 +0100
WIP: build gcc-core-4.6.4 as gcc-mesboot1 for coreutils test purposes
---
gnu/packages/commencement.scm | 67 ++++++++++++++++++++++++-------
gnu/packages/patches/gcc-boot-4.6.4.patch | 55 +++++++++++++++++++++++++
2 files changed, 107 insertions(+), 15 deletions(-)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index afbf3bc..0dca0c0 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3109,46 +3109,76 @@ ac_cv_c_float_format='IEEE (little-endian)'
(base32
"1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))))
+(define bash-seed
+ (package-with-bootstrap-guile
+ (package
+ (inherit bash)
+ (name "bash-cheat")
+ (source #f)
+ (native-inputs `(("coreutils" ,%bootstrap-coreutils&co)))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:guile ,%bootstrap-guile
+ #:modules ((guix build utils))
+ #:builder (begin
+ (use-modules (guix build utils))
+
+ (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
+ (out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin")))
+ (mkdir-p bindir)
+ (install (string-append coreutils "/bin/bash" bin))
+ #t)))))))
+
(define gcc-mesboot1
(package-with-bootstrap-guile
(package
(inherit gcc-mesboot0)
(name "gcc-mesboot1")
- (version "4.7.4")
+ (version "4.6.4")
(source (origin ;;(inherit (package-source gcc-4.7))
(method url-fetch)
(uri (string-append "mirror://gnu/gcc/gcc-"
- version "/gcc-" version ".tar.gz"))
+ version "/gcc-core-" version ".tar.gz"))
(sha256
(base32
- "06bqygv17f71f7g7pi7ddvhljcr8dimrypgiif9g1r6lqn1sbfnx"))
+ ;;4.7.4
+ ;;"06bqygv17f71f7g7pi7ddvhljcr8dimrypgiif9g1r6lqn1sbfnx"
+ ;;4.6.4
+ "173kdb188qg79pcz073cj9967rs2vzanyjdjyxy9v0xb0p5sad75"
+ ))
;; Patch needs XZ
;; (patches (search-patches "gcc-boot-4.7.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.7.4.patch"))
+ (native-inputs `(;;("boot-patch" ,(search-patch "gcc-boot-4.7.4.patch"))
+ ("boot-patch" ,(search-patch "gcc-boot-4.6.4.patch"))
;; hack -- which tool is broken?
- ("bash" ,%bootstrap-coreutils&co)
+ ;;("bash" ,bash-seed)
("coreutils" ,%bootstrap-coreutils&co)
- ;;("bash" ,bash-mesboot)
+ ;;./libtool: line 1: tr: command not found
+ ;; ("bash" ,bash-mesboot)
+ ("bash" ,bash-mesboot0)
+
;;("binutils" ,binutils-mesboot1)
("binutils" ,binutils-mesboot0)
;;("coreutils" ,coreutils-mesboot)
("diffutils" ,diffutils-mesboot0)
- ;;("gawk" ,gawk-mesboot0)
- ;;("gawk" ,gawk-mesboot1)
+ ("gawk" ,gawk-mesboot1)
+ ("gawk" ,gawk-mesboot0)
("gcc" ,gcc-mesboot0)
- ;; ("gzip" ,gzip-mesboot0)
+ ("gzip" ,gzip-mesboot0)
("libc" ,glibc-mesboot0)
("make" ,make-mesboot)
- ;;("sed" ,sed-mesboot1)
- ;;("tar" ,tar-mesboot2)
+ ("sed" ,sed-mesboot1)
+ ("sed" ,sed-mesboot0)
+ ("tar" ,tar-mesboot2)
- ;;("gash" ,%bootstrap-gash) ; for grep
+ ("gash" ,%bootstrap-gash) ; for grep
("guile" ,%bootstrap-guile)
("kernel-headers" ,%bootstrap-linux-libre-headers)))
(arguments
@@ -3194,7 +3224,8 @@ ac_cv_c_float_format='IEEE (little-endian)'
"--disable-multilib"
"--disable-plugin"
"--disable-threads"
- "--enable-languages=c,c++"
+ ;;"--enable-languages=c,c++"
+ "--enable-languages=c"
"--enable-static"
;; libstdc++.so: error: depends on 'libgcc_s.so.1', which
cannot be found in RUNPATH ()
@@ -3217,8 +3248,12 @@ ac_cv_c_float_format='IEEE (little-endian)'
(add-after 'unpack 'patch
(lambda* (#:key inputs #:allow-other-keys)
(let ((patch-file (assoc-ref inputs "boot-patch")))
- (system* "patch" "--force" "-p1" "-i" patch-file)
- #t)))
+ (system* "patch" "--force" "-p1" "-i" patch-file))
+ ;; For 4.6.4
+ ;; (substitute* "gcc/Makefile.in"
+ ;; (("^NATIVE_SYSTEM_HEADER_DIR = /usr/include" all)
+ ;; (string-append "# " all)))
+ #t))
;; c&p from commencement.scm:gcc-boot0
(add-after 'unpack 'unpack-gmp&co
(lambda* (#:key inputs #:allow-other-keys)
@@ -3375,6 +3410,8 @@ ac_cv_c_float_format='IEEE (little-endian)'
"--build=i686-unknown-linux-gnu"
"--host=i686-unknown-linux-gnu"
+ ;;(string-append "--with-system-header-dir=" glibc
"/include") ;; ADDED!
+ (string-append "--oldincludedir=" glibc "/include") ;;
ADDED! for 4.6.4
(string-append "--with-native-system-header-dir=" glibc
"/include")
(string-append "--with-build-sysroot=" glibc "/include")
diff --git a/gnu/packages/patches/gcc-boot-4.6.4.patch
b/gnu/packages/patches/gcc-boot-4.6.4.patch
new file mode 100644
index 0000000..cb9d06a
--- /dev/null
+++ b/gnu/packages/patches/gcc-boot-4.6.4.patch
@@ -0,0 +1,55 @@
+This patch enables building gcc-4.7.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.
+ * Add SSIZE_MAX define. The SSIZE_MAX define has been added to Mes
+ upstream and can be removed with the next Mes release.
+ * Remove -fbuilding-libgcc flag, it assumes features being present from a
+ newer gcc or glibc.
+ * [MES_BOOTSTRAP_GCC]: Disable threads harder.
+
+Upstream status: not presented upstream.
+
+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
+ LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
+
+ # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
+-NATIVE_SYSTEM_HEADER_DIR = /usr/include
++# NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
+ # 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 94b7a0b89a7..ab2baab55ca 100644
+--- a/gcc/config/host-linux.c
++++ b/gcc/config/host-linux.c
+@@ -23,6 +23,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.
+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
+ will want to define inhibit_libc while building a compiler which
+ can build glibc. */
+
+-#ifndef inhibit_libc
++#if 0 //!defined (inhibit_libc) && !MES_BOOTSTRAP_GCC
+
+ #include <errno.h>
+ #include <pthread.h>