From a95924c9ac3f238cde243c96d552ff59ad77ca16 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 5 Feb 2022 00:56:32 +0100 Subject: gnu: Add gcc-2.95-wrapper. * gnu/packages/commencement.scm (gcc-2.95-wrapper): New variable. --- gnu/packages/commencement.scm | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 3fb26f4c9e..76e879b47b 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Chris Marusich ;;; Copyright © 2021 Julien Lepiller +;;; Copyright © 2022 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -1402,6 +1403,63 @@ ac_cv_c_float_format='IEEE (little-endian)' ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include") "LANGUAGES=c"))))))) +(define-public gcc-2.95-wrapper + ;; We need this so gcc-mesboot0 can be used to create shared binaries that + ;; have the correct interpreter, otherwise configuring gcc-mesboot using + ;; --enable-shared will fail. + (package + (inherit gcc-mesboot0) + (name "gcc-wrapper") + (source #f) + (inputs '()) + (native-inputs + `(("bash" ,bash-minimal) + ("coreutils" ,coreutils) + ("libc" ,glibc-2.2.5) + ("gcc" ,gcc-mesboot0))) + (arguments + `(#:implicit-inputs? #f + #:phases + (modify-phases %standard-phases + (delete 'unpack) + (delete 'configure) + (delete 'install) + (replace 'build + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bash (assoc-ref inputs "bash")) + (libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc")) + (bin (string-append out "/bin"))) + (mkdir-p bin) + (for-each + (lambda (program) + (let ((wrapper (string-append bin "/" program))) + (with-output-to-file wrapper + (lambda _ + (display (string-append "#! " bash "/bin/bash +exec " gcc "/bin/" program +" -Wl,--dynamic-linker" +;; also for x86_64-linux, we are still on i686-linux +" -Wl," libc ,(glibc-dynamic-linker "i686-linux") +" -Wl,--rpath" +" -Wl," libc "/lib" +" \"$@\" +")) + (chmod wrapper #o555))))) + '("cpp" + "gcc" + "g++" + "i686-unknown-linux-gnu-cpp" + "i686-unknown-linux-gnu-gcc" + "i686-unknown-linux-gnu-g++"))))) + (replace 'check + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (program (string-append bin "/gcc"))) + (invoke program "--help"))))))))) + (define (%boot-mesboot0-inputs) `(("gcc" ,gcc-mesboot0) ("kernel-headers" ,%bootstrap-linux-libre-headers) -- cgit v1.2.3