guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/06: gnu: Add gcc-2.95-wrapper.


From: guix-commits
Subject: 03/06: gnu: Add gcc-2.95-wrapper.
Date: Mon, 7 Feb 2022 08:03:24 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit a95924c9ac3f238cde243c96d552ff59ad77ca16
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Sat Feb 5 00:56:32 2022 +0100

    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 <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]