me
/
guix
Archived
1
0
Fork 0

gnu: commencement: gcc-core-mesboot0: Use Gash instead of coretutils&co.

* gnu/packages/commencement.scm (gcc-core-mesboot0): Rename from
gcc-core-mesboot; Use Gash instead of coretutils&co.
master
Jan Nieuwenhuizen 2019-10-06 19:29:01 +02:00
parent cb167958ea
commit 066169601c
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 63 additions and 56 deletions

View File

@ -1248,36 +1248,32 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
(("[.]//dev/null") "/dev/null")) (("[.]//dev/null") "/dev/null"))
(invoke "sh" "./config.status")))))))) (invoke "sh" "./config.status"))))))))
(define gcc-core-mesboot (define gcc-core-mesboot0
;; Gcc-2.95.3 is the most recent GCC that is supported by what the Mes C ;; Gcc-2.95.3 is the most recent GCC that is supported by what the Mes C
;; Library v0.16 offers. Gcc-3.x (and 4.x) place higher demands on a C ;; Library v0.16 offers. Gcc-3.x (and 4.x) place higher demands on a C
;; library, such as dir.h/struct DIR/readdir, locales, signals... Also, ;; library, such as dir.h/struct DIR/readdir, locales, signals... Also,
;; with gcc-2.95.3, binutils-boot-2.20.1a and glibc-2.2.5 we found a GNU ;; with gcc-2.95.3, binutils (2.14.0, 2.20.1a) and glibc-2.2.5 we found a
;; toolchain triplet "that works". ;; GNU toolchain triplet "that works".
(package (package
(inherit gcc) (inherit gcc)
(name "gcc-core-mesboot") (name "gcc-core-mesboot0")
(version "2.95.3") (version "2.95.3")
(source (bootstrap-origin (source (origin
(origin
(method url-fetch) (method url-fetch)
(uri (string-append "mirror://gnu/gcc/gcc-2.95.3/gcc-core-" (uri (string-append "mirror://gnu/gcc/gcc-2.95.3/gcc-core-"
version version
".tar.gz")) ".tar.gz"))
(patches (search-patches "gcc-boot-2.95.3.patch")) ;; `patches' needs XZ
;; (patches (search-patches "gcc-boot-2.95.3.patch"))
(sha256 (sha256
(base32 (base32
"1xvfy4pqhrd5v2cv8lzf63iqg92k09g6z9n2ah6ndd4h17k1x0an"))))) "1xvfy4pqhrd5v2cv8lzf63iqg92k09g6z9n2ah6ndd4h17k1x0an"))))
(supported-systems '("i686-linux" "x86_64-linux")) (supported-systems '("i686-linux" "x86_64-linux"))
(inputs '()) (inputs '())
(propagated-inputs '()) (propagated-inputs '())
(native-inputs `(("binutils" ,binutils-mesboot0) (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-2.95.3.patch"))
("tcc" ,tcc-boot) ("binutils" ,binutils-mesboot0)
,@(%boot-tcc-inputs)))
("bash" ,%bootstrap-coreutils&co)
("coreutils" ,%bootstrap-coreutils&co)
("diffutils" ,diffutils-mesboot)
("make" ,make-mesboot0)))
(outputs '("out")) (outputs '("out"))
(arguments (arguments
`(#:implicit-inputs? #f `(#:implicit-inputs? #f
@ -1293,17 +1289,17 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
"--build=i686-unknown-linux-gnu" "--build=i686-unknown-linux-gnu"
"--host=i686-unknown-linux-gnu" "--host=i686-unknown-linux-gnu"
,(string-append "--prefix=" out))) ,(string-append "--prefix=" out)))
#:make-flags (list #:make-flags
"CC=tcc -static -D __GLIBC_MINOR__=6" `("CC=tcc -static -D __GLIBC_MINOR__=6"
"OLDCC=tcc -static -D __GLIBC_MINOR__=6" "OLDCC=tcc -static -D __GLIBC_MINOR__=6"
"CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6" "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6"
"AR=ar" "AR=ar"
"RANLIB=ranlib" "RANLIB=ranlib"
(string-append "LIBGCC2_INCLUDES=-I " ,(string-append "LIBGCC2_INCLUDES=-I "
(assoc-ref %build-inputs "tcc") (assoc-ref %build-inputs "tcc")
"/include") "/include")
"LANGUAGES=c" "LANGUAGES=c"
(string-append "BOOT_LDFLAGS=" ,(string-append "BOOT_LDFLAGS="
" -B" (assoc-ref %build-inputs "tcc") " -B" (assoc-ref %build-inputs "tcc")
"/lib/")) "/lib/"))
#:modules ((guix build gnu-build-system) #:modules ((guix build gnu-build-system)
@ -1311,14 +1307,19 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
(srfi srfi-1)) (srfi srfi-1))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; gcc-2.95.3 needs more traditional configure (add-after 'unpack 'apply-boot-patch
(lambda* (#:key inputs #:allow-other-keys)
(let ((patch-file (assoc-ref inputs "boot-patch")))
(system* "patch" "--force" "-p1" "-i" patch-file)
#t)))
(add-before 'configure 'setenv (add-before 'configure 'setenv
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(bash (assoc-ref %build-inputs "bash")) (bash (assoc-ref %build-inputs "bash"))
(shell (string-append bash "/bin/bash"))
(tcc (assoc-ref %build-inputs "tcc")) (tcc (assoc-ref %build-inputs "tcc"))
(cppflags " -D __GLIBC_MINOR__=6")) (cppflags " -D __GLIBC_MINOR__=6"))
(setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) (setenv "CONFIG_SHELL" shell)
(setenv "CPPFLAGS" cppflags) (setenv "CPPFLAGS" cppflags)
(setenv "CC" (string-append "tcc" cppflags)) (setenv "CC" (string-append "tcc" cppflags))
(setenv "CC_FOR_BUILD" (string-append "tcc" cppflags)) (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags))
@ -1327,9 +1328,9 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
(lambda _ (lambda _
(display " (display "
ac_cv_c_float_format='IEEE (little-endian)' ac_cv_c_float_format='IEEE (little-endian)'
"))) "))))))
#t))) ;; gcc-2.95.3
(replace 'configure (replace 'configure ; needs classic invocation of configure
(lambda* (#:key configure-flags #:allow-other-keys) (lambda* (#:key configure-flags #:allow-other-keys)
(format (current-error-port) (format (current-error-port)
"running ./configure ~a\n" (string-join configure-flags)) "running ./configure ~a\n" (string-join configure-flags))
@ -1347,18 +1348,18 @@ ac_cv_c_float_format='IEEE (little-endian)'
(gcc-dir (string-append (gcc-dir (string-append
out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3"))) out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
(mkdir-p "tmp") (mkdir-p "tmp")
(zero? (system (string-append "set -x; cd tmp && ar x ../gcc/libgcc2.a"))) (with-directory-excursion "tmp"
(zero? (system (string-append "set -x; cd tmp && ar r " gcc-dir "/libgcc.a *.o"))) (invoke "ar" "x" (string-append "../gcc/libgcc2.a"))
(invoke "ar" "x" (string-append tcc "/lib/libtcc1.a"))
(apply invoke "ar" "r" (string-append gcc-dir "/libgcc.a")
(find-files "." "\\.o")))
(copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a")) (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a"))
(copy-file (string-append tcc "/lib/libtcc1.a") (copy-file (string-append tcc "/lib/libtcc1.a")
(string-append out "/lib/libtcc1.a")) (string-append out "/lib/libtcc1.a"))
(invoke "ar" "x" (string-append tcc "/lib/libtcc1.a"))
(invoke "ar" "x" (string-append tcc "/lib/libc.a"))
(invoke "ar" "r" (string-append gcc-dir "/libc.a") (invoke "ar" "r" (string-append gcc-dir "/libc.a")
(string-append tcc-lib "/libc+gnu.o") "libc.o" "libtcc1.o")
(string-append tcc-lib "/libtcc1.o"))
(invoke "ar" "r" (string-append out "/lib/libc.a")
(string-append tcc-lib "/libc+gnu.o")
(string-append tcc-lib "/libtcc1.o"))
(invoke "ls" "-ltrF" gcc-dir)
#t)))))) #t))))))
(native-search-paths (native-search-paths
(list (search-path-specification (list (search-path-specification
@ -1371,6 +1372,12 @@ ac_cv_c_float_format='IEEE (little-endian)'
(variable "LIBRARY_PATH") (variable "LIBRARY_PATH")
(files '("lib"))))))) (files '("lib")))))))
(define (%boot-mesboot-core-inputs)
`(("binutils" ,binutils-mesboot0)
("gawk" ,gawk-mesboot0)
("gcc" ,gcc-core-mesboot0)
,@(alist-delete "tcc" (%boot-tcc-inputs))))
(define mesboot-headers (define mesboot-headers
(package (package
(inherit mes-boot) (inherit mes-boot)
@ -1421,7 +1428,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
(inputs '()) (inputs '())
(propagated-inputs '()) (propagated-inputs '())
(native-inputs `(("binutils" ,binutils-mesboot0) (native-inputs `(("binutils" ,binutils-mesboot0)
("gcc" ,gcc-core-mesboot) ("gcc" ,gcc-core-mesboot0)
("bash" ,%bootstrap-coreutils&co) ("bash" ,%bootstrap-coreutils&co)
("coreutils" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co)
@ -1483,7 +1490,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
(define gcc-mesboot0 (define gcc-mesboot0
(package (package
(inherit gcc-core-mesboot) (inherit gcc-core-mesboot0)
(name "gcc-mesboot0") (name "gcc-mesboot0")
(native-inputs `(("binutils" ,binutils-mesboot0) (native-inputs `(("binutils" ,binutils-mesboot0)
@ -1491,14 +1498,14 @@ ac_cv_c_float_format='IEEE (little-endian)'
;; #include_next purposes. ;; #include_next purposes.
("libc" ,glibc-mesboot0) ("libc" ,glibc-mesboot0)
("kernel-headers" ,%bootstrap-linux-libre-headers) ("kernel-headers" ,%bootstrap-linux-libre-headers)
("gcc" ,gcc-core-mesboot) ("gcc" ,gcc-core-mesboot0)
("bash" ,%bootstrap-coreutils&co) ("bash" ,%bootstrap-coreutils&co)
("coreutils" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co)
("diffutils" ,diffutils-mesboot) ("diffutils" ,diffutils-mesboot)
("make" ,make-mesboot0))) ("make" ,make-mesboot0)))
(arguments (arguments
(substitute-keyword-arguments (package-arguments gcc-core-mesboot) (substitute-keyword-arguments (package-arguments gcc-core-mesboot0)
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases `(modify-phases ,phases
(replace 'setenv (replace 'setenv
@ -1645,7 +1652,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
("diffutils" ,diffutils-mesboot) ("diffutils" ,diffutils-mesboot)
("make" ,make-mesboot))) ("make" ,make-mesboot)))
(arguments (arguments
(substitute-keyword-arguments (package-arguments gcc-core-mesboot) (substitute-keyword-arguments (package-arguments gcc-core-mesboot0)
((#:make-flags make-flags) ((#:make-flags make-flags)
`(let* ((libc (assoc-ref %build-inputs "libc")) `(let* ((libc (assoc-ref %build-inputs "libc"))
(ldflags (string-append (ldflags (string-append