summaryrefslogtreecommitdiff
path: root/gnu/packages/bootstrap.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-06-12 23:23:43 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-01-14 11:41:15 +0200
commit03b45230d409c5f09e6ad18f23f313a13dbddb7d (patch)
treedb8981cfc724c66927d76d1d14e4b9e342a7348b /gnu/packages/bootstrap.scm
parentb0822c918e42b3e58b22bda1b10f699e0d50e666 (diff)
gnu: bootstrap: Add support for riscv64-linux.
On 7d93b21ab1c132990054372a9677c1639d54e631 gnu: glibc-for-bootstrap: Update patch. Run ./pre-inst-env guix build --target=riscv64-linux-gnu bootstrap-tarballs Producing /gnu/store/4hdzva9i0wyyfbgj1lmqc1wkk644pv07-bootstrap-tarballs-0 With guix hash -rx 1nj0fdgj08bbmfny01mp2blv7c3p2iciqh31zmf04ap5s7ygsqlp * gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for riscv64-linux. (%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils, %bootstrap-glibc, %bootstrap-gcc): Add entry for riscv64-linux. (raw-build-guile3): New procedure. (make-raw-bag): Use raw-build-guile3 for riscv64-linux. * guix/packages.scm (%supported-systems): Add riscv64-linux. (%cuirass-supported-systems): Remove riscv64-linux. * guix/utils.scm (target-64bit?): Add riscv64-linux. * m4/guix.m4: Add riscv64-linux as a supported system. * doc/guix.texi (GNU Distribution): Add riscv64-linux.
Diffstat (limited to 'gnu/packages/bootstrap.scm')
-rw-r--r--gnu/packages/bootstrap.scm112
1 files changed, 109 insertions, 3 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 5a8028a4652..8bd0c4eaf3a 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -144,7 +144,16 @@
144 ("tar" 144 ("tar"
145 ,(base32 "150c8948cz8r208g6qgn2dn4f4zs5kpgbpbg6bwag6yw42rapw2l")) 145 ,(base32 "150c8948cz8r208g6qgn2dn4f4zs5kpgbpbg6bwag6yw42rapw2l"))
146 ("xz" 146 ("xz"
147 ,(base32 "0v5738idy9pqzcbrjdpxi5c6qs5m78zrpsydmrpx5cfcfzbkxzjh"))))) 147 ,(base32 "0v5738idy9pqzcbrjdpxi5c6qs5m78zrpsydmrpx5cfcfzbkxzjh")))
148 ("riscv64-linux"
149 ("bash"
150 ,(base32 "0almlf73k6hbm495kzf4bw1rzsg5qddn7z2rf5l3d1xcapac2hj3"))
151 ("mkdir"
152 ,(base32 "0rg1amdcqfkplcy1608jignl8jq0wqzfkp430mwik3f62959gya6"))
153 ("tar"
154 ,(base32 "17d3x27qhiwk7h6ns0xrvbrq0frxz89mjjh2cdwx2rraq5x6wffm"))
155 ("xz"
156 ,(base32 "0nxn75xf386vdq3igmgm8gnyk4h4x0cm8jv71vlb2jvwxh0cyw1q")))))
148 157
149(define %bootstrap-executable-base-urls 158(define %bootstrap-executable-base-urls
150 ;; This is where the bootstrap executables come from. 159 ;; This is where the bootstrap executables come from.
@@ -159,6 +168,7 @@
159 ("powerpc64le-linux" (string-append system "/20210106/" program)) 168 ("powerpc64le-linux" (string-append system "/20210106/" program))
160 ("i586-gnu" (string-append system "/20200326/" program)) 169 ("i586-gnu" (string-append system "/20200326/" program))
161 ("powerpc-linux" (string-append system "/20200923/bin/" program)) 170 ("powerpc-linux" (string-append system "/20200923/bin/" program))
171 ("riscv64-linux" (string-append system "/20210725/bin/" program))
162 (_ (string-append system "/" program 172 (_ (string-append system "/" program
163 "?id=44f07d1dc6806e97c4e9ee3e6be883cc59dc666e")))) 173 "?id=44f07d1dc6806e97c4e9ee3e6be883cc59dc666e"))))
164 174
@@ -362,6 +372,8 @@ or false to signal an error."
362 "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz") 372 "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
363 ("powerpc64le-linux" 373 ("powerpc64le-linux"
364 "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz") 374 "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
375 ("riscv64-linux"
376 "/20210725/guile-3.0.2.tar.xz")
365 (_ 377 (_
366 "/20131110/guile-2.0.9.tar.xz")))) 378 "/20131110/guile-2.0.9.tar.xz"))))
367 379
@@ -383,7 +395,9 @@ or false to signal an error."
383 ("i586-gnu" 395 ("i586-gnu"
384 (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac")) 396 (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
385 ("powerpc-linux" 397 ("powerpc-linux"
386 (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4")))) 398 (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
399 ("riscv64-linux"
400 (base32 "12pqmhsbbp7hh9r1bjdl14l3a4q06plpz6dcks9dysb4czay8p9f"))))
387 401
388(define (bootstrap-guile-origin system) 402(define (bootstrap-guile-origin system)
389 "Return an <origin> object for the Guile tarball of SYSTEM." 403 "Return an <origin> object for the Guile tarball of SYSTEM."
@@ -471,6 +485,76 @@ $out/bin/guile --version~%"
471 #:env-vars `(("GUILE_TARBALL" 485 #:env-vars `(("GUILE_TARBALL"
472 . ,(derivation->output-path guile)))))) 486 . ,(derivation->output-path guile))))))
473 487
488(define* (raw-build-guile3 name inputs
489 #:key outputs system search-paths
490 #:allow-other-keys)
491 (define (->store file)
492 (lower-object (bootstrap-executable file system)
493 system))
494
495 (define (make-guile-wrapper bash guile-real)
496 ;; The following code, run by the bootstrap guile after it is unpacked,
497 ;; creates a wrapper for itself to set its load path. This replaces the
498 ;; previous non-portable method based on reading the /proc/self/exe
499 ;; symlink.
500 '(begin
501 (use-modules (ice-9 match))
502 (match (command-line)
503 ((_ out bash)
504 (let ((bin-dir (string-append out "/bin"))
505 (guile (string-append out "/bin/guile"))
506 (guile-real (string-append out "/bin/.guile-real"))
507 ;; We must avoid using a bare dollar sign in this code,
508 ;; because it would be interpreted by the shell.
509 (dollar (string (integer->char 36))))
510 (chmod bin-dir #o755)
511 (rename-file guile guile-real)
512 (call-with-output-file guile
513 (lambda (p)
514 (format p "\
515#!~a
516export GUILE_SYSTEM_PATH=~a/share/guile/3.0
517export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/3.0/ccache
518exec -a \"~a0\" ~a \"~a@\"\n"
519 bash out out dollar guile-real dollar)))
520 (chmod guile #o555)
521 (chmod bin-dir #o555))))))
522
523 (mlet* %store-monad ((tar (->store "tar"))
524 (xz (->store "xz"))
525 (mkdir (->store "mkdir"))
526 (bash (->store "bash"))
527 (guile (download-bootstrap-guile system))
528 (wrapper -> (make-guile-wrapper bash guile))
529 (builder
530 (text-file "build-bootstrap-guile.sh"
531 (format #f "
532echo \"unpacking bootstrap Guile to '$out'...\"
533~a $out
534cd $out
535~a -dc < $GUILE_TARBALL | ~a xv
536
537# Use the bootstrap guile to create its own wrapper to set the load path.
538GUILE_SYSTEM_PATH=$out/share/guile/3.0 \
539GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/3.0/ccache \
540$out/bin/guile -c ~s $out ~a
541
542# Sanity check.
543$out/bin/guile --version~%"
544 (derivation->output-path mkdir)
545 (derivation->output-path xz)
546 (derivation->output-path tar)
547 (object->string wrapper)
548 (derivation->output-path bash)))))
549 (raw-derivation name
550 (derivation->output-path bash) `(,builder)
551 #:system system
552 #:inputs (map derivation-input
553 (list bash mkdir tar xz guile))
554 #:sources (list builder)
555 #:env-vars `(("GUILE_TARBALL"
556 . ,(derivation->output-path guile))))))
557
474(define* (make-raw-bag name 558(define* (make-raw-bag name
475 #:key source inputs native-inputs outputs 559 #:key source inputs native-inputs outputs
476 system target) 560 system target)
@@ -478,7 +562,9 @@ $out/bin/guile --version~%"
478 (name name) 562 (name name)
479 (system system) 563 (system system)
480 (build-inputs inputs) 564 (build-inputs inputs)
481 (build raw-build))) 565 (build (cond ((target-riscv64?)
566 raw-build-guile3)
567 (else raw-build)))))
482 568
483(define %bootstrap-guile 569(define %bootstrap-guile
484 ;; The Guile used to run the build scripts of the initial derivations. 570 ;; The Guile used to run the build scripts of the initial derivations.
@@ -518,6 +604,8 @@ $out/bin/guile --version~%"
518 "/20200326/static-binaries-0-i586-pc-gnu.tar.xz") 604 "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
519 ("powerpc-linux" 605 ("powerpc-linux"
520 "/20200923/static-binaries.tar.xz") 606 "/20200923/static-binaries.tar.xz")
607 ("riscv64-linux"
608 "/20210725/static-binaries.tar.xz")
521 (_ 609 (_
522 "/20131110/static-binaries.tar.xz"))) 610 "/20131110/static-binaries.tar.xz")))
523 %bootstrap-base-urls)) 611 %bootstrap-base-urls))
@@ -544,6 +632,9 @@ $out/bin/guile --version~%"
544 ("powerpc-linux" 632 ("powerpc-linux"
545 (base32 633 (base32
546 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m")) 634 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
635 ("riscv64-linux"
636 (base32
637 "0x0xjlpmyh6rkr51p00gp6pscgl6zjida1rsg8vk3rinyi6rrbkg"))
547 ("mips64el-linux" 638 ("mips64el-linux"
548 (base32 639 (base32
549 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753")))))) 640 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753"))))))
@@ -596,6 +687,8 @@ $out/bin/guile --version~%"
596 "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz") 687 "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
597 ("powerpc-linux" 688 ("powerpc-linux"
598 "/20200923/binutils-2.35.1.tar.xz") 689 "/20200923/binutils-2.35.1.tar.xz")
690 ("riscv64-linux"
691 "/20210725/binutils-2.34.tar.xz")
599 (_ 692 (_
600 "/20131110/binutils-2.23.2.tar.xz"))) 693 "/20131110/binutils-2.23.2.tar.xz")))
601 %bootstrap-base-urls)) 694 %bootstrap-base-urls))
@@ -616,6 +709,9 @@ $out/bin/guile --version~%"
616 ("powerpc64le-linux" 709 ("powerpc64le-linux"
617 (base32 710 (base32
618 "1klxy945c61134mzhqzz2gbk8w0n8jq7arwkrvz78d22ff2q0cwz")) 711 "1klxy945c61134mzhqzz2gbk8w0n8jq7arwkrvz78d22ff2q0cwz"))
712 ("riscv64-linux"
713 (base32
714 "0n9qf4vbilfmh1lknhw000waakj4q6s50pnjazr5137skm976z5m"))
619 ("i586-gnu" 715 ("i586-gnu"
620 (base32 716 (base32
621 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs")) 717 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
@@ -681,6 +777,8 @@ $out/bin/guile --version~%"
681 "/20200326/glibc-stripped-2.31-i586-pc-gnu.tar.xz") 777 "/20200326/glibc-stripped-2.31-i586-pc-gnu.tar.xz")
682 ("powerpc-linux" 778 ("powerpc-linux"
683 "/20200923/glibc-2.32.tar.xz") 779 "/20200923/glibc-2.32.tar.xz")
780 ("riscv64-linux"
781 "/20210725/glibc-2.31.tar.xz")
684 (_ 782 (_
685 "/20131110/glibc-2.18.tar.xz"))) 783 "/20131110/glibc-2.18.tar.xz")))
686 %bootstrap-base-urls)) 784 %bootstrap-base-urls))
@@ -701,6 +799,9 @@ $out/bin/guile --version~%"
701 ("powerpc64le-linux" 799 ("powerpc64le-linux"
702 (base32 800 (base32
703 "1a1df6z8gkaq09md3jy94lixnh20599p58p0s856p10xwjaqr1iz")) 801 "1a1df6z8gkaq09md3jy94lixnh20599p58p0s856p10xwjaqr1iz"))
802 ("riscv64-linux"
803 (base32
804 "0d9x80vm7ca1pd2whcmpm1h14zxpb58kqajlxlwffzm04xfsjnxm"))
704 ("i586-gnu" 805 ("i586-gnu"
705 (base32 806 (base32
706 "14ddm10lpbas8bankmn5bcrlqvz1v5dnn1qjzxb19r57vd2w5952")) 807 "14ddm10lpbas8bankmn5bcrlqvz1v5dnn1qjzxb19r57vd2w5952"))
@@ -782,6 +883,8 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
782 "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz") 883 "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
783 ("powerpc-linux" 884 ("powerpc-linux"
784 "/20200923/gcc-5.5.0.tar.xz") 885 "/20200923/gcc-5.5.0.tar.xz")
886 ("riscv64-linux"
887 "/20210725/gcc-7.5.0.tar.xz")
785 (_ 888 (_
786 "/20131110/gcc-4.8.2.tar.xz"))) 889 "/20131110/gcc-4.8.2.tar.xz")))
787 %bootstrap-base-urls)) 890 %bootstrap-base-urls))
@@ -802,6 +905,9 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
802 ("powerpc64le-linux" 905 ("powerpc64le-linux"
803 (base32 906 (base32
804 "151kjsai25vz2s667bgzpisx8f281fpl3n9pxz2yrp9jlnadz3m1")) 907 "151kjsai25vz2s667bgzpisx8f281fpl3n9pxz2yrp9jlnadz3m1"))
908 ("riscv64-linux"
909 (base32
910 "1k4mbnb54wj2q37fgshf5dfixixqnhn002vhzvi9pnb57xb9v14d"))
805 ("i586-gnu" 911 ("i586-gnu"
806 (base32 912 (base32
807 "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5")) 913 "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))