guix-commits
[Top][All Lists]
Advanced

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

69/210: gnu: gcc-boot: Update to 2.6.3.


From: Jan Nieuwenhuizen
Subject: 69/210: gnu: gcc-boot: Update to 2.6.3.
Date: Sat, 8 Sep 2018 10:36:08 -0400 (EDT)

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

commit 2372bb5ff2d53dc8c12b0512b7ad89fc451983e2
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Sun Jun 3 17:31:27 2018 +0200

    gnu: gcc-boot: Update to 2.6.3.
    
    * gnu/packages/mes.scm (gcc-boot): Update to 2.6.3.
    * gnu/packages/patches (gcc-boot-2.6.3.patch): New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                              |   1 +
 gnu/packages/mes.scm                      |  97 ++++++--
 gnu/packages/patches/gcc-boot-2.6.3.patch | 397 ++++++++++++++++++++++++++++++
 3 files changed, 470 insertions(+), 25 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index a2e5385..57c7e1b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -696,6 +696,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/gcc-arm-bug-71399.patch                 \
   %D%/packages/patches/gcc-arm-link-spec-fix.patch             \
   %D%/packages/patches/gcc-asan-missing-include.patch          \
+  %D%/packages/patches/gcc-boot-2.6.3.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 8f0cc51..48fec16 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -40,7 +40,8 @@
   #:use-module (guix git-download)
   #:use-module (guix licenses)
   #:use-module (guix packages)
