guix-commits
[Top][All Lists]
Advanced

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

62/192: gnu: Add binutils-boot 2.5.1.


From: Jan Nieuwenhuizen
Subject: 62/192: gnu: Add binutils-boot 2.5.1.
Date: Mon, 3 Sep 2018 16:24:52 -0400 (EDT)

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

commit 1f1e76e1f8646e958b82ec23ac0bc8514487cfb7
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Fri Jun 1 14:17:29 2018 +0200

    gnu: Add binutils-boot 2.5.1.
    
    * gnu/packages/mes.scm (binutils-boot): New variable.
---
 gnu/local.mk                             |   1 +
 gnu/packages/mes.scm                     |  50 ++++++++
 gnu/packages/patches/binutils-boot.patch | 207 +++++++++++++++++++++++++++++++
 3 files changed, 258 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index a2e5385..502413f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -594,6 +594,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/bazaar-CVE-2017-14176.patch             \
   %D%/packages/patches/beignet-correct-file-names.patch                \
   %D%/packages/patches/binutils-aarch64-symbol-relocation.patch        \
+  %D%/packages/patches/binutils-boot.patch                     \
   %D%/packages/patches/binutils-loongson-workaround.patch      \
   %D%/packages/patches/blast+-fix-makefile.patch               \
   %D%/packages/patches/boost-fix-icu-build.patch               \
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 0c5aea7..494f4fb 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -540,6 +540,56 @@ standard.")
                 (system* "./configure"
                          (string-append "--prefix=" out)))))))))))
 
