gnu: Add tcc-boot-musl.

* gnu/packages/commencement.scm (tcc-boot-musl): New variable.

Co-authored-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: Id658d7cd7c7b7b4051bd8418f57797fbbe426117
This commit is contained in:
Ekaitz Zarraga 2024-10-02 16:02:18 +03:00 committed by Efraim Flashner
parent 15655116dc
commit 7c6a37de24
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -979,6 +979,57 @@ (define musl-boot0
(#t ""))
".so.1")))))))))))
(define tcc-boot-musl
(package
(inherit tcc-boot)
(name "tcc-boot-musl")
(native-inputs `(("libc" ,musl-boot0)
,@(modify-inputs (package-native-inputs tcc-boot)
(replace "tcc" tcc-boot))))
(arguments
(substitute-keyword-arguments (package-arguments tcc-boot)
((#:phases phases)
#~(modify-phases #$phases
(delete 'rebuild-libraries)
(replace 'build
(lambda* (#:key outputs inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(libc (assoc-ref inputs "libc"))
(tcc (assoc-ref inputs "tcc"))
(interpreter "/musl/loader"))
(invoke
"tcc"
"-g"
"-vvv"
"-I" (string-append tcc "/include")
"-L" (string-append tcc "/lib")
"-D" "ONE_SOURCE=1"
"-D" "TCC_VERSION=\"0.9.28rc\""
"-D" "CONFIG_TCC_STATIC=1"
"-D" "CONFIG_USE_LIBGCC=1"
"-D" "CONFIG_TCC_SEMLOCK=0"
"-D" (string-append "CONFIG_TCCDIR=\"" out "/lib/tcc\"")
"-D" (string-append "CONFIG_TCC_CRTPREFIX=\"" libc "/lib\"")
"-D" (string-append "CONFIG_TCC_ELFINTERP=\"" interpreter "\"")
"-D" (string-append "CONFIG_TCC_LIBPATHS=\"" libc "/lib:"
out "/lib:"
"{B}/lib:.\"")
"-D" (string-append "CONFIG_TCC_SYSINCLUDEPATHS=\""
libc "/include:"
out "/include:"
"{B}/include\"")
"-D" (string-append "TCC_LIBGCC=\"" libc "/lib/libc.a\"")
"-o" "tcc"
"tcc.c"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(install-file "tcc" (string-append out "/bin"))
(copy-recursively "include"
(string-append out "/include"))
(install-file "libtcc1.a" (string-append out "/lib"))
(install-file "libtcc1.a" (string-append out "/lib/tcc")))))))))))
(define binutils-mesboot0
;; The initial Binutils
(package