-  #:use-module (guix utils))
+  #:use-module (guix utils)
+  #:use-module (guix gexp))
 
 (define %fake-bootstrap? #f)  ; cheat using Guile instead of Mes for speed-up?
 
@@ -592,33 +593,79 @@ standard.")
 
 (define-public gcc-boot
   (package
-    ;; (inherit gcc-4.7)
-    (source (package-source gcc-4.7))
+    (inherit gcc)
     (name "gcc-boot")
-    (version "4.7.4")
-    (synopsis (package-synopsis gcc-4.7))
+    (version "2.6.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append 
"https://gcc.gnu.org/pub/gcc/old-releases/gcc-2/gcc-";
+                                  version ".tar.bz2"))
+              ;; tarball contains read-only sources
+              ;; (patches (search-patches "gcc-boot.patch"))
+              (sha256
+               (base32
+                "0h61wd59fbk02pprlxsj67ph8rqw4avfr8bbp85g5isdky277xki"))))
     (supported-systems '("i686-linux"))
-    (build-system gnu-build-system)
-    (native-inputs `(("tcc" ,tcc-boot)))
-    (inputs `(;;("gmp" ,gmp)
-              ;;("mpfr" ,mpfr)
-              ;;("mpc" ,mpc)
-              ;;("libelf" ,libelf)
-              ;;("zlib" ,zlib)
-              ))
+    (native-inputs `(;;("binutils" ,binutils-boot)
+                     ,(let ((triplet "i686-unknown-linux-gnu"))  ;; MORTAL SIN 
HERE
+                        `("binutils" ,(cross-binutils triplet)))
+                     ("mes" ,mes-boot)
+                     ("tcc" ,tcc-boot)
+                     ("patch" ,(local-file (car (search-patches 
"gcc-boot.patch"))))))
+    (outputs '("out"))
     (arguments
-     `(;;#:out-of-source? #t
-       #:configure-flags `("--enable-languages=c"
-                           "--disable-multilib"
-                           ;;,(string-append "CC='mes-tcc " (assoc-ref 
%build-inputs "tcc") "/lib/crt1.mlibc-o'")
-                           "CC=mes-tcc"
-                           "CFLAGS=-static"
-                           "XAR='mes-tcc -ar"
-                           "MAKEINFO=missing")))
-    (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
-    (home-page (package-home-page gcc-4.7))
-    (description (package-description gcc-4.7))
-    (license (package-license gcc-4.7))))
+     `(#:tests? #f                      ; runtest: command not found
+       #:strip-binaries? #f
+       #:make-flags '("CC=tcc -static"
+                      "LANGUAGES=c"
+                      "ALLOCA=alloca.o"
+                      "CC=tcc -static"
+                      "OLDCC=tcc -static")
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'chmod
+           (lambda _
+             (let ((patch (assoc-ref %build-inputs "patch")))
+               (format #t "hiero: ~s\n" (getcwd))
+               (system* "ls" "-ltrF")
+               (system* "chmod" "-R" "+w" ".")
+               (system* "ls" "-ltrF")
+               (system (string-append "patch -p1 < " patch)))))
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (binutils (assoc-ref %build-inputs "binutils")))
+               (setenv "PATH" (string-append
+                               binutils "/i686-unknown-linux-gnu/bin"
+                               ":" (getenv "PATH")))
+               (system* "ls" "-ltrF" (string-append binutils "/bin"))
+               (setenv "CONFIG_SHELL" (string-append
+                                       (assoc-ref %build-inputs "bash")
+                                       "/bin/sh"))
+               ;;(setenv "CPPFLAGS" "-D ANSI_PROTOTYPES=1")
+               (setenv "CC" "tcc -static")
+               (setenv "CPP" "tcc -E")
+               (and
+                (zero?
+                 (system* "./configure"
+                          "--host=i386-unknown-linux"
+                          "--target=i386-unknown-linux"
+                          (string-append "--prefix=" out)))))))
+         (replace 'build
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (let ((tcc-boot (assoc-ref %build-inputs "tcc")))
+               (system* "ar" "r" "libg.a"
+                        (string-append tcc-boot "/lib/x86-mes-gcc/libg.o"))
+               (and (zero? (apply system* (cons "make" make-flags)))
+                    ;; (system* "make" "stage1" "LANGUAGES=c")
+                    ;; (zero? (system* "make" "CC=stage1/xgcc -Bstage1/"
+                    ;;                 (string-append "CFLAGS=-g -O -I" 
tcc-boot "/include")
+                    ;;                 "LANGUAGES=c"))
+                    )))))))))
+
 ;;;
 
 (define-public nyacc
diff --git a/gnu/packages/patches/gcc-boot-2.6.3.patch 
b/gnu/packages/patches/gcc-boot-2.6.3.patch
new file mode 100644
index 0000000..50cdfa7
--- /dev/null
+++ b/gnu/packages/patches/gcc-boot-2.6.3.patch
@@ -0,0 +1,397 @@
+diff -purN -x BOOT ../gcc-2.6.3/cccp.c gcc-2.6.3/cccp.c
+--- ../gcc-2.6.3/cccp.c        1994-11-19 00:54:36.000000000 +0100
++++ gcc-2.6.3/cccp.c   2018-06-04 00:36:12.818522632 +0200
+@@ -9275,7 +9275,7 @@ make_definition (str, op)
+   buf = str;
+   p = str;
+   if (!is_idstart[*p]) {
+-    error ("malformed option `-D %s'", str);
++    error ("malformed option `-D %s'", str , 0, 0);
+     return;
+   }
+   while (is_idchar[*++p])
+@@ -9291,7 +9291,7 @@ make_definition (str, op)
+     strcpy ((char *)buf, str);
+     strcat ((char *)buf, " 1");
+   } else if (*p != '=') {
+-    error ("malformed option `-D %s'", str);
++    error ("malformed option `-D %s'", str, 0, 0);
+     return;
+   } else {
+     U_CHAR *q;
+@@ -9404,14 +9404,14 @@ make_assertion (option, str)
+ 
+   p = buf;
+   if (!is_idstart[*p]) {
+-    error ("malformed option `%s %s'", option, str);
++    error ("malformed option `%s %s'", option, str, 0);
+     return;
+   }
+   while (is_idchar[*++p])
+     ;
+   while (*p == ' ' || *p == '\t') p++;
+   if (! (*p == 0 || *p == '(')) {
+-    error ("malformed option `%s %s'", option, str);
++    error ("malformed option `%s %s'", option, str, 0);
+     return;
+   }
+   
+@@ -9562,7 +9562,7 @@ fatal (str, arg)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0);
+ }
+ 
+ static void
+@@ -9593,13 +9593,13 @@ pipe_closed (signo)
+      /* If this is missing, some compilers complain.  */
+      int signo;
+ {
+-  fatal ("output pipe has been closed");
++  fatal ("output pipe has been closed", 0);
+ }
+ 
+ static void
+ memory_full ()
+ {
+-  fatal ("Memory exhausted.");
++  fatal ("Memory exhausted.", 0);
+ }
+ 
+ 
+diff -purN -x BOOT ../gcc-2.6.3/config/i386/xm-i386.h 
gcc-2.6.3/config/i386/xm-i386.h
+--- ../gcc-2.6.3/config/i386/xm-i386.h 1993-06-26 17:38:04.000000000 +0200
++++ gcc-2.6.3/config/i386/xm-i386.h    2018-06-03 23:06:55.433163307 +0200
+@@ -39,4 +39,7 @@ the Free Software Foundation, 675 Mass A
+ /* target machine dependencies.
+    tm.h is a symbolic link to the actual target specific file.   */
+ 
++/* MesCC has STRERROR */
++#define HAVE_STRERROR 1
++
+ #include "tm.h"
+diff -purN -x BOOT ../gcc-2.6.3/configure gcc-2.6.3/configure
+--- ../gcc-2.6.3/configure     1994-11-23 23:26:27.000000000 +0100
++++ gcc-2.6.3/configure        2018-06-03 17:05:15.344606403 +0200
+@@ -364,9 +364,9 @@ host_install_headers_dir=install-headers
+ host_truncate_target=
+ 
+ # Validate the specs, and canonicalize them.
+-canon_build=`/bin/sh $srcdir/config.sub $build` || exit 1
+-canon_host=`/bin/sh $srcdir/config.sub $host` || exit 1
+-canon_target=`/bin/sh $srcdir/config.sub $target` || exit 1
++canon_build=`sh $srcdir/config.sub $build` || exit 1
++canon_host=`sh $srcdir/config.sub $host` || exit 1
++canon_target=`sh $srcdir/config.sub $target` || exit 1
+ 
+ # Decode the host machine, then the target machine.
+ # For the host machine, we save the xm_file variable as host_xm_file;
+@@ -2432,7 +2432,7 @@ srcdir=$savesrcdir
+ 
+ # Describe the chosen configuration in config.status.
+ # Make that file a shellscript which will reestablish the same configuration.
+-echo "#!/bin/sh
++echo "#
+ # GCC was configured as follows:
+ ${srcdir}/configure" $arguments > config.new
+ echo echo host=$canon_host target=$canon_target build=$canon_build >> 
config.new
+diff -purN -x BOOT ../gcc-2.6.3/enquire.c gcc-2.6.3/enquire.c
+--- ../gcc-2.6.3/enquire.c     1994-04-01 07:21:27.000000000 +0200
++++ gcc-2.6.3/enquire.c        2018-06-04 00:34:46.773094196 +0200
+@@ -1,6 +1,20 @@
+ /* Everything you wanted to know about your machine and C compiler,
+    but didn't know who to ask. */
+ 
++#define stderr 2
++
++#ifndef __MES_JMP_BUF
++#define __MES_JMP_BUF 1
++typedef struct
++{
++  int __bp;
++  int __pc;
++  int __sp;
++} __jmp_buf;
++typedef __jmp_buf jmp_buf[1];
++#endif
++
++
+ #ifndef VERSION
+ #define VERSION "4.3"
+ #endif
+diff -purN -x BOOT ../gcc-2.6.3/genattr.c gcc-2.6.3/genattr.c
+--- ../gcc-2.6.3/genattr.c     1994-09-30 22:23:46.000000000 +0100
++++ gcc-2.6.3/genattr.c        2018-06-01 22:57:51.804254091 +0200
+@@ -228,7 +228,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -257,7 +257,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+@@ -361,7 +361,7 @@ from the machine description file `md'.
+         else if (unit->multiplicity != multiplicity
+                  || unit->simultaneity != simultaneity)
+           fatal ("Differing specifications given for `%s' function unit.",
+-                 unit->name);
++                 unit->name, 0);
+ 
+         extend_range (&unit->ready_cost, ready_cost, ready_cost);
+         extend_range (&unit->issue_delay,
+diff -purN -x BOOT ../gcc-2.6.3/genattrtab.c gcc-2.6.3/genattrtab.c
+--- ../gcc-2.6.3/genattrtab.c  1994-10-13 15:44:20.000000000 +0100
++++ gcc-2.6.3/genattrtab.c     2018-06-03 08:44:38.361893914 +0200
+@@ -5480,7 +5480,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ /* Determine if an insn has a constant number of delay slots, i.e., the
+@@ -5552,7 +5552,7 @@ main (argc, argv)
+   obstack_init (temp_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/gencodes.c gcc-2.6.3/gencodes.c
+--- ../gcc-2.6.3/gencodes.c    1992-10-13 05:11:44.000000000 +0100
++++ gcc-2.6.3/gencodes.c       2018-06-01 22:58:26.092810856 +0200
+@@ -90,7 +90,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -105,7 +105,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genconfig.c gcc-2.6.3/genconfig.c
+--- ../gcc-2.6.3/genconfig.c   1994-06-15 09:37:01.000000000 +0200
++++ gcc-2.6.3/genconfig.c      2018-06-01 22:58:34.272943664 +0200
+@@ -274,7 +274,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -289,7 +289,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genemit.c gcc-2.6.3/genemit.c
+--- ../gcc-2.6.3/genemit.c     1994-03-12 13:37:41.000000000 +0100
++++ gcc-2.6.3/genemit.c        2018-06-01 23:00:20.918674405 +0200
+@@ -704,7 +704,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -719,7 +719,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genextract.c gcc-2.6.3/genextract.c
+--- ../gcc-2.6.3/genextract.c  1994-09-02 04:13:37.000000000 +0200
++++ gcc-2.6.3/genextract.c     2018-06-03 08:44:16.617547222 +0200
+@@ -376,7 +376,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ static char *
+@@ -417,7 +417,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genflags.c gcc-2.6.3/genflags.c
+--- ../gcc-2.6.3/genflags.c    1992-10-13 05:12:01.000000000 +0100
++++ gcc-2.6.3/genflags.c       2018-06-02 12:46:15.084189190 +0200
+@@ -205,7 +205,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -226,7 +226,7 @@ main (argc, argv)
+   obstack_init (&normal_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genopinit.c gcc-2.6.3/genopinit.c
+--- ../gcc-2.6.3/genopinit.c   1994-06-29 02:15:33.000000000 +0200
++++ gcc-2.6.3/genopinit.c      2018-06-01 22:57:42.916109746 +0200
+@@ -317,7 +317,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -334,7 +334,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genoutput.c gcc-2.6.3/genoutput.c
+--- ../gcc-2.6.3/genoutput.c   1994-09-27 23:27:28.000000000 +0100
++++ gcc-2.6.3/genoutput.c      2018-06-01 22:59:49.198159749 +0200
+@@ -914,7 +914,7 @@ fatal (s, a1, a2, a3, a4)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0, 0, 0);
+ }
+ 
+ static void
+@@ -940,7 +940,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0, 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/genpeep.c gcc-2.6.3/genpeep.c
+--- ../gcc-2.6.3/genpeep.c     1992-10-13 05:12:10.000000000 +0100
++++ gcc-2.6.3/genpeep.c        2018-06-01 22:58:47.449157569 +0200
+@@ -422,7 +422,7 @@ fatal (s, a1, a2)
+ void
+ fancy_abort ()
+ {
+-  fatal ("Internal gcc abort.");
++  fatal ("Internal gcc abort.", 0, 0);
+ }
+ 
+ int
+@@ -439,7 +439,7 @@ main (argc, argv)
+   obstack_init (rtl_obstack);
+ 
+   if (argc <= 1)
+-    fatal ("No input file name.");
++    fatal ("No input file name.", 0, 0);
+ 
+   infile = fopen (argv[1], "r");
+   if (infile == 0)
+diff -purN -x BOOT ../gcc-2.6.3/INSTALL gcc-2.6.3/INSTALL
+--- ../gcc-2.6.3/INSTALL       1994-12-01 21:24:17.000000000 +0100
++++ gcc-2.6.3/INSTALL  2018-06-01 23:05:59.616162989 +0200
+@@ -1,4 +1,4 @@
+-This file documents the installation of the GNU compiler.  Copyright
++,This file documents the installation of the GNU compiler.  Copyright
+ (C) 1988, 1989, 1992 Free Software Foundation, Inc.  You may copy,
+ distribute, and modify it freely as long as you preserve this copyright
+ notice and permission notice.
+Binary files ../gcc-2.6.3/libg.a and gcc-2.6.3/libg.a differ
+diff -purN -x BOOT ../gcc-2.6.3/libgcc2.c gcc-2.6.3/libgcc2.c
+--- ../gcc-2.6.3/libgcc2.c     1994-10-21 20:13:56.000000000 +0100
++++ gcc-2.6.3/libgcc2.c        2018-06-04 00:33:41.008002409 +0200
+@@ -35,6 +35,26 @@ the Free Software Foundation, 675 Mass A
+ #include <stddef.h>
+ #endif
+ 
++/*
++ mysteriously missing decls
++ */
++#define stderr 2
++#define BITS_PER_UNIT 8
++#define LONG_MIN -2147483648
++typedef unsigned short word_type;
++
++#if !defined (SIZE_T) && !defined (_SIZE_T)
++#define SIZE_T
++#define _SIZE_T
++typedef long unsigned int size_t;
++#endif
++
++#if !defined (_FILE_T)
++#define FILE_T
++#define _FILE_T
++typedef int *FILE;
++#endif
++
+ /* Don't use `fancy_abort' here even if config.h says to use it.  */
+ #ifdef abort
+ #undef abort
+diff -purN -x BOOT ../gcc-2.6.3/protoize.c gcc-2.6.3/protoize.c
+--- ../gcc-2.6.3/protoize.c    1994-11-08 03:27:44.000000000 +0100
++++ gcc-2.6.3/protoize.c       2018-06-01 22:55:10.161627579 +0200
+@@ -56,7 +56,11 @@ the Free Software Foundation, 675 Mass A
+ #define _POSIX_SOURCE
+ #endif
+ 
++#ifdef __STDC__
++#include <stdarg.h>
++#else
+ #include <varargs.h>
++#endif
+ /* On some systems stdio.h includes stdarg.h;
+    we must bring in varargs.h first.  */
+ #include <stdio.h>



reply via email to

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