Add patched tcc

Forces static link.
This commit is contained in:
fosslinux 2021-01-14 21:45:36 +11:00
parent 1e822361a9
commit d62ed4c55a
4 changed files with 62 additions and 3 deletions

View file

@ -71,9 +71,14 @@ cd diffutils-2.7
kaem --file ../diffutils-2.7.kaem
cd ..
# Part 12: patch
# Part 11: patch
/after/bin/gunzip patch-2.5.9.tar.gz
/after/bin/tar xf patch-2.5.9.tar
cd patch-2.5.9
kaem --file ../patch-2.5.9.kaem
cd ..
# Part 12: tcc-patched
cd tcc-0.9.27
kaem --file ../tcc-patched.kaem
cd ..

View file

@ -0,0 +1,10 @@
--- libtcc.c 2021-01-14 08:25:30.774995301 +1100
+++ libtcc.c 2021-01-14 08:26:37.594417450 +1100
@@ -734,6 +734,7 @@
++nb_states;
s->alacarte_link = 1;
+ s->static_link = 1;
s->nocommon = 1;
s->warn_implicit_function_declaration = 1;
s->ms_extensions = 1;

34
sysa/tcc-patched.kaem Executable file
View file

@ -0,0 +1,34 @@
#!/bin/sh
set -ex
# Vars
prefix=/after
libdir=${prefix}/lib
bindir=${prefix}/bin
# Patch
patch -Np0 -i ../patches/tcc/static-link.patch
# Compile
## We have to use 0.9.26 to recompile 0.9.27, 0.9.27 is not self-hosting for
## whatever reason.
boot5-tcc \
-v \
-static \
-o ${bindir}/tcc \
-D TCC_TARGET_I386=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\" \
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
-D CONFIG_TCC_STATIC=1 \
-D CONFIG_USE_LIBGCC=1 \
-D TCC_VERSION=\"0.9.27\" \
-D ONE_SOURCE=1 \
tcc.c
# Test
tcc -version