summaryrefslogtreecommitdiff
path: root/gnu/packages/bootstrap.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/bootstrap.scm')
-rw-r--r--gnu/packages/bootstrap.scm59
1 files changed, 36 insertions, 23 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index dcf385b03e9..f2620f844c3 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -775,14 +775,14 @@ $out/bin/guile --version~%"
775 (chmod "lib" #o755) 775 (chmod "lib" #o755)
776 776
777 ;; Patch linker scripts so they refer to the right file-names. 777 ;; Patch linker scripts so they refer to the right file-names.
778 ,(if (target-hurd64?) 778 ,@(if (target-hurd64?)
779 '(substitute* '("lib/libc.so" "lib/libm.so") 779 '((substitute* '("lib/libc.so" "lib/libm.so")
780 (("/[^ ]+/lib/(libc|libm|libh|ld)" _ prefix) 780 (("/[^ ]+/lib/(libc|libm|libh|ld)" _ prefix)
781 (string-append out "/lib/" prefix))) 781 (string-append out "/lib/" prefix))))
782 '(substitute* "lib/libc.so" 782 '((substitute* "lib/libc.so"
783 (("/[^ ]+/lib/(libc|ld)" _ prefix) 783 (("/[^ ]+/lib/(libc|ld)" _ prefix)
784 (string-append out "/lib/" prefix)))) 784 (string-append out "/lib/" prefix)))
785 #t)))))) 785 #t))))))))
786 (inputs 786 (inputs
787 `(("tar" ,(bootstrap-executable "tar" (%current-system))) 787 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
788 ("xz" ,(bootstrap-executable "xz" (%current-system))) 788 ("xz" ,(bootstrap-executable "xz" (%current-system)))
@@ -874,20 +874,22 @@ $out/bin/guile --version~%"
874 (let ((builddir (getcwd)) 874 (let ((builddir (getcwd))
875 (bindir (string-append out "/bin"))) 875 (bindir (string-append out "/bin")))
876 876
877 (define (wrap-program program) 877 ,@(if (target-hurd64?)
878 (let ((wrapped (format #f ".~a-wrapped" program))) 878 `((define (wrap-program program)
879 (rename-file program wrapped) 879 (let ((wrapped (format #f ".~a-wrapped" program)))
880 (call-with-output-file program 880 (rename-file program wrapped)
881 (lambda (p) 881 (call-with-output-file program
882 (format p "#!~a 882 (lambda (p)
883 (format p "#!~a
883exec ~a/bin/~a -B~a/lib \ 884exec ~a/bin/~a -B~a/lib \
884 -Wl,-rpath -Wl,~a/lib \ 885 -Wl,-rpath -Wl,~a/lib \
885 -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" 886 -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
886 bash 887 bash
887 out wrapped 888 out wrapped
888 libc libc libc 889 libc libc libc
889 ,(glibc-dynamic-linker))))) 890 ,(glibc-dynamic-linker)))))
890 (chmod program #o555)) 891 (chmod program #o555)))
892 '())
891 893
892 (with-directory-excursion out 894 (with-directory-excursion out
893 (invoke tar "xvf" 895 (invoke tar "xvf"
@@ -895,10 +897,21 @@ exec ~a/bin/~a -B~a/lib \
895 897
896 (with-directory-excursion bindir 898 (with-directory-excursion bindir
897 (chmod "." #o755) 899 (chmod "." #o755)
898 (for-each wrap-program 900 ,@(if (target-hurd64?)
899 ,(if (target-hurd64?) 901 `((for-each wrap-program '("gcc" "g++")))
900 ''("gcc" "g++") 902 `((rename-file "gcc" ".gcc-wrapped")
901 ''("gcc"))))))))) 903 (call-with-output-file "gcc"
904 (lambda (p)
905 (format p "#!~a
906exec ~a/bin/.gcc-wrapped -B~a/lib \
907 -Wl,-rpath -Wl,~a/lib \
908 -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
909 bash
910 out libc libc libc
911 ,(glibc-dynamic-linker))))
912
913 (chmod "gcc" #o555)
914 #t))))))))
902 (inputs 915 (inputs
903 `(("tar" ,(bootstrap-executable "tar" (%current-system))) 916 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
904 ("xz" ,(bootstrap-executable "xz" (%current-system))) 917 ("xz" ,(bootstrap-executable "xz" (%current-system)))