mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 03:26:31 +01:00
Merge c766b6030b into 86e1a5e7f6
This commit is contained in:
commit
db1b7517d6
12 changed files with 249 additions and 12 deletions
46
.github/workflows/bwrap.yml
vendored
46
.github/workflows/bwrap.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -49,6 +49,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():
|
||||
|
|
@ -111,6 +112,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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -57,6 +57,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
|
||||
|
|
@ -262,10 +263,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/
|
||||
|
|
@ -279,6 +284,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
|
||||
|
|
@ -353,7 +360,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 \
|
||||
|
|
@ -371,6 +378,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
|
||||
|
|
|
|||
|
|
@ -59,7 +59,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 \
|
||||
|
|
@ -94,6 +96,8 @@ chmod 755 ${BINDIR}/tcc-mes
|
|||
# test tcc-mes
|
||||
tcc-mes -version
|
||||
|
||||
fi
|
||||
|
||||
# Recompile the mes C library
|
||||
cd ../${MES_PKG}
|
||||
|
||||
|
|
@ -102,12 +106,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
|
||||
|
||||
|
|
@ -115,6 +126,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
|
||||
|
|
@ -122,19 +141,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 \
|
||||
|
|
@ -167,6 +237,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
|
||||
|
|
@ -292,6 +364,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
|
||||
|
||||
|
|
@ -312,10 +434,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 \
|
||||
|
|
@ -328,3 +448,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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
3
steps/tcc-0.9.26/tcc-0.9.26_mes.riscv64.checksums
Normal file
3
steps/tcc-0.9.26/tcc-0.9.26_mes.riscv64.checksums
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
22c74eec2ee1694247fae2958979c2326bab41ecbf5ba279b38417f63bf8892d /usr/bin/tcc-mes
|
||||
4aff7e61488c03322a682a086405831aa4d99681b2761ddc8b0a76888395a11b /usr/bin/tcc-boot0
|
||||
9973b5e730c0b9d65aa0ad2332a51adbb247546478d2e86697bba6de4f2f03fc /usr/bin/tcc-boot1
|
||||
3
steps/tcc-0.9.26/tcc-0.9.26_mes.x86.checksums
Normal file
3
steps/tcc-0.9.26/tcc-0.9.26_mes.x86.checksums
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
48f0ac2f1fb8002a6a6958557732b83778f744de3e09085987d65c6981a57ab3 /usr/bin/tcc-mes
|
||||
b758fff28f3d03b057b0414eb92da0c46e22bc8e9da29af33fbe65b01047d25d /usr/bin/tcc-boot0
|
||||
56e267e3031f548ea155d61a97fc3e6e8fff277159d7ae3273820a8c0f4582a0 /usr/bin/tcc-boot1
|
||||
41
steps/tcc_bootstrap_alt-0.2/pass1.kaem
Normal file
41
steps/tcc_bootstrap_alt-0.2/pass1.kaem
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 Liam Wilson <cosinusoidally@gmail.com>
|
||||
#
|
||||
# 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
|
||||
1
steps/tcc_bootstrap_alt-0.2/sources
Normal file
1
steps/tcc_bootstrap_alt-0.2/sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
https://github.com/cosinusoidally/tcc_bootstrap_alt/releases/download/0.2/tcc_bootstrap_alt-0.2.tar.gz b8afe6d054a7e3e17b7f18a80776eb7c69469913d21e96261eadc598de48484a
|
||||
|
|
@ -0,0 +1 @@
|
|||
68339f674652b934929568b613a74f75668d3fee6664b4d528781d764f5e7750 /usr/bin/tcc-boot0
|
||||
Loading…
Add table
Add a link
Reference in a new issue