distro: Add a statically-linked GCC for bootstrapping.
* distro/packages/base.scm (%gcc-static): New variable. (%gcc-stripped): Use it.
This commit is contained in:
parent
83ce0cf1f1
commit
5155fb89b2
|
@ -2288,15 +2288,53 @@ store.")
|
||||||
#t))))
|
#t))))
|
||||||
(inputs `(("libc" ,glibc-final)))))
|
(inputs `(("libc" ,glibc-final)))))
|
||||||
|
|
||||||
(define %gcc-stripped
|
(define %gcc-static
|
||||||
|
;; A statically-linked GCC, with stripped-down functionality.
|
||||||
(package (inherit gcc-final)
|
(package (inherit gcc-final)
|
||||||
|
(name "gcc-static")
|
||||||
|
(arguments
|
||||||
|
(lambda (system)
|
||||||
|
`(#:modules ((guix build utils)
|
||||||
|
(guix build gnu-build-system)
|
||||||
|
(srfi srfi-1)
|
||||||
|
(srfi srfi-26)
|
||||||
|
(ice-9 regex))
|
||||||
|
,@(substitute-keyword-arguments ((package-arguments gcc-final) system)
|
||||||
|
((#:guile _) #f)
|
||||||
|
((#:implicit-inputs? _) #t)
|
||||||
|
((#:configure-flags flags)
|
||||||
|
`(append (list
|
||||||
|
"--disable-shared"
|
||||||
|
"--disable-plugin"
|
||||||
|
"--enable-languages=c"
|
||||||
|
"--disable-libmudflap"
|
||||||
|
"--disable-libgomp"
|
||||||
|
"--disable-libssp"
|
||||||
|
"--disable-libquadmath"
|
||||||
|
"--disable-decimal-float")
|
||||||
|
(remove (cut string-match "--(.*plugin|enable-languages)" <>)
|
||||||
|
,flags)))
|
||||||
|
((#:make-flags flags)
|
||||||
|
`(cons "BOOT_LDFLAGS=-static" ,flags))))))
|
||||||
|
(inputs `(("gmp-source" ,(package-source gmp))
|
||||||
|
("mpfr-source" ,(package-source mpfr))
|
||||||
|
("mpc-source" ,(package-source mpc))
|
||||||
|
("binutils" ,binutils-final)
|
||||||
|
,@(package-inputs gcc-4.7)))))
|
||||||
|
|
||||||
|
(define %gcc-stripped
|
||||||
|
;; The subset of GCC files needed for bootstrap.
|
||||||
|
(package (inherit gcc-4.7)
|
||||||
(name "gcc-stripped")
|
(name "gcc-stripped")
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
|
(source #f)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:modules ((guix build utils))
|
`(#:modules ((guix build utils))
|
||||||
#:builder
|
#:builder
|
||||||
(begin
|
(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (srfi srfi-1)
|
||||||
|
(srfi srfi-26)
|
||||||
|
(guix build utils))
|
||||||
|
|
||||||
(setvbuf (current-output-port) _IOLBF)
|
(setvbuf (current-output-port) _IOLBF)
|
||||||
(let* ((out (assoc-ref %outputs "out"))
|
(let* ((out (assoc-ref %outputs "out"))
|
||||||
|
@ -2307,15 +2345,12 @@ store.")
|
||||||
(for-each remove-store-references
|
(for-each remove-store-references
|
||||||
(find-files bindir ".*"))
|
(find-files bindir ".*"))
|
||||||
|
|
||||||
(mkdir-p libdir)
|
(copy-recursively (string-append gcc "/lib") libdir)
|
||||||
(for-each (lambda (file)
|
(for-each remove-store-references
|
||||||
(let ((target (string-append libdir "/"
|
(remove (cut string-suffix? ".h" <>)
|
||||||
(basename file))))
|
(find-files libdir ".*")))
|
||||||
(copy-file file target)
|
|
||||||
(remove-store-references target)))
|
|
||||||
(find-files (string-append gcc "/lib") "^libgcc_s.*"))
|
|
||||||
#t))))
|
#t))))
|
||||||
(inputs `(("gcc" ,gcc-final)))))
|
(inputs `(("gcc" ,%gcc-static)))))
|
||||||
|
|
||||||
(define %guile-static
|
(define %guile-static
|
||||||
;; A statically-linked Guile that is relocatable--i.e., it can search
|
;; A statically-linked Guile that is relocatable--i.e., it can search
|
||||||
|
|
Loading…
Reference in New Issue