+(define-public binutils-boot
+  (package
+    (inherit binutils)
+    (name "binutils-boot")
+    (version "2.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append 
"https://gcc.gnu.org/pub/binutils/old-releases/binutils-";
+                                  version ".tar.bz2"))
+              (patches (search-patches "binutils-boot.patch"))
+              (sha256
+               (base32
+                "0nbhihxikyj5zg4fkf9gqx9b2rd1s47pid30rk8z8dvkvgpbmsin"))))
+    (supported-systems '("i686-linux"))
+    (native-inputs `(("mes" ,mes-boot)
+                     ("tcc" ,tcc-boot)))
+    (arguments
+     `(#:tests? #f                      ; runtest: command not found
+       #:strip-binaries? #f
+       #:make-flags '("CC=tcc -static -DANSI_PROTOTYPES=1"
+                      "AR=tcc -ar"
+                      "RANLIB=true")
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "CONFIG_SHELL" (string-append
+                                       (assoc-ref %build-inputs "bash")
+                                       "/bin/sh"))
+               (setenv "CPPFLAGS" "-D ANSI_PROTOTYPES=1")
+               (setenv "AR" "tcc -ar")
+               (setenv "RANLIB" "true")
+               (setenv "CC" "tcc -static -D ANSI_PROTOTYPES=1")
+               (setenv "CPP" "tcc -E -D ANSI_PROTOTYPES=1")
+               (and
+                (zero?
+                 (system* "./configure"
+                          "--host=i386-unknown-linux"
+                          "--target=i386-unknown-linux"
+                          (string-append "--prefix=" out)))
+                (with-directory-excursion "gas"
+                  (zero?
+                   (system* "./configure"
+                            "--host=i386-unknown-linux"
+                            "--target=i386-unknown-linux"))))))))))))
+
 (define-public gcc-boot
   (package
     ;; (inherit gcc-4.7)
diff --git a/gnu/packages/patches/binutils-boot.patch 
b/gnu/packages/patches/binutils-boot.patch
new file mode 100644
index 0000000..fc235a5
--- /dev/null
+++ b/gnu/packages/patches/binutils-boot.patch
@@ -0,0 +1,207 @@
+diff -purN -x BOOT ../binutils-2.5.1/bfd/elfcode.h binutils-2.5.1/bfd/elfcode.h
+--- ../binutils-2.5.1/bfd/elfcode.h    1994-10-22 02:28:00.000000000 +0100
++++ binutils-2.5.1/bfd/elfcode.h       2018-05-31 18:16:42.317716523 +0200
+@@ -430,8 +430,7 @@ elf_swap_dyn_out (abfd, src, dst)
+ /* String table creation/manipulation routines */
+ 
+ static struct strtab *
+-bfd_new_strtab (abfd)
+-     bfd *abfd;
++bfd_new_strtab ()
+ {
+   struct strtab *ss;
+ 
+diff -purN -x BOOT ../binutils-2.5.1/binutils/bucomm.c 
binutils-2.5.1/binutils/bucomm.c
+--- ../binutils-2.5.1/binutils/bucomm.c        1994-09-16 06:03:34.000000000 
+0200
++++ binutils-2.5.1/binutils/bucomm.c   2018-05-31 18:19:33.880540023 +0200
+@@ -31,6 +31,8 @@
+ #include <varargs.h>
+ #endif
+ 
++#include <time.h>
++
+ char *target = NULL;          /* default as late as possible */
+ 
+ /* Error reporting */
+diff -purN -x BOOT ../binutils-2.5.1/gas/configure binutils-2.5.1/gas/configure
+--- ../binutils-2.5.1/gas/configure    1994-10-21 23:06:58.000000000 +0100
++++ binutils-2.5.1/gas/configure       2018-06-04 18:50:02.753645522 +0200
+@@ -383,7 +383,7 @@ fi
+ 
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+-ac_cpp='$CPP $CPPFLAGS'
++ac_cpp="$CPP $CPPFLAGS"
+ ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest 
$LIBS 1>&5 2>&5'
+ 
+ if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+diff -purN -x BOOT ../binutils-2.5.1/gas/Makefile.in 
binutils-2.5.1/gas/Makefile.in
+--- ../binutils-2.5.1/gas/Makefile.in  1994-10-22 11:47:53.000000000 +0100
++++ binutils-2.5.1/gas/Makefile.in     2018-06-01 07:15:33.129518156 +0200
+@@ -372,7 +372,7 @@ input-file.o : input-file.c as.h \
+    targ-env.h obj-format.h targ-cpu.h \
+    struc-symbol.h write.h flonum.h bignum.h expr.h \
+   frags.h hash.h read.h symbols.h tc.h obj.h input-file.h 
+-input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
++input-scrub.o : input-scrub.c \
+   as.h targ-env.h obj-format.h \
+   targ-cpu.h  struc-symbol.h \
+   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h 
\
+diff -purN -x BOOT ../binutils-2.5.1/gprof/gprof.c binutils-2.5.1/gprof/gprof.c
+--- ../binutils-2.5.1/gprof/gprof.c    1994-08-30 17:15:09.000000000 +0200
++++ binutils-2.5.1/gprof/gprof.c       2018-05-31 20:14:21.806637821 +0200
+@@ -339,7 +339,7 @@ gettextspace( abfd )
+     return;
+   }
+ 
+-  textspace = (u_char *) malloc( texsec->_cooked_size );
++  textspace = (unsigned char *) malloc( texsec->_cooked_size );
+ 
+   if ( textspace == 0 ) {
+     fprintf( stderr , "%s: ran out room for %d bytes of text space:  " ,
+diff -purN -x BOOT ../binutils-2.5.1/gprof/printgprof.c 
binutils-2.5.1/gprof/printgprof.c
+--- ../binutils-2.5.1/gprof/printgprof.c       1994-10-22 00:00:12.000000000 
+0100
++++ binutils-2.5.1/gprof/printgprof.c  2018-06-01 22:26:06.513709826 +0200
+@@ -760,6 +760,7 @@ printindex()
+     free( namesortnlp );
+ }
+ 
++#if 0
+ PTR
+ xmalloc (size)
+      long size;
+@@ -784,4 +785,4 @@ xrealloc (oldval, size)
+     }
+     return val;
+ }
+-
++#endif
+Binary files ../binutils-2.5.1/intl and binutils-2.5.1/intl differ
+diff -purN -x BOOT ../binutils-2.5.1/ld/ldmisc.c binutils-2.5.1/ld/ldmisc.c
+--- ../binutils-2.5.1/ld/ldmisc.c      1994-09-15 19:07:07.000000000 +0200
++++ binutils-2.5.1/ld/ldmisc.c 2018-06-01 21:39:38.354292903 +0200
+@@ -21,7 +21,11 @@ the Free Software Foundation, 675 Mass A
+ 
+ #include "bfd.h"
+ #include "sysdep.h"
++#ifdef ANSI_PROTOTYPES
++#include <stdarg.h>
++#else
+ #include <varargs.h>
++#endif
+ #include <demangle.h>
+ 
+ #include "ld.h"
+@@ -340,6 +344,12 @@ vfinfo(fp, fmt, arg)
+ /* (You would think this should be called just "info", but then you would
+    hosed by LynxOS, which defines that name in its libc.) */
+ 
++#ifdef ANSI_PROTOTYPES
++void info_msg(char *fmt, ...)
++{
++  va_list arg;
++  va_start (arg, fmt);
++#else
+ void info_msg(va_alist)
+      va_dcl
+ {
+@@ -347,12 +357,19 @@ void info_msg(va_alist)
+   va_list arg;
+   va_start(arg);
+   fmt = va_arg(arg, char *);
++#endif
+   vfinfo(stdout, fmt, arg);
+   va_end(arg);
+ }
+ 
+ /* ('e' for error.) Format info message and print on stderr. */
+ 
++#ifdef ANSI_PROTOTYPES
++void einfo(char *fmt, ...)
++{
++  va_list arg;
++  va_start (arg, fmt);
++#else
+ void einfo(va_alist)
+      va_dcl
+ {
+@@ -360,6 +377,7 @@ void einfo(va_alist)
+   va_list arg;
+   va_start(arg);
+   fmt = va_arg(arg, char *);
++#endif
+   vfinfo(stderr, fmt, arg);
+   va_end(arg);
+ }
+@@ -385,18 +403,34 @@ buystring (x)
+ 
+ /* ('m' for map) Format info message and print on map. */
+ 
+-void minfo(va_alist)
++#ifdef ANSI_PROTOTYPES
++void
++minfo(char* fmt, ...)
++{
++  va_list arg;
++  va_start (arg, fmt);
++#else
++void
++minfo(va_alist)
+      va_dcl
+ {
+   char *fmt;
+   va_list arg;
+   va_start(arg);
+   fmt = va_arg(arg, char *);
++#endif
+   vfinfo(config.map_file, fmt, arg);
+   va_end(arg);
+ }
+ 
+ 
++#ifdef ANSI_PROTOTYPES
++static void
++finfo (char *fmt, FILE *file, ...)
++{
++  va_list arg;
++  va_start (arg, file);
++#else
+ static void
+ finfo (va_alist)
+      va_dcl
+@@ -407,6 +441,7 @@ finfo (va_alist)
+   va_start (arg);
+   file = va_arg (arg, FILE *);
+   fmt = va_arg (arg, char *);
++#endif
+   vfinfo (file, fmt, arg);
+   va_end (arg);
+ }
+diff -purN -x BOOT ../binutils-2.5.1/libiberty/functions.def 
binutils-2.5.1/libiberty/functions.def
+--- ../binutils-2.5.1/libiberty/functions.def  1994-10-12 01:50:12.000000000 
+0100
++++ binutils-2.5.1/libiberty/functions.def     2018-05-31 21:08:56.576212413 
+0200
+@@ -16,7 +16,7 @@ DEF(clock, clock_t, (), NOTHING)
+ DEF(getopt, int, (argc, argv, optstring),
+       int argc AND char **argv AND CONST char *optstring)     
+ DEF(getpagesize, int , (), NOTHING)
+-DEF(getcwd, char*, (buf, len), char *buf AND int len)
++DEF(getcwd, char*, (buf, len), char *buf AND size_t len)
+ DEF(index, char*, (s, c), char *s AND int c)
+ DEF(insque, void, (), NOTHING)
+ DEF(memchr, PTR, (s, c, length), CONST PTR s AND int c AND size_t length)
+diff -purN -x BOOT ../binutils-2.5.1/libiberty/vasprintf.c 
binutils-2.5.1/libiberty/vasprintf.c
+--- ../binutils-2.5.1/libiberty/vasprintf.c    1994-08-24 23:10:21.000000000 
+0200
++++ binutils-2.5.1/libiberty/vasprintf.c       2018-05-31 18:18:55.491908205 
+0200
+@@ -20,7 +20,12 @@ Cambridge, MA 02139, USA.  */
+ 
+ #include <stdio.h>
+ #include <string.h>
++
++#ifdef ANSI_PROTOTYPES
++#include <stdarg.h>
++#else
+ #include <varargs.h>
++#endif
+ 
+ #ifdef TEST
+ int global_total_width;



reply via email to

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