diff --git a/.github/workflows/bwrap.yml b/.github/workflows/bwrap.yml index 66cea846..882ade15 100644 --- a/.github/workflows/bwrap.yml +++ b/.github/workflows/bwrap.yml @@ -12,6 +12,52 @@ on: - master jobs: + alt_pass1: + name: Alt Run up to Linux build under bubblewrap + runs-on: ubuntu-latest + steps: + - name: Install bubblewrap + run: sudo apt install bubblewrap + - name: Checkout repo + uses: actions/checkout@v3 + with: + submodules: recursive + # There is a strange bug(?) in nongnu, when you clone a git repository + # against a commit != HEAD with depth=1, it errors out. + fetch-depth: 0 + - name: Query cache for sources + id: cache + uses: actions/cache/restore@v3 + with: + path: | + distfiles + key: cache-${{ hashFiles('steps/*/sources') }} + - name: Get sources + if: steps.cache.outputs.cache-hit != 'true' + run: ./download-distfiles.sh + - name: Cache sources + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: | + distfiles + key: cache-${{ hashFiles('steps/*/sources') }} + - name: Run bootstrap + run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1 --tcc_bootstrap_alt + - name: Archive created packages + if: failure() # archive failed builds progress + uses: actions/upload-artifact@v3 + with: + name: alt_packages + path: target/external/repo/** + - name: Tar alt_pass1 image + run: tar -cf alt_pass1_image.tar target + - name: Archive alt_pass1_image + uses: actions/upload-artifact@v3 + with: + name: internal_alt_pass1_image + path: alt_pass1_image.tar + pass1: name: Run up to Linux build under bubblewrap runs-on: ubuntu-latest diff --git a/rootfs.py b/rootfs.py index c31d5a18..4b5cdc3c 100755 --- a/rootfs.py +++ b/rootfs.py @@ -47,6 +47,7 @@ def create_configuration_file(args): config.write("DISK=sda1\n") config.write("KERNEL_BOOTSTRAP=False\n") config.write(f"BUILD_KERNELS={args.update_checksums or args.build_kernels}\n") + config.write(f"TCC_BOOTSTRAP_ALT={args.tcc_bootstrap_alt}\n") # pylint: disable=too-many-statements,too-many-branches def main(): @@ -109,6 +110,9 @@ def main(): parser.add_argument("-b", "--bare-metal", help="Build images for bare metal", action="store_true") + parser.add_argument("--tcc_bootstrap_alt", + help="Use tcc_bootstrap_alt.", + action="store_true") args = parser.parse_args() diff --git a/steps/manifest b/steps/manifest index 77eab6f7..9bade636 100644 --- a/steps/manifest +++ b/steps/manifest @@ -34,6 +34,7 @@ build: checksum-transcriber-1.0 build: simple-patch-1.0 build: mes-0.25 +build: tcc_bootstrap_alt-0.2 ( TCC_BOOTSTRAP_ALT == True ) build: tcc-0.9.26 build: tcc-0.9.27 define: BUILD_FIWIX = ( KERNEL_BOOTSTRAP == True || BUILD_KERNELS == True ) diff --git a/steps/mes-0.25/pass1.kaem b/steps/mes-0.25/pass1.kaem index 47a1f891..1924f19a 100755 --- a/steps/mes-0.25/pass1.kaem +++ b/steps/mes-0.25/pass1.kaem @@ -60,6 +60,7 @@ rm mes/module/mes/psyntax.pp mes/module/mes/psyntax.pp.header cp mes/module/srfi/srfi-9-struct.mes mes/module/srfi/srfi-9.mes cp mes/module/srfi/srfi-9/gnu-struct.mes mes/module/srfi/srfi-9/gnu.mes +if match x${TCC_BOOTSTRAP_ALT} xFalse; then # Build mes-m2 kaem --verbose --strict --file kaem.${MES_ARCH} cp bin/mes-m2 ${BINDIR}/mes-m2 @@ -265,10 +266,14 @@ mescc lib/linux/stat.c catm ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.a ${LIBDIR}/${MES_ARCH}-mes/libc.a islower.o isupper.o tolower.o toupper.o abtod.o dtoab.o search-path.o execvp.o fclose.o fdopen.o ferror.o fflush.o fopen.o fprintf.o fread.o fseek.o ftell.o fwrite.o printf.o remove.o snprintf.o sprintf.o sscanf.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o vsscanf.o abort.o calloc.o qsort.o strtod.o strtof.o strtol.o strtold.o strtoll.o strtoul.o strtoull.o memmem.o strcat.o strchr.o strlwr.o strncpy.o strrchr.o strstr.o strupr.o sigaction.o ldexp.o mprotect.o localtime.o sigemptyset.o setjmp.o close.o rmdir.o stat.o catm ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.s ${LIBDIR}/${MES_ARCH}-mes/libc.s islower.s isupper.s tolower.s toupper.s abtod.s dtoab.s search-path.s execvp.s fclose.s fdopen.s ferror.s fflush.s fopen.s fprintf.s fread.s fseek.s ftell.s fwrite.s printf.s remove.s snprintf.s sprintf.s sscanf.s vfprintf.s vprintf.s vsnprintf.s vsprintf.s vsscanf.s abort.s calloc.s qsort.s strtod.s strtof.s strtol.s strtold.s strtoll.s strtoul.s strtoull.s memmem.s strcat.s strchr.s strlwr.s strncpy.s strrchr.s strstr.s strupr.s sigaction.s ldexp.s mprotect.s localtime.s sigemptyset.s setjmp.s close.s rmdir.s stat.s +fi + # Make directories mkdir ${PREFIX}/lib/linux ${INCDIR}/mes ${INCDIR}/sys ${INCDIR}/linux ${INCDIR}/arch mkdir ${PREFIX}/lib/${MES_ARCH}-mes ${PREFIX}/lib/linux/${MES_ARCH}-mes ${INCDIR}/linux/${MES_ARCH} +if match x${TCC_BOOTSTRAP_ALT} xFalse; then + # Install libraries cp ${LIBDIR}/${MES_ARCH}-mes/libc.a ${PREFIX}/lib/${MES_ARCH}-mes/ cp ${LIBDIR}/${MES_ARCH}-mes/libc+tcc.a ${PREFIX}/lib/${MES_ARCH}-mes/ @@ -282,6 +287,8 @@ cp ${LIBDIR}/${MES_ARCH}-mes/crt1.s ${PREFIX}/lib/${MES_ARCH}-mes/ cp ${LIBDIR}/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-footer-single-main.hex2 ${PREFIX}/lib/linux/${MES_ARCH}-mes/ cp ${LIBDIR}/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-header.hex2 ${PREFIX}/lib/linux/${MES_ARCH}-mes/ +fi + # Install header files cp include/alloca.h ${INCDIR}/alloca.h cp include/argz.h ${INCDIR}/argz.h @@ -356,7 +363,7 @@ cp include/sys/wait.h ${INCDIR}/sys/wait.h cd ../.. # Checksums -if match x${UPDATE_CHECKSUMS} xTrue; then +if match x${UPDATE_CHECKSUMS}${TCC_BOOTSTRAP_ALT} xTrueFalse; then sha256sum -o ${pkg}.${ARCH}.checksums \ /usr/bin/mes \ /usr/bin/mes-m2 \ @@ -374,6 +381,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then /usr/lib/linux/${MES_ARCH}-mes/elf${ARCH_BITS}-footer-single-main.hex2 cp ${pkg}.${ARCH}.checksums ${SRCDIR} -else +fi +if match x${UPDATE_CHECKSUMS}${TCC_BOOTSTRAP_ALT} xFalseFalse; then sha256sum -c ${pkg}.${ARCH}.checksums fi diff --git a/steps/tcc-0.9.26/pass1.kaem b/steps/tcc-0.9.26/pass1.kaem index be93e55a..4367cc18 100755 --- a/steps/tcc-0.9.26/pass1.kaem +++ b/steps/tcc-0.9.26/pass1.kaem @@ -62,7 +62,9 @@ if match ${ARCH} riscv64; then HAVE_LONG_LONG=1 fi +if match x${TCC_BOOTSTRAP_ALT} xTrue; then +else ${MES} --no-auto-compile -e main ${BINDIR}/mescc.scm -- \ -S \ -o tcc.s \ @@ -97,6 +99,8 @@ chmod 755 ${BINDIR}/tcc-mes # test tcc-mes tcc-mes -version +fi + # Recompile the mes C library cd ../${MES_PKG} @@ -105,12 +109,19 @@ cd lib catm ../unified-libc.c ctype/isalnum.c ctype/isalpha.c ctype/isascii.c ctype/iscntrl.c ctype/isdigit.c ctype/isgraph.c ctype/islower.c ctype/isnumber.c ctype/isprint.c ctype/ispunct.c ctype/isspace.c ctype/isupper.c ctype/isxdigit.c ctype/tolower.c ctype/toupper.c dirent/closedir.c dirent/__getdirentries.c dirent/opendir.c dirent/readdir.c linux/access.c linux/brk.c linux/chdir.c linux/chmod.c linux/clock_gettime.c linux/close.c linux/dup2.c linux/dup.c linux/execve.c linux/fcntl.c linux/fork.c linux/fsync.c linux/fstat.c linux/_getcwd.c linux/getdents.c linux/getegid.c linux/geteuid.c linux/getgid.c linux/getpid.c linux/getppid.c linux/getrusage.c linux/gettimeofday.c linux/getuid.c linux/ioctl.c linux/ioctl3.c linux/kill.c linux/link.c linux/lseek.c linux/lstat.c linux/malloc.c linux/mkdir.c linux/mknod.c linux/nanosleep.c linux/_open3.c linux/pipe.c linux/_read.c linux/readlink.c linux/rename.c linux/rmdir.c linux/setgid.c linux/settimer.c linux/setuid.c linux/signal.c linux/sigprogmask.c linux/symlink.c linux/stat.c linux/time.c linux/unlink.c linux/waitpid.c linux/wait4.c linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/_exit.c linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/syscall.c linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/_write.c math/ceil.c math/fabs.c math/floor.c mes/abtod.c mes/abtol.c mes/__assert_fail.c mes/assert_msg.c mes/__buffered_read.c mes/__init_io.c mes/cast.c mes/dtoab.c mes/eputc.c mes/eputs.c mes/fdgetc.c mes/fdgets.c mes/fdputc.c mes/fdputs.c mes/fdungetc.c mes/globals.c mes/itoa.c mes/ltoab.c mes/ltoa.c mes/__mes_debug.c mes/mes_open.c mes/ntoab.c mes/oputc.c mes/oputs.c mes/search-path.c mes/ultoa.c mes/utoa.c posix/alarm.c posix/buffered-read.c posix/execl.c posix/execlp.c posix/execv.c posix/execvp.c posix/getcwd.c posix/getenv.c posix/isatty.c posix/mktemp.c posix/open.c posix/raise.c posix/sbrk.c posix/setenv.c posix/sleep.c posix/unsetenv.c posix/wait.c posix/write.c stdio/clearerr.c stdio/fclose.c stdio/fdopen.c stdio/feof.c stdio/ferror.c stdio/fflush.c stdio/fgetc.c stdio/fgets.c stdio/fileno.c stdio/fopen.c stdio/fprintf.c stdio/fputc.c stdio/fputs.c stdio/fread.c stdio/freopen.c stdio/fscanf.c stdio/fseek.c stdio/ftell.c stdio/fwrite.c stdio/getc.c stdio/getchar.c stdio/perror.c stdio/printf.c stdio/putc.c stdio/putchar.c stdio/remove.c stdio/snprintf.c stdio/sprintf.c stdio/sscanf.c stdio/ungetc.c stdio/vfprintf.c stdio/vfscanf.c stdio/vprintf.c stdio/vsnprintf.c stdio/vsprintf.c stdio/vsscanf.c stdlib/abort.c stdlib/abs.c stdlib/alloca.c stdlib/atexit.c stdlib/atof.c stdlib/atoi.c stdlib/atol.c stdlib/calloc.c stdlib/__exit.c stdlib/exit.c stdlib/free.c stdlib/mbstowcs.c stdlib/puts.c stdlib/qsort.c stdlib/realloc.c stdlib/strtod.c stdlib/strtof.c stdlib/strtol.c stdlib/strtold.c stdlib/strtoll.c stdlib/strtoul.c stdlib/strtoull.c string/bcmp.c string/bcopy.c string/bzero.c string/index.c string/memchr.c string/memcmp.c string/memcpy.c string/memmem.c string/memmove.c string/memset.c string/rindex.c string/strcat.c string/strchr.c string/strcmp.c string/strcpy.c string/strcspn.c string/strdup.c string/strerror.c string/strlen.c string/strlwr.c string/strncat.c string/strncmp.c string/strncpy.c string/strpbrk.c string/strrchr.c string/strspn.c string/strstr.c string/strupr.c stub/atan2.c stub/bsearch.c stub/chown.c stub/__cleanup.c stub/cos.c stub/ctime.c stub/exp.c stub/fpurge.c stub/freadahead.c stub/frexp.c stub/getgrgid.c stub/getgrnam.c stub/getlogin.c stub/getpgid.c stub/getpgrp.c stub/getpwnam.c stub/getpwuid.c stub/gmtime.c stub/ldexp.c stub/localtime.c stub/log.c stub/mktime.c stub/modf.c stub/mprotect.c stub/pclose.c stub/popen.c stub/pow.c stub/rand.c stub/rewind.c stub/setbuf.c stub/setgrent.c stub/setlocale.c stub/setvbuf.c stub/sigaction.c stub/sigaddset.c stub/sigblock.c stub/sigdelset.c stub/sigemptyset.c stub/sigsetmask.c stub/sin.c stub/sys_siglist.c stub/system.c stub/sqrt.c stub/strftime.c stub/times.c stub/ttyname.c stub/umask.c stub/utime.c ${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/setjmp.c cd .. +if match x${TCC_BOOTSTRAP_ALT} xTrue; then +# Recompile libc: crt{1,n,i}, libtcc.a, libc.a +tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c +else # crt1.o tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c catm ${LIBDIR}/crtn.o catm ${LIBDIR}/crti.o -if match ${ARCH} x86; then + +fi + +if match ${ARCH}${TCC_BOOTSTRAP_ALT} x86False; then # crtn.o tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c @@ -118,6 +129,14 @@ if match ${ARCH} x86; then tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c fi +if match ${ARCH}${TCC_BOOTSTRAP_ALT} x86True; then + tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c + tcc-boot0 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c +fi + +if match x${TCC_BOOTSTRAP_ALT} xTrue; then +tcc-boot0 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c +else # libc+gcc.a tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c tcc-mes -ar cr ${LIBDIR}/libc.a unified-libc.o @@ -125,19 +144,70 @@ tcc-mes -ar cr ${LIBDIR}/libc.a unified-libc.o # libtcc1.a mkdir ${LIBDIR}/tcc tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c +fi + if match ${ARCH} riscv64; then + IS_RISCV64=True tcc-mes -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c tcc-mes -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o lib-arm64.o else + IS_RISCV64=False +fi + +if match x${IS_RISCV64}${TCC_BOOTSTRAP_ALT} xFalseFalse; then tcc-mes -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o fi +if match x${TCC_BOOTSTRAP_ALT} xTrue; then +tcc-boot0 -c -D__linux__ -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -I /usr/include/mes/ -o unified-libc.o unified-libc.c +else # libgetopt.a tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} lib/posix/getopt.c tcc-mes -ar cr ${LIBDIR}/libgetopt.a getopt.o +fi cd ../${TCC_PKG} +if match x${TCC_BOOTSTRAP_ALT} xTrue; then +mkdir /usr/lib/mes/tcc/ + +# boot1 +tcc-boot0 \ + -nostdinc \ + -c \ + -o tcc-boot1.o \ + -D __linux__ \ + -D BOOTSTRAP=1 \ + -D HAVE_FLOAT=1 \ + -D HAVE_BITFIELD=1 \ + -D HAVE_LONG_LONG=0 \ + -D HAVE_SETJMP=1 \ + -I /usr/include/mes/ \ + -I . \ + -I ${PREFIX}/include \ + -D TCC_TARGET_${TCC_TARGET_ARCH}=1 \ + -D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \ + -D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \ + -D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \ + -D CONFIG_TCC_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \ + -D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include/mes\" \ + -D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \ + -D TCC_LIBTCC1=\"libtcc1.a\" \ + -D CONFIG_TCCBOOT=1 \ + -D CONFIG_TCC_STATIC=1 \ + -D CONFIG_USE_LIBGCC=1 \ + -D TCC_VERSION=\"0.9.26\" \ + -D ONE_SOURCE=1 \ + tcc.c + +tcc-boot0 -static -nostdlib /usr/lib/mes/crt1.o ../mes-0.25/unified-libc.o ../mes-0.25/libtcc1.o tcc-boot1.o -o tcc-boot0-new + +#replace tcc-boot0 with full one + +cp tcc-boot0-new ${BINDIR}/tcc-boot0 + + +else # boot0 (ref comments here for all boot*) # compile tcc-mes \ @@ -170,6 +240,8 @@ tcc-mes \ tcc.c # Install cp tcc-boot0 ${BINDIR}/ +fi + chmod 755 ${BINDIR}/tcc-boot0 cd ../${MES_PKG} # Recompile libc: crt{1,n,i}, libtcc.a, libc.a @@ -295,6 +367,56 @@ tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unifi tcc-boot2 -ar cr ${LIBDIR}/libc.a unified-libc.o cd ../${TCC_PKG} +# rebuild tcc-boot2 with itself +# LJW FIXME find a neater way to repeat this step (maybe a separate kaem script) +tcc-boot2 \ + -g \ + -v \ + -static \ + -o tcc-boot2 \ + -D BOOTSTRAP=1 \ + -D HAVE_BITFIELD=1 \ + -D HAVE_FLOAT=1 \ + -D HAVE_LONG_LONG=1 \ + -D HAVE_SETJMP=1 \ + -I . \ + -I ${PREFIX}/include/mes \ + -D TCC_TARGET_${TCC_TARGET_ARCH}=1 \ + -D CONFIG_TCCDIR=\"${LIBDIR}/tcc\" \ + -D CONFIG_TCC_CRTPREFIX=\"${LIBDIR}\" \ + -D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \ + -D CONFIG_TCC_LIBPATHS=\"${LIBDIR}:${LIBDIR}/tcc\" \ + -D CONFIG_TCC_SYSINCLUDEPATHS=\"${PREFIX}/include/mes\" \ + -D TCC_LIBGCC=\"${LIBDIR}/libc.a\" \ + -D TCC_LIBTCC1=\"libtcc1.a\" \ + -D CONFIG_TCCBOOT=1 \ + -D CONFIG_TCC_STATIC=1 \ + -D CONFIG_USE_LIBGCC=1 \ + -D TCC_VERSION=\"0.9.26\" \ + -D ONE_SOURCE=1 \ + -L . \ + tcc.c +cp tcc-boot2 ${BINDIR} +chmod 755 ${BINDIR}/tcc-boot2 +cd ../${MES_PKG} +tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crt1.o lib/linux/${MES_ARCH}-mes-${MES_LIBC_SUFFIX}/crt1.c +if match ${ARCH} x86; then + tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crtn.o lib/linux/${MES_ARCH}-mes-gcc/crtn.c + tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o ${LIBDIR}/crti.o lib/linux/${MES_ARCH}-mes-gcc/crti.c +fi + +tcc-boot2 -c -D HAVE_CONFIG_H=1 -D HAVE_LONG_LONG=1 -D HAVE_FLOAT=1 -I include -I include/linux/${MES_ARCH} -o libtcc1.o lib/libtcc1.c +if match ${ARCH} riscv64; then + tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o lib-arm64.o ../${TCC_PKG}/lib/lib-arm64.c + tcc-boot2 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o lib-arm64.o +else + tcc-boot2 -ar cr ${LIBDIR}/tcc/libtcc1.a libtcc1.o +fi + +tcc-boot2 -c -D HAVE_CONFIG_H=1 -I include -I include/linux/${MES_ARCH} -o unified-libc.o unified-libc.c +tcc-boot2 -ar cr ${LIBDIR}/libc.a unified-libc.o +cd ../${TCC_PKG} + # Test boot2 tcc-boot2 -version @@ -315,10 +437,8 @@ cd ../.. # Checksums if match x${UPDATE_CHECKSUMS} xTrue; then +# LJW FIXME is this a bug? should it say pkg and ARCH? sha256sum -o ${pkg}.checksums \ - /usr/bin/tcc-mes \ - /usr/bin/tcc-boot0 \ - /usr/bin/tcc-boot1 \ /usr/bin/tcc \ /usr/lib/mes/libc.a \ /usr/lib/mes/libgetopt.a \ @@ -331,3 +451,18 @@ if match x${UPDATE_CHECKSUMS} xTrue; then else sha256sum -c ${pkg}.${ARCH}.checksums fi + +# Check extra hashes when doing mes build +if match x${UPDATE_CHECKSUMS}${TCC_BOOTSTRAP_ALT} xTrueFalse; then +# LJW FIXME is this a bug? should it say pkg and ARCH? + sha256sum -o ${pkg}_mes.checksums \ + /usr/bin/tcc-mes \ + /usr/bin/tcc-boot0 \ + /usr/bin/tcc-boot1 + + cp ${pkg}_mes.checksums ${SRCDIR} +fi + +if match x${UPDATE_CHECKSUMS}${TCC_BOOTSTRAP_ALT} xFalseFalse; then + sha256sum -c ${pkg}_mes.${ARCH}.checksums +fi diff --git a/steps/tcc-0.9.26/tcc-0.9.26.riscv64.checksums b/steps/tcc-0.9.26/tcc-0.9.26.riscv64.checksums index 09d88933..6975cf9b 100644 --- a/steps/tcc-0.9.26/tcc-0.9.26.riscv64.checksums +++ b/steps/tcc-0.9.26/tcc-0.9.26.riscv64.checksums @@ -1,6 +1,3 @@ -22c74eec2ee1694247fae2958979c2326bab41ecbf5ba279b38417f63bf8892d /usr/bin/tcc-mes -4aff7e61488c03322a682a086405831aa4d99681b2761ddc8b0a76888395a11b /usr/bin/tcc-boot0 -9973b5e730c0b9d65aa0ad2332a51adbb247546478d2e86697bba6de4f2f03fc /usr/bin/tcc-boot1 5b5b131cc6bb7f62b11bc99092a1e48c2975af00c7d22fb52de5f561dbdc749a /usr/bin/tcc 93fbb5473bfaf2abaf6598a21dd5f0ac3c6237bfa15bc0c85328608233de55bc /usr/lib/mes/libc.a 98e2d2d543a113c82c8de39f32d4d43b1fe7f3159c5956c5e3224e7f4162601f /usr/lib/mes/libgetopt.a diff --git a/steps/tcc-0.9.26/tcc-0.9.26.x86.checksums b/steps/tcc-0.9.26/tcc-0.9.26.x86.checksums index d9f42895..dd13baa3 100644 --- a/steps/tcc-0.9.26/tcc-0.9.26.x86.checksums +++ b/steps/tcc-0.9.26/tcc-0.9.26.x86.checksums @@ -1,6 +1,3 @@ -48f0ac2f1fb8002a6a6958557732b83778f744de3e09085987d65c6981a57ab3 /usr/bin/tcc-mes -b758fff28f3d03b057b0414eb92da0c46e22bc8e9da29af33fbe65b01047d25d /usr/bin/tcc-boot0 -56e267e3031f548ea155d61a97fc3e6e8fff277159d7ae3273820a8c0f4582a0 /usr/bin/tcc-boot1 3404d1e8f61be09c1caeba03dcf99abae8881a485fe13160e6bb5fe44538d378 /usr/bin/tcc 3bfd10dfe347c4fb40fbf5f2f705cd806c77e0f80cf4ad1ecfd4beddada2937c /usr/lib/mes/libc.a 12c07ae103e7e3b390150a79e5c600d88de14e9bb73a066f6342582729ef5a3f /usr/lib/mes/libgetopt.a diff --git a/steps/tcc-0.9.26/tcc-0.9.26_mes.riscv64.checksums b/steps/tcc-0.9.26/tcc-0.9.26_mes.riscv64.checksums new file mode 100644 index 00000000..42c01ca6 --- /dev/null +++ b/steps/tcc-0.9.26/tcc-0.9.26_mes.riscv64.checksums @@ -0,0 +1,3 @@ +22c74eec2ee1694247fae2958979c2326bab41ecbf5ba279b38417f63bf8892d /usr/bin/tcc-mes +4aff7e61488c03322a682a086405831aa4d99681b2761ddc8b0a76888395a11b /usr/bin/tcc-boot0 +9973b5e730c0b9d65aa0ad2332a51adbb247546478d2e86697bba6de4f2f03fc /usr/bin/tcc-boot1 diff --git a/steps/tcc-0.9.26/tcc-0.9.26_mes.x86.checksums b/steps/tcc-0.9.26/tcc-0.9.26_mes.x86.checksums new file mode 100644 index 00000000..23b694d6 --- /dev/null +++ b/steps/tcc-0.9.26/tcc-0.9.26_mes.x86.checksums @@ -0,0 +1,3 @@ +48f0ac2f1fb8002a6a6958557732b83778f744de3e09085987d65c6981a57ab3 /usr/bin/tcc-mes +b758fff28f3d03b057b0414eb92da0c46e22bc8e9da29af33fbe65b01047d25d /usr/bin/tcc-boot0 +56e267e3031f548ea155d61a97fc3e6e8fff277159d7ae3273820a8c0f4582a0 /usr/bin/tcc-boot1 diff --git a/steps/tcc_bootstrap_alt-0.2/pass1.kaem b/steps/tcc_bootstrap_alt-0.2/pass1.kaem new file mode 100644 index 00000000..84237065 --- /dev/null +++ b/steps/tcc_bootstrap_alt-0.2/pass1.kaem @@ -0,0 +1,41 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: 2024 Liam Wilson +# +# SPDX-License-Identifier: GPL-3.0-or-later + +set -ex + +# Check tarball checksums +checksum-transcriber sources +sha256sum -c sources.SHA256SUM + +# Unpack +mkdir src + +cd src +ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar + +untar --non-strict --file ./${pkg}.tar + +# Build +cd ./${pkg} +/bootstrap-seeds/POSIX/x86/hex0-seed ./x86/hex0_x86.hex0 ./x86/artifact/hex0-seed +chmod 755 ./x86/artifact/hex0-seed +/bootstrap-seeds/POSIX/x86/hex0-seed ./x86/kaem-minimal.hex0 ./x86/artifact/kaem-optional-seed +chmod 755 ./x86/artifact/kaem-optional-seed +kaem --file kaem.x86 +cp artifacts/tcc_27_boot_static.exe /usr/bin/tcc-boot0 +chmod 755 /usr/bin/tcc-boot0 + +cd ../.. + +# Checksums +if match x${UPDATE_CHECKSUMS} xTrue; then + sha256sum -o ${pkg}.${ARCH}.checksums \ + /usr/bin/tcc-boot0 + + cp ${pkg}.${ARCH}.checksums ${SRCDIR} +else + sha256sum -c ${pkg}.${ARCH}.checksums +fi diff --git a/steps/tcc_bootstrap_alt-0.2/sources b/steps/tcc_bootstrap_alt-0.2/sources new file mode 100644 index 00000000..c0d1c1e0 --- /dev/null +++ b/steps/tcc_bootstrap_alt-0.2/sources @@ -0,0 +1 @@ +https://github.com/cosinusoidally/tcc_bootstrap_alt/releases/download/0.2/tcc_bootstrap_alt-0.2.tar.gz b8afe6d054a7e3e17b7f18a80776eb7c69469913d21e96261eadc598de48484a diff --git a/steps/tcc_bootstrap_alt-0.2/tcc_bootstrap_alt-0.2.x86.checksums b/steps/tcc_bootstrap_alt-0.2/tcc_bootstrap_alt-0.2.x86.checksums new file mode 100644 index 00000000..28b0485b --- /dev/null +++ b/steps/tcc_bootstrap_alt-0.2/tcc_bootstrap_alt-0.2.x86.checksums @@ -0,0 +1 @@ +68339f674652b934929568b613a74f75668d3fee6664b4d528781d764f5e7750 /usr/bin/tcc-boot0