;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module (guix build-system trivial)
#:use-module (guix build-system gnu)
#:use-module ((gnu packages) #:select (search-patch))
+ #:use-module ((gnu packages commencement) #:select (%final-inputs))
#:use-module (gnu packages base)
#:use-module (gnu packages cross-base)
#:use-module (gnu packages bash)
%glibc-bootstrap-tarball
%gcc-bootstrap-tarball
%guile-bootstrap-tarball
- %bootstrap-tarballs))
+ %bootstrap-tarballs
+
+ %guile-static-stripped))
;;; Commentary:
;;;
,@%final-inputs))
`(("libc" ,(glibc-for-bootstrap))
("gcc" ,(package (inherit gcc-4.8)
+ (outputs '("out")) ; all in one so libgcc_s is easily found
(inputs
`(("libc",(glibc-for-bootstrap))
,@(package-inputs gcc-4.8)))))
(copy-recursively (string-append linux "/include/asm-generic")
(string-append incdir "/asm-generic"))
- ;; Remove the '.install' and '..install.cmd' files; the latter
- ;; contains store paths, which prevents bit reproducibility.
- (for-each delete-file (find-files incdir "\\.install"))
-
#t))))
(inputs `(("libc" ,(let ((target (%current-target-system)))
(if target
(package-with-relocatable-glibc
(package (inherit gcc-4.8)
(name "gcc-static")
+ (outputs '("out")) ; all in one
(arguments
`(#:modules ((guix build utils)
(guix build gnu-build-system)
((#:implicit-inputs? _) #t)
((#:configure-flags flags)
`(append (list
+ ;; We don't need a full bootstrap here.
+ "--disable-bootstrap"
+
+ ;; Make sure '-static' is passed where it matters.
+ "--with-stage1-ldflags=-static"
+
+ ;; GCC 4.8+ requires a C++ compiler and library.
+ "--enable-languages=c,c++"
+
+ ;; Make sure gcc-nm doesn't require liblto_plugin.so.
+ "--disable-lto"
+
"--disable-shared"
"--disable-plugin"
- "--enable-languages=c"
"--disable-libmudflap"
"--disable-libatomic"
"--disable-libsanitizer"
"--disable-decimal-float")
(remove (cut string-match "--(.*plugin|enable-languages)" <>)
,flags)))
- ((#:make-flags flags)
- (if (%current-target-system)
- `(cons "LDFLAGS=-static" ,flags)
- `(cons "BOOT_LDFLAGS=-static" ,flags))))))
+ ((#:phases phases)
+ `(alist-cons-after
+ 'pre-configure 'remove-lgcc_s
+ (lambda _
+ ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
+ ;; the 'pre-configure phase of our main gcc package, because
+ ;; that shared library is not present in this static gcc. See
+ ;; <https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00008.html>.
+ (substitute* (find-files "gcc/config"
+ "^gnu-user.*\\.h$")
+ ((" -lgcc_s}}") "}}")))
+ ,phases)))))
(native-inputs
(if (%current-target-system)
`(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
(name "gcc-stripped")
(build-system trivial-build-system)
(source #f)
+ (outputs '("out")) ;only one output
(arguments
`(#:modules ((guix build utils))
#:builder
;; (‘genchecksum’, ‘gcc-nm’, etc.) rely on C++ headers.
(copy-recursively (string-append gcc "/include/c++")
(string-append includedir "/c++"))
- #t))))
+
+ ;; For native builds, check whether the binaries actually work.
+ ,(if (%current-target-system)
+ '#t
+ '(every (lambda (prog)
+ (zero? (system* (string-append gcc "/bin/" prog)
+ "--version")))
+ '("gcc" "g++" "cpp")))))))
(inputs `(("gcc" ,%gcc-static)))))
(define %guile-static