commit: 20c2d4c36e52a94b66943c86ab09c04844fc97a1
parent 278b2390f7006e1839b6f1e43e7776d48f34648e
Author: Andrius Štikonas <andrius@stikonas.eu>
Date: Sun, 25 Dec 2022 01:49:54 +0000
Build tcc 0.9.27 immediately after tcc 0.9.26.
Diffstat:
27 files changed, 107 insertions(+), 60 deletions(-)
diff --git a/parts.rst b/parts.rst
@@ -86,6 +86,15 @@ recompiled 5(!) times to add new features that are required for other
features, namely ``long long`` and ``float``. Each time, the libc is
also recompiled.
+tinycc 0.9.27
+=============
+
+Now, we compile upstream tcc 0.9.27, the latest release of tinycc, using
+the final version of tcc 0.9.26.
+
+From this point onwards, until further notice, all programs are compiled
+using tinycc 0.9.27.
+
Note that now we begin to delve into the realm of old GNU software,
using older versions compilable by tinycc. Prior to this point, all tools
have been adapted significantly for the bootstrap; now, we will be using
@@ -120,7 +129,6 @@ patch 2.5.9
``patch`` is a very useful tool at this stage, allowing us to make
significantly more complex edits, including just changes to lines.
-Luckily, we are able to patch ``patch`` using ``sed`` only.
bzip2 1.0.8
===========
@@ -128,17 +136,6 @@ bzip2 1.0.8
``bzip2`` is a compression format that compresses more than ``gzip``. It
is preferred where we can use it, and makes source code sizes smaller.
-tinycc 0.9.27
-=============
-
-Now, we compile upstream tcc 0.9.27, the latest release of tinycc, using
-the final version of tcc 0.9.26.
-
-From this point onwards, until further notice, all programs are compiled
-using tinycc 0.9.27.
-
-We patch tinycc to force static linking.
-
coreutils 5.0
=============
@@ -183,6 +180,11 @@ manually modified so that it can be processed by lex from the Heirloom
project (the required modifications are mostly syntactical, plus a few
workarounds to avoid some flex advanced features).
+tcc 0.9.27 (patched)
+=================
+
+We recompile ``tcc`` against with some patches needed to build musl.
+
musl 1.1.24
===========
diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs
@@ -94,9 +94,10 @@ c69e0197ebc1bf9f9fc68a06d4c649c934784077058c24a484da59a153132816 pkg-config-0.2
8a0248fbf8fe1764580698415cc3628585d4dd054ddf63040f400e18cbaef7a4 sed-4.0.9_0.tar.bz2
b4aec2c2b107562c0d1e173259ad8c4484d1ebedb9ee24faa33a2159bdfd04b6 sed4.8-0_0.x86.xbps
1245905d8942a10cccf21850a521db19c9a65ab35cef4c6bbb72672773851048 tar-1.34_0.tar.bz2
-42b8eabbd299737541b57b3aa362eeeb20499449901fc2a4895302ce0117080c tcc-0.9.27_0.tar.bz2
-db57c6ef39965f0562d2aefe3c06571df50ba1265446d97f2714d80518862cef tcc-0.9.27_1.tar.bz2
-e2014b844b1a79cda9142a38af0404efd242ae02f77aa286c968e4ad6ad87265 tcc-0.9.27_2.tar.bz2
+5e7fdb405574717e3759144fab500954817ab8852d2da6111d43cb9fe77f01ac tcc-0.9.27_0.tar.bz2
+42b8eabbd299737541b57b3aa362eeeb20499449901fc2a4895302ce0117080c tcc-0.9.27_1.tar.bz2
+db57c6ef39965f0562d2aefe3c06571df50ba1265446d97f2714d80518862cef tcc-0.9.27_2.tar.bz2
+e2014b844b1a79cda9142a38af0404efd242ae02f77aa286c968e4ad6ad87265 tcc-0.9.27_3.tar.bz2
3a9ee359fe490d64225f14cddeb749dda1a24a1bb39bbc7300336b2fe4419538 texinfo6.7-0_0.x86.xbps
bf4a6be34cda165e4c206e852ccc09387f5ae8ea7db6de2db01297cabfa1a486 util-linux-2.19.1_0.tar.bz2
c091eb91d33ef7b7747800ee3758337f3ef9334f83e294dcddb0e492f7ea6ecf which2.21-0_0.x86.xbps
diff --git a/sysa/after.kaem b/sysa/after.kaem
@@ -36,6 +36,7 @@ cp /${ARCH_DIR}/bin/M2-Mesoplanet ${bindir}/M2-Mesoplanet
cp /${ARCH_DIR}/bin/M2-Planet ${bindir}/M2-Planet
cp /${ARCH_DIR}/bin/mkdir ${bindir}/mkdir
cp /${ARCH_DIR}/bin/sha256sum ${bindir}/sha256sum
+cp /${ARCH_DIR}/bin/unbz2 ${bindir}/unbz2
cp /${ARCH_DIR}/bin/ungz ${bindir}/ungz
cp /${ARCH_DIR}/bin/untar ${bindir}/untar
cp /${ARCH_DIR}/bin/cp ${bindir}/cp
@@ -55,6 +56,7 @@ chmod 755 ${bindir}/M2-Mesoplanet
chmod 755 ${bindir}/M2-Planet
chmod 755 ${bindir}/mkdir
chmod 755 ${bindir}/sha256sum
+chmod 755 ${bindir}/unbz2
chmod 755 ${bindir}/ungz
chmod 755 ${bindir}/untar
chmod 755 ${bindir}/replace
diff --git a/sysa/bash-2.05b/mk/main.mk b/sysa/bash-2.05b/mk/main.mk
@@ -13,7 +13,7 @@ CFLAGS = \
-Ibuiltins \
$(COMMON_CFLAGS)
-LDFLAGS = -L. -Lbuiltins
+LDFLAGS = -L. -Lbuiltins -static
LIBRARIES = libsh.a builtins/libbuiltins.a libglob.a libtilde.a
SHLIB_FILES = clktck getcwd getenv oslib setlinebuf strcasecmp strerror strtod \
diff --git a/sysa/bzip2-1.0.8/bzip2-1.0.8.checksums b/sysa/bzip2-1.0.8/bzip2-1.0.8.checksums
@@ -1 +1 @@
-c6fdc2f9e349353cd08ce632fc1a0951826a1266d610b3c3afd60087d28be171 /usr/bin/bzip2
+c8aca3a1a941002471bf8f0901808151603e7226b68fe28b78df00353ac9a54e /usr/bin/bzip2
diff --git a/sysa/bzip2-1.0.8/bzip2-1.0.8.kaem b/sysa/bzip2-1.0.8/bzip2-1.0.8.kaem
@@ -25,7 +25,7 @@ patch -Np0 -i ../../patches/mes-libc.patch
patch -Np0 -i ../../patches/coreutils.patch
# Build
-make CC=tcc AR="tcc -ar" bzip2
+make CC=tcc AR="tcc -ar" LDFLAGS="-static" bzip2
# Install
cp bzip2 ${prefix}/bin/bzip2
diff --git a/sysa/coreutils-5.0/mk/main.mk b/sysa/coreutils-5.0/mk/main.mk
@@ -12,6 +12,7 @@ VERSION=5.0
CC = tcc
LD = tcc
AR = tcc -ar
+LDFLAGS = -static
bindir=$(PREFIX)/bin
diff --git a/sysa/flex-2.5.11/mk/main.mk b/sysa/flex-2.5.11/mk/main.mk
@@ -5,14 +5,15 @@
# SPDX-License-Identifier: GPL-3.0-or-later
CFLAGS = -DVERSION=\"2.5.11\"
+LDFLAGS = -static
all: flex
flex: ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o
- tcc -o $@ $^ -ll
+ tcc -o $@ $^ -ll $(LDFLAGS)
flex-tmp: ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan-tmp.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o
- tcc -o $@ $^ -ll
+ tcc -o $@ $^ -ll $(LDFLAGS)
%.o: %.c
tcc -g -c $(CFLAGS) -o $@ $<
diff --git a/sysa/gzip-1.2.4/gzip-1.2.4.checksums b/sysa/gzip-1.2.4/gzip-1.2.4.checksums
@@ -1 +1 @@
-df921cd658fd73dc770be62ecf8adfc50761526cbeb5d0161ab68233df142fe1 /usr/bin/gzip
+363d9a67c192530a76b41be906a1a22e307f9bc057d520a319f9757cc8f147dc /usr/bin/gzip
diff --git a/sysa/gzip-1.2.4/mk/main.mk b/sysa/gzip-1.2.4/mk/main.mk
@@ -5,12 +5,11 @@
CC = tcc
AR = tcc -ar
-# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic
-# This is to avoid running configure test to determine sizeof(long long)
CPPFLAGS = -DNO_UTIME \
-Dstrlwr=unused
-CFLAGS = -I . -static
+CFLAGS = -I .
+LDFLAGS = -static
.PHONY: all
@@ -20,4 +19,4 @@ GZIP_OBJ = $(addsuffix .o, $(GZIP_SRC))
all: gzip
gzip: $(GZIP_OBJ)
- $(CC) $^ -o $@
+ $(CC) $(LDFLAGS) $^ -o $@
diff --git a/sysa/heirloom-devtools-070527/heirloom-devtools-070527.kaem b/sysa/heirloom-devtools-070527/heirloom-devtools-070527.kaem
@@ -29,7 +29,7 @@ patch -Np0 -i ../../patches/lex_remove_wchar.patch
# Build yacc
cd yacc
-make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt RANLIB=true
+make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
# Install yacc
install yacc ${bindir}
@@ -37,7 +37,7 @@ install -m 644 yaccpar /
# Build lex
cd ../lex
-make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt RANLIB=true
+make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
# Install lex
mkdir ${lexdir}
diff --git a/sysa/make-3.80/make-3.80.checksums b/sysa/make-3.80/make-3.80.checksums
@@ -1 +1 @@
-3846fe9be3f59a16c688ba2b34e56ec7213239583f505a04aef93f00287bf404 /usr/bin/make
+8112529259780fe659ba68030d1ba1a64589ece80d0f328523395029827bd41f /usr/bin/make
diff --git a/sysa/make-3.80/make-3.80.kaem b/sysa/make-3.80/make-3.80.kaem
@@ -14,7 +14,7 @@ mkdir build src
cd build
# Extract
-ungz --file ${distfiles}/${pkg}.tar.gz --output ../src/${pkg}.tar
+unbz2 --file ${distfiles}/${pkg}.tar.bz2 --output ../src/${pkg}.tar
untar --file ../src/${pkg}.tar
rm ../src/${pkg}.tar
cd ${pkg}
@@ -51,7 +51,7 @@ tcc -c -Iglob -DSTDC_HEADERS glob/fnmatch.c
tcc -c -Iglob -DHAVE_STRDUP -DHAVE_DIRENT_H glob/glob.c
# Link
-tcc -o ${bindir}/make getopt.o getopt1.o ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o implicit.o job.o main.o misc.o read.o remake.o rule.o signame.o variable.o version.o vpath.o hash.o remote-stub.o getloadavg.o fnmatch.o glob.o
+tcc -static -o ${bindir}/make getopt.o getopt1.o ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o implicit.o job.o main.o misc.o read.o remake.o rule.o signame.o variable.o version.o vpath.o hash.o remote-stub.o getloadavg.o fnmatch.o glob.o
# Test
make --version
diff --git a/sysa/make-3.80/sources b/sysa/make-3.80/sources
@@ -1 +1 @@
-https://mirrors.kernel.org/gnu/make/make-3.80.tar.gz 64b30b41fde2ebf669e6af489883fb1df6a06ac30555a96cfa3c39ecce7267dd
+https://mirrors.kernel.org/gnu/make/make-3.80.tar.bz2 a99b39e7b04c333724f48c38fede709481cfb69fafe7e32ae4285b7fadf92f1b
diff --git a/sysa/make-3.82/sources b/sysa/make-3.82/sources
@@ -1 +1 @@
-https://mirrors.kernel.org/gnu/make/make-3.82.tar.gz 3d991b33e604187c5881a0abc2e102d5b9776da5569640e73778f85d617242e7
+https://mirrors.kernel.org/gnu/make/make-3.82.tar.bz2 e2c1a73f179c40c71e2fe8abf8a8a0688b8499538512984da4a76958d0402966
diff --git a/sysa/patch-2.5.9/mk/main.mk b/sysa/patch-2.5.9/mk/main.mk
@@ -11,5 +11,5 @@ LDFLAGS = -static
.PHONY: all
all: patch
-patch: error.o getopt.o getopt1.o addext.o argmatch.o backupfile.o basename.o dirname.o inp.o maketime.o partime.o patch.o pch_patched.o quote.o quotearg.o quotesys.o util.o version.o xmalloc.o
+patch: error.o getopt.o getopt1.o addext.o argmatch.o backupfile.o basename.o dirname.o inp.o maketime.o partime.o patch.o pch.o quote.o quotearg.o quotesys.o util.o version.o xmalloc.o
$(CC) $^ $(LDFLAGS) -o $@
diff --git a/sysa/patch-2.5.9/patch-2.5.9.checksums b/sysa/patch-2.5.9/patch-2.5.9.checksums
@@ -1 +1 @@
-265d486bf4712f2af7c55178d990fec39a39dab9f867623a69e9b37c3d516b2f /usr/bin/patch
+d0633928b5f9892f1db3b84479088c502eeaca3d29ee7de6cd20915917a36d1f /usr/bin/patch
diff --git a/sysa/patch-2.5.9/patch-2.5.9.kaem b/sysa/patch-2.5.9/patch-2.5.9.kaem
@@ -24,10 +24,6 @@ cp ../../mk/main.mk Makefile
catm config.h
catm patchlevel.h
-# Patch
-cp pch.c pch_patched.c
-sed -i 841,848d pch_patched.c
-
# Build
make -f Makefile PREFIX=${prefix}
diff --git a/sysa/run.kaem b/sysa/run.kaem
@@ -36,6 +36,12 @@ cd ..
libdir=${libdir}/mes
+# tcc 0.9.27
+pkg="tcc-0.9.27"
+cd ${pkg}
+kaem --file ${pkg}.kaem
+cd ..
+
# make
pkg="make-3.80"
cd ${pkg}
@@ -72,12 +78,6 @@ cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
-# tcc 0.9.27
-pkg="tcc-0.9.27"
-cd ${pkg}
-kaem --file ${pkg}.kaem
-cd ..
-
# coreutils
pkg="coreutils-5.0"
cd ${pkg}
diff --git a/sysa/run.sh b/sysa/run.sh
@@ -100,6 +100,9 @@ mkdir -p "${DESTDIR}" "${SRCDIR}/repo" /dev
build flex-2.5.11
+# Rebuild tcc with some patches
+build tcc-0.9.27 tcc-mes-pass2.sh
+
build musl-1.1.24
# Rebuild tcc using musl
diff --git a/sysa/sed-4.0.9/mk/main.mk b/sysa/sed-4.0.9/mk/main.mk
@@ -12,8 +12,8 @@ CPPFLAGS = -DENABLE_NLS=0 \
-DSED_FEATURE_VERSION=\"4.0\" \
-DVERSION=\"4.0.9\" \
-DPACKAGE=\"sed\"
-CFLAGS = -I . -I lib -static
-LDFLAGS = -L. -lsed
+CFLAGS = -I . -I lib
+LDFLAGS = -L . -lsed -static
.PHONY: all
diff --git a/sysa/sed-4.0.9/sed-4.0.9.checksums b/sysa/sed-4.0.9/sed-4.0.9.checksums
@@ -1 +1 @@
-68b1a0669544cdc8855ba09c3ff6ab19c3c5543a65d8d56c6f0f15b3dc3fa787 /usr/bin/sed
+cd7cb869b26dd7c2cd0d2b53ab4ef1c2d26a2f16d24ab1f3ff7c3b138fe97469 /usr/bin/sed
diff --git a/sysa/tar-1.12/mk/main.mk b/sysa/tar-1.12/mk/main.mk
@@ -15,8 +15,8 @@ CPPFLAGS = -DHAVE_FCNTL_H \
-DVERSION=\"1.12\" \
-DPACKAGE=\"tar\"
-CFLAGS = -I . -I lib -static
-LDFLAGS = -L. -ltar
+CFLAGS = -I . -I lib
+LDFLAGS = -L . -ltar -static
.PHONY: all
diff --git a/sysa/tar-1.12/tar-1.12.checksums b/sysa/tar-1.12/tar-1.12.checksums
@@ -1 +1 @@
-e197c1b35273bafe7b47dd9ae902eb118327bb1fb16d083608e86a065ac01e42 /usr/bin/tar
+09465058a104cd100368e6ab610650ab83fe660c6f52d5e3d8b186eaefa689e7 /usr/bin/tar
diff --git a/sysa/tcc-0.9.27/tcc-0.9.27.checksums b/sysa/tcc-0.9.27/tcc-0.9.27.checksums
@@ -1 +1 @@
-379d94b17a6762b5acd331cb3f216ff57f50ebd46835a1e8cc0117f4062a96dd /usr/bin/tcc
+dc73141eaa2b75fd6aaa085ef1945577b976ad1304e2875afe98ebc37a4f2f5d /usr/bin/tcc
diff --git a/sysa/tcc-0.9.27/tcc-0.9.27.kaem b/sysa/tcc-0.9.27/tcc-0.9.27.kaem
@@ -11,22 +11,19 @@ set -ex
checksum-transcriber sources
sha256sum -c sources.SHA256SUM
+# Extract
mkdir build src
-cd build
+cd src
+unbz2 --file ${distfiles}/${pkg}.tar.bz2 --output ${pkg}.tar
+cd ..
-# Extract
-cp ${distfiles}/${pkg}.tar.bz2 ../src/
-bunzip2 -f ../src/${pkg}.tar.bz2
-tar xf ../src/${pkg}.tar
+cd build
+untar --file ../src/${pkg}.tar
cd ${pkg}
# Create config.h
catm config.h
-# Patch
-patch -Np0 -i ../../patches/static-link.patch
-patch -Np0 -i ../../patches/ignore-static-inside-array.patch
-
# Compile
tcc-0.9.26 \
-v \
diff --git a/sysa/tcc-0.9.27/tcc-mes-pass2.sh b/sysa/tcc-0.9.27/tcc-mes-pass2.sh
@@ -0,0 +1,45 @@
+# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
+# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+src_prepare() {
+ default
+
+ touch config.h
+}
+
+src_compile() {
+ export libdir=${PREFIX}/lib/mes
+ export incdir=${PREFIX}/include/
+ export bindir=${PREFIX}/bin
+
+ mkdir -p "${libdir}/tcc"
+
+ # We have to compile using tcc-0.9.26 as tcc-0.9.27 is not self-hosting when built with mes
+ tcc-0.9.26 \
+ -v \
+ -static \
+ -o 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=\""${incdir}"\" \
+ -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
+
+ # libtcc1.a
+ tcc-0.9.26 -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
+ tcc-0.9.26 -ar cr "${libdir}/tcc/libtcc1.a" libtcc1.o
+}
+
+src_install() {
+ # Remove old tcc binaries
+ install -D tcc "${DESTDIR}${bindir}/tcc"
+}