janneke pushed a commit to branch wip-bootstrap in repository guix. commit af4e6ada8ddd357f3b64affc455255101d4a39cd Author: Jan Nieuwenhuizen <jann...@gnu.org> Date: Thu Sep 6 21:32:20 2018 +0200
gnu: Add gcc-mesboot-4.9.4. * gnu/packages/commencement.scm (gcc-mesboot1): Rename from gcc-mesboot. (gcc-mesboot): New variable --- gnu/packages/commencement.scm | 163 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 145 insertions(+), 18 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 4c8c832..3fc763b 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -948,6 +948,9 @@ ac_cv_c_float_format='IEEE (little-endian)' (variable "C_INCLUDE_PATH") (files '("include"))) (search-path-specification + (variable "CPLUS_INCLUDE_PATH") + (files '("include"))) + (search-path-specification (variable "LIBRARY_PATH") (files '("lib")))))))) @@ -1015,8 +1018,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a")))))))) ((#:configure-flags configure-flags) `(let ((out (assoc-ref %outputs "out"))) - `( ;;"--enable-static" - "--disable-shared" + `("--disable-shared" "--disable-werror" "--build=i686-unknown-linux-gnu" "--host=i686-unknown-linux-gnu" @@ -1119,11 +1121,11 @@ ac_cv_c_float_format='IEEE (little-endian)' (base32 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1")))))) -(define-public gcc-mesboot +(define-public gcc-mesboot1 (package-with-bootstrap-guile (package (inherit gcc-mesboot0) - (name "gcc-mesboot") + (name "gcc-mesboot1") (version "4.7.4") (source (origin (method url-fetch) @@ -1148,6 +1150,15 @@ ac_cv_c_float_format='IEEE (little-endian)' ("make" ,make-mesboot))) (arguments `(,@(substitute-keyword-arguments (package-arguments gcc-core-mesboot) + ((#:make-flags make-flags) + `(let* ((libc (assoc-ref %build-inputs "libc")) + (ldflags (string-append + "-B" libc "/lib " + "-Wl,-dynamic-linker " + "-Wl," libc + ,(glibc-dynamic-linker)))) + (list (string-append "LDFLAGS=" ldflags) + (string-append "LDFLAGS_FOR_TARGET=" ldflags)))) ((#:phases phases) `(modify-phases ,phases ;; c&p from commencement.scm:gcc-boot0 @@ -1221,36 +1232,36 @@ ac_cv_c_float_format='IEEE (little-endian)' "--disable-lto-plugin" "--disable-multilib" "--disable-plugin" - "--disable-shared" "--disable-threads" "--enable-languages=c,c++" "--enable-static" + ;; libstdc++.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH () + "--disable-shared" "--enable-threads=single" ;; libstdc++ cannot be built at this stage ;; ("Link tests are not allowed after ;; GCC_NO_EXECUTABLES."). - '"--disable-libstdc__-v3" + ;;; We NEED this later -- possibly add it in next gcc-mesboot...? + ;;;'"--disable-libstdc__-v3" ;; No pre-compiled libstdc++ headers, to save space. "--disable-libstdcxx-pch" ;; for libcpp ... - "--disable-build-with-cxx"))) - ((#:make-flags make-flags) - ''()))))))) + "--disable-build-with-cxx"))))))))) -(define-public gcc-mesboot-wrapper +(define-public gcc-mesboot1-wrapper (package-with-bootstrap-guile (package - (inherit gcc-mesboot) - (name "gcc-mesboot-wrapper") + (inherit gcc-mesboot1) + (name "gcc-mesboot1-wrapper") (source #f) (inputs '()) (native-inputs `(("bash" ,%bootstrap-coreutils&co) ("libc" ,glibc-mesboot) - ("gcc" ,gcc-mesboot))) + ("gcc" ,gcc-mesboot1))) (arguments `(#:implicit-inputs? #f #:guile ,%bootstrap-guile @@ -1281,7 +1292,12 @@ exec " gcc "/bin/" program " \"$@\" ")) (chmod wrapper #o555))))) - '("gcc" "g++")) + '( + "gcc" + "g++" + "i686-unknown-linux-gnu-gcc" + "i686-unknown-linux-gnu-g++" + )) #t))) (replace 'check (lambda* (#:key outputs #:allow-other-keys) @@ -1308,7 +1324,7 @@ exec " gcc "/bin/" program "0vlz4x6cgz7h54qq4528q526qlhnsjzbsvgc4iizn76cb0bfanx7")))) (native-inputs `(("binutils" ,binutils-mesboot) ("libc" ,glibc-mesboot0) - ("gcc" ,gcc-mesboot) + ("gcc" ,gcc-mesboot1) ("headers" ,mesboot-headers) ("bash" ,%bootstrap-coreutils&co) @@ -1409,7 +1425,7 @@ exec " gcc "/bin/" program (native-inputs `(("binutils" ,binutils-mesboot) ("libc" ,glibc-mesboot0) ("headers" ,glibc-headers-mesboot) - ("gcc" ,gcc-mesboot) + ("gcc" ,gcc-mesboot1) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) @@ -1418,7 +1434,7 @@ exec " gcc "/bin/" program ("make" ,make-mesboot))) (arguments - `(#:validate-runpath? #f + `(#:validate-runpath? #f ; fails when using --enable-shared ,@(substitute-keyword-arguments (package-arguments glibc-headers-mesboot) ((#:make-flags make-flags) `(let ((bash (assoc-ref %build-inputs "bash"))) @@ -1449,6 +1465,116 @@ exec " gcc "/bin/" program (variable "LIBRARY_PATH") (files '("lib")))))))) +(define-public gcc-mesboot + (package-with-bootstrap-guile + (package + (inherit gcc-mesboot1) + (name "gcc-mesboot") + (version "4.9.4") + (source (package-source gcc-4.9)) + (native-inputs `(("binutils" ,binutils-mesboot) + ("gcc-wrapper" ,gcc-mesboot1-wrapper) + ("gcc" ,gcc-mesboot1) + ("libc" ,glibc-mesboot) + + ("bash" ,%bootstrap-coreutils&co) + ("coreutils" ,%bootstrap-coreutils&co) + ("diffutils" ,diffutils-mesboot) + ("kernel-headers" ,%bootstrap-linux-libre-headers) + ("make" ,make-mesboot))) + (arguments + `(#:validate-runpath? #f + ,@(substitute-keyword-arguments (package-arguments gcc-mesboot1) + ;; ((#:configure-flags configure-flags) + ;; `(append ,configure-flags + ;; '("--with-host-libstdcxx=-lsupc++" + ;; "--enable-shared"))) + ((#:configure-flags configure-flags) + `(let ((out (assoc-ref %outputs "out")) + (glibc (assoc-ref %build-inputs "libc"))) + (list (string-append "--prefix=" out) + "--build=i686-unknown-linux-gnu" + "--host=i686-unknown-linux-gnu" + + "--with-host-libstdcxx=-lsupc++" + + (string-append "--with-native-system-header-dir=" glibc "/include") + (string-append "--with-build-sysroot=" glibc "/include") + + "--disable-bootstrap" + "--disable-decimal-float" + "--disable-libatomic" + "--disable-libcilkrts" + "--disable-libgomp" + "--disable-libitm" + "--disable-libmudflap" + "--disable-libquadmath" + "--disable-libsanitizer" + "--disable-libssp" + "--disable-libvtv" + "--disable-lto" + "--disable-lto-plugin" + "--disable-multilib" + "--disable-plugin" + "--disable-threads" + "--enable-languages=c,c++" + + "--enable-static" + ;; libstdc++.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH () + ;;"--disable-shared" + "--enable-shared" + "--enable-threads=single" + + ;; libstdc++ cannot be built at this stage + ;; ("Link tests are not allowed after + ;; GCC_NO_EXECUTABLES."). + ;;; We NEED this later -- possibly add it in next gcc-mesboot...? + ;;;'"--disable-libstdc__-v3" + + ;; No pre-compiled libstdc++ headers, to save space. + "--disable-libstdcxx-pch" + + ;; for libcpp ... + "--disable-build-with-cxx"))) + ((#:phases phases) + `(modify-phases ,phases + (replace 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (binutils (assoc-ref %build-inputs "binutils")) + (bash (assoc-ref %build-inputs "bash")) + (gcc (assoc-ref %build-inputs "gcc")) + (glibc (assoc-ref %build-inputs "libc")) + (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) + (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) + (setenv "C_INCLUDE_PATH" (string-append + gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.7.4/include" + ":" kernel-headers "/include" + ":" glibc "/include" + ":" (getcwd) "/mpfr/src")) + (setenv "CPLUS_INCLUDE_PATH" (string-append + gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.7.4/include" + ":" kernel-headers "/include" + ":" glibc "/include" + ":" (getcwd) "/mpfr/src")) + (setenv "LIBRARY_PATH" (string-append glibc "/lib" + ":" gcc "/lib")) + (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) + (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH")) + (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) + #t))))))))))) + +(define-public gcc-mesboot-wrapper + (package-with-bootstrap-guile + (package + (inherit gcc-mesboot1-wrapper) + (name "gcc-mesboot-wrapper") + (source #f) + (inputs '()) + (native-inputs `(("bash" ,%bootstrap-coreutils&co) + ("libc" ,glibc-mesboot) + ("gcc" ,gcc-mesboot)))))) + (define-public m4-mesboot (package-with-bootstrap-guile (package @@ -1484,7 +1610,8 @@ exec " gcc "/bin/" program (append (match (%current-system) ("i686-linux" `(("libc" ,glibc-mesboot) ("binutils" ,binutils-mesboot) - ("gcc" ,gcc-mesboot-wrapper))) + ("gcc-wrapper" ,gcc-mesboot-wrapper) + ("gcc" ,gcc-mesboot))) (_ '())) (%bootstrap-inputs)))