Move tcc 0.9.27 after bzip2.

This also allows to merge two builds of tcc 0.9.27.
Drop tcc 0.9.27 git submodule.
This commit is contained in:
Andrius Štikonas 2021-04-15 01:45:06 +01:00
parent f030a3a74e
commit 419cd74d92
29 changed files with 98 additions and 166 deletions

View File

@ -56,5 +56,6 @@ c365874794187f8444e5d22998cd5888ffa47f36def4b77517a808dec27c0600 sed-4.0.9.tar.
404a8d72427a559c074e581bf8f7d5a73283faf249cd3faf6dc1c6faf97d07c7 sha-2-61555d.tar.gz 404a8d72427a559c074e581bf8f7d5a73283faf249cd3faf6dc1c6faf97d07c7 sha-2-61555d.tar.gz
c6c37e888b136ccefab903c51149f4b7bd659d69d4aea21245f61053a57aa60a tar-1.12.tar.gz c6c37e888b136ccefab903c51149f4b7bd659d69d4aea21245f61053a57aa60a tar-1.12.tar.gz
63bebd26879c5e1eea4352f0d03c991f966aeb3ddeb3c7445c902568d5411d28 tar-1.34.tar.xz 63bebd26879c5e1eea4352f0d03c991f966aeb3ddeb3c7445c902568d5411d28 tar-1.34.tar.xz
de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c tcc-0.9.27.tar.bz2
1b700d375e253e88bdf79caa244284a899b80f59fd64fdd3aaa6408b7bd715ae untar.c 1b700d375e253e88bdf79caa244284a899b80f59fd64fdd3aaa6408b7bd715ae untar.c
166c48d2842519bc4f96333bff9e265f8cdda44d38e40594ef3f9bbb52890490 xz-5.0.5.tar.bz2 166c48d2842519bc4f96333bff9e265f8cdda44d38e40594ef3f9bbb52890490 xz-5.0.5.tar.bz2

View File

@ -85,6 +85,11 @@ recompiled 5(!) times to add new features that are required for other
features, namely ``long long`` and ``float``. Each time, the libc is features, namely ``long long`` and ``float``. Each time, the libc is
also recompiled. also recompiled.
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
old tooling instead.
untar untar
===== =====
@ -93,18 +98,6 @@ code, often compressed also. To avoid continuing using submodules we
switch to software distribution using tar tarchives. ``untar.c`` is switch to software distribution using tar tarchives. ``untar.c`` is
a single file implementation of tar format and is part of libarchive 3.4. a single file implementation of tar format and is part of libarchive 3.4.
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. We then recompile the libc once more.
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 old tooling instead.
gzip 1.2.4 gzip 1.2.4
========== ==========
@ -117,7 +110,7 @@ Going forward, we can now use ``.tar.gz`` for source code.
tar 1.12 tar 1.12
======== ========
We build GNU tar 1.12, the last version compilable with mes libc. We build GNU Tar 1.12, the last version compilable with mes libc.
sed 4.0.9 sed 4.0.9
========= =========
@ -129,7 +122,7 @@ patch 2.5.9
``patch`` is a very useful tool at this stage, allowing us to make ``patch`` is a very useful tool at this stage, allowing us to make
significantly more complex edits, including just changes to lines. significantly more complex edits, including just changes to lines.
Luckily, we are able to patch patch using sed only. Luckily, we are able to patch ``patch`` using ``sed`` only.
sha-2 sha-2
===== =====
@ -146,23 +139,6 @@ We have now just built ``sha256sum``, which has a significantly (many orders
of magnitude) lower collision rate than ``fletcher16``, so we recheck all of of magnitude) lower collision rate than ``fletcher16``, so we recheck all of
the existing binaries using ``sha256sum``. the existing binaries using ``sha256sum``.
patched mes-libc
================
Since patch is available at this point, we can apply additional fixes to
mes-libc that are not included in the wip-m2 branch and recompile libc.
patched tinycc
==============
In Guix, tinycc is patched to force static linking. Prior to this step,
we have been forced to manually specify static linking for each tool.
Now that we have patch, we can patch tinycc to force static linking and
then recompile it.
Note that we have to do this using tinycc 0.9.26, as tinycc 0.9.27
cannot recompile itself for unknown reasons.
make 3.80 make 3.80
========= =========
@ -176,6 +152,23 @@ bzip2 1.0.8
``bzip2`` is a compression format that compresses more than ``gzip``. It ``bzip2`` is a compression format that compresses more than ``gzip``. It
is preferred where we can use it, and makes source code sizes smaller. is preferred where we can use it, and makes source code sizes smaller.
patched mes-libc
================
Since patch is available at this point, we can apply additional fixes to
mes-libc that are not included in the wip-m2 branch and recompile libc.
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. We then recompile the libc once more.
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 coreutils 5.0
============= =============
@ -238,8 +231,9 @@ tcc 0.9.27 (musl)
================= =================
We recompile ``tcc`` against musl. This is a two stage process. First we We recompile ``tcc`` against musl. This is a two stage process. First we
build tcc-0.9.27 that itself links to Mes C library but produces build tcc-0.9.27 using tcc-0.9.26 that itself links to Mes C library but produces
binaries linked to musl. Then we recompile newly produced tcc with binaries linked to musl (we have to do it using older `tcc` because
tcc-0.9.27 is not self hosting). Then we recompile newly produced tcc with
itself. Interestingly, tcc-0.9.27 linked against musl is self hosting. itself. Interestingly, tcc-0.9.27 linked against musl is self hosting.
musl 1.1.24 (tcc-musl) musl 1.1.24 (tcc-musl)

13
sysa.py
View File

@ -116,7 +116,8 @@ class SysA:
# Install base files # Install base files
src_tree = os.path.join(self.sysa_dir, target_name) src_tree = os.path.join(self.sysa_dir, target_name)
copytree(src_tree, self.after_dir) copytree(src_tree, self.after_dir)
os.mkdir(target_src_dir) if not os.path.isdir(target_src_dir):
os.mkdir(target_src_dir)
for i, _ in enumerate(urls): for i, _ in enumerate(urls):
# Download files into cache directory # Download files into cache directory
@ -190,7 +191,6 @@ class SysA:
self.mescc_tools_extra() self.mescc_tools_extra()
self.mes() self.mes()
self.tcc_0_9_26() self.tcc_0_9_26()
self.tcc_0_9_27()
self.get_packages() self.get_packages()
def create_after_dirs(self): def create_after_dirs(self):
@ -252,15 +252,11 @@ class SysA:
"""TinyCC 0.9.26 (patched by janneke)""" """TinyCC 0.9.26 (patched by janneke)"""
copytree(os.path.join(self.sysa_dir, 'tcc-0.9.26'), self.after_dir) copytree(os.path.join(self.sysa_dir, 'tcc-0.9.26'), self.after_dir)
def tcc_0_9_27(self):
"""TinyCC 0.9.27"""
copytree(os.path.join(self.sysa_dir, 'tcc-0.9.27'), self.after_dir)
# pylint: disable=line-too-long,too-many-statements # pylint: disable=line-too-long,too-many-statements
def get_packages(self): def get_packages(self):
"""Prepare remaining sources""" """Prepare remaining sources"""
# untar from libarchive 3.4 # untar from libarchive 3.4
self.get_file("https://raw.githubusercontent.com/libarchive/libarchive/3.4/contrib/untar.c", mkbuild=True) self.get_file("https://raw.githubusercontent.com/libarchive/libarchive/3.4/contrib/untar.c")
# gzip 1.2.4 # gzip 1.2.4
self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar", mkbuild=True) self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar", mkbuild=True)
@ -284,6 +280,9 @@ class SysA:
# bzip2 1.0.8 # bzip2 1.0.8
self.get_file("https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz", mkbuild=True) self.get_file("https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz", mkbuild=True)
# tcc 0.9.27
self.get_file("https://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27.tar.bz2", mkbuild=True)
# coreutils 5.0 # coreutils 5.0
self.get_file("https://mirrors.kernel.org/gnu/coreutils/coreutils-5.0.tar.bz2", mkbuild=True) self.get_file("https://mirrors.kernel.org/gnu/coreutils/coreutils-5.0.tar.bz2", mkbuild=True)

View File

@ -56,12 +56,6 @@ cd ${pkg}
kaem --file ${pkg}.kaem kaem --file ${pkg}.kaem
cd .. cd ..
# tcc 0.9.27
pkg="tcc-0.9.27"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# gzip # gzip
pkg="gzip-1.2.4" pkg="gzip-1.2.4"
cd ${pkg} cd ${pkg}
@ -95,16 +89,6 @@ cd ..
# Check all up to this part as sha256sum # Check all up to this part as sha256sum
sha256sum -c pre-sha.sha256sums sha256sum -c pre-sha.sha256sums
# mes-libc-patched
cd tcc-0.9.27
kaem --file mes-libc-patched.kaem
cd ..
# tcc-patched
cd tcc-0.9.27
kaem --file tcc-patched.kaem
cd ..
# make # make
pkg="make-3.80" pkg="make-3.80"
cd ${pkg} cd ${pkg}
@ -117,6 +101,17 @@ cd ${pkg}
kaem --file ${pkg}.kaem kaem --file ${pkg}.kaem
cd .. cd ..
# mes-libc-patched
cd tcc-0.9.27
kaem --file mes-libc-patched.kaem
cd ..
# tcc 0.9.27
pkg="tcc-0.9.27"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# coreutils # coreutils
pkg="coreutils-5.0" pkg="coreutils-5.0"
cd ${pkg} cd ${pkg}

View File

@ -1,2 +1,2 @@
74cb8b1278d648d3f63b71cc5b055a83e83e12a044c7e533c1b348ee8cf34314 /after/bin/bzip2 6b7d8a7a65da9beb4c6deb0391be5f1f0da18e77d3f292ae433ffc43b89a3a5f /after/bin/bzip2
74cb8b1278d648d3f63b71cc5b055a83e83e12a044c7e533c1b348ee8cf34314 /after/bin/bunzip2 6b7d8a7a65da9beb4c6deb0391be5f1f0da18e77d3f292ae433ffc43b89a3a5f /after/bin/bunzip2

View File

@ -1,3 +1,3 @@
47018 /after/bin/gzip 20706 /after/bin/gzip
47018 /after/bin/gunzip 20706 /after/bin/gunzip
47018 /after/bin/zcat 20706 /after/bin/zcat

View File

@ -1 +1 @@
7745ab1036a83ed63416af84bd166bfe768554ac393fbc53818acd4ccc18ce7f /after/bin/make 06699b2728829d9c989f28a28af3d9ea00391a8678140af77a5ba4892244c4e8 /after/bin/make

View File

@ -1 +1 @@
10790 /after/bin/patch 62187 /after/bin/patch

View File

@ -7,19 +7,19 @@ d4708bc79bee1f4d23789866380a98b5ed0e165ac8ca917b8b928c2d323ddc10 /after/bin/boo
773eae17b7f347526f8033afc9d1f06af116dfbcd0a26cbde7e29ab47e77850d /after/bin/chmod 773eae17b7f347526f8033afc9d1f06af116dfbcd0a26cbde7e29ab47e77850d /after/bin/chmod
764881d80efac5509aa85fd4683a20beffa831442f57815d43ee030fb8f9f486 /after/bin/cp 764881d80efac5509aa85fd4683a20beffa831442f57815d43ee030fb8f9f486 /after/bin/cp
e1481ecf337fb657f3949af0b45bb620c1886cd1a1b003fe27338832c250f41d /after/bin/fletcher16 e1481ecf337fb657f3949af0b45bb620c1886cd1a1b003fe27338832c250f41d /after/bin/fletcher16
fc2d3f6a7227836526d278d4e4b642a72c1a83c03c3363f3376100798e0eb145 /after/bin/gunzip c8c923c0bea92a642e1b3e5dde162bb7c35ea14a75e0f8fbb811d7ea92edffe6 /after/bin/gunzip
fc2d3f6a7227836526d278d4e4b642a72c1a83c03c3363f3376100798e0eb145 /after/bin/gzip c8c923c0bea92a642e1b3e5dde162bb7c35ea14a75e0f8fbb811d7ea92edffe6 /after/bin/gzip
e835fdb1cd8c7852e8c879f1efdea6f7392bdd04938f5a01a6199ab2730fac4b /after/bin/mes e835fdb1cd8c7852e8c879f1efdea6f7392bdd04938f5a01a6199ab2730fac4b /after/bin/mes
b91c81e543b878ead4cc975df75e3d211f7bd2dcdd4c90e42df99d44311ce71e /after/bin/mescc.scm b91c81e543b878ead4cc975df75e3d211f7bd2dcdd4c90e42df99d44311ce71e /after/bin/mescc.scm
e94a2468c045582cfd13df51acd0932afdc834fa60139f7bfb7a2d65afa39a65 /after/bin/mes-tcc e94a2468c045582cfd13df51acd0932afdc834fa60139f7bfb7a2d65afa39a65 /after/bin/mes-tcc
3cf426251744300a099a40f3609ccbd32ec3b9f3334601defa5736e7fd6c6f1d /after/bin/patch 032c0a3bb32b542f7d3eb0305bd89898ab2fc4b9fd0502085337e3422db1f393 /after/bin/patch
d453932b7d83fc3e183afeca65c1afb2a620b985c378ee072710e0cc593d9811 /after/bin/sed 61d9850bf8348a5571f59231e392a06021c9be78f32797943d98bc493ea5b03f /after/bin/sed
bc9ddf9854bd954c71bb1cf5b0af77fd65b8fa7f290b42c75020fb8893deb53c /after/bin/sha256sum c09ac8658c8853f5316c8abbf5b8379dba03a42dfc3eb9c07982a4da85480b6f /after/bin/sha256sum
74e0a13cb6e92d70c43f71ec704afbc44b7a38c703fe40700f7af7c640a22158 /after/bin/untar 74e0a13cb6e92d70c43f71ec704afbc44b7a38c703fe40700f7af7c640a22158 /after/bin/untar
957229511dc5ac62a949dbd76e965e3a476ce214b8e6fc7f120bf17d195b924b /after/bin/tar ade67862293d3193aaa569931d520dab26b26fcfebd538346a2a83195a59d7e7 /after/bin/tar
690c2a941c444ba761076f6b8ef1ba2b634ebe2e63ea44c8f3789f6e3df6d2a9 /after/bin/tcc 819ebd10859c34f1f34b5ab341fdce4541ccade97ec96b7eac5876875f91e8a7 /after/bin/tcc
cacc2cda3ce6c2cc0cb761b8aa2115a003e166c94d1039974fc0221263897c52 /after/bin/tcc-0.9.26 819ebd10859c34f1f34b5ab341fdce4541ccade97ec96b7eac5876875f91e8a7 /after/bin/tcc-0.9.26
fc2d3f6a7227836526d278d4e4b642a72c1a83c03c3363f3376100798e0eb145 /after/bin/zcat c8c923c0bea92a642e1b3e5dde162bb7c35ea14a75e0f8fbb811d7ea92edffe6 /after/bin/zcat
44b5f15e1f015685fe4c3d66eda5ba52aac77b94f2edd98b764cec05ca350d49 /after/lib/crt1.o 44b5f15e1f015685fe4c3d66eda5ba52aac77b94f2edd98b764cec05ca350d49 /after/lib/crt1.o
90811dafd33ad56b8e4b0adcc04263f9329b9047b7cc337abe8151a75017172c /after/lib/x86-mes/crt1.s 90811dafd33ad56b8e4b0adcc04263f9329b9047b7cc337abe8151a75017172c /after/lib/x86-mes/crt1.s
09d4f9821a2566f7e56381a19259c41bd97f3c5ed83f490705acbfd1139a7736 /after/lib/crti.o 09d4f9821a2566f7e56381a19259c41bd97f3c5ed83f490705acbfd1139a7736 /after/lib/crti.o

View File

@ -96,7 +96,7 @@ build musl-1.1.24 binutils-rebuild.sh checksums/pass3 patches-pass3
populate_device_nodes populate_device_nodes
# Rebuild tcc-musl using new musl # Rebuild tcc-musl using new musl
build tcc-0.9.27 tcc-musl-pass3.sh checksums/tcc-musl-pass3 build tcc-0.9.27 tcc-musl-pass3.sh checksums/tcc-musl-pass3 patches-musl-pass3
build autoconf-2.53 stage1.sh build autoconf-2.53 stage1.sh
build autoconf-2.53 stage2.sh build autoconf-2.53 stage2.sh

View File

@ -1 +1 @@
10514 /after/bin/sed 32529 /after/bin/sed

View File

@ -1 +1 @@
53384 /after/bin/sha256sum 11460 /after/bin/sha256sum

View File

@ -1 +1 @@
3497 /after/bin/tar 56696 /after/bin/tar

View File

@ -1,8 +1,6 @@
35075 /after/bin/tcc 0bd8c89f8eee4b8e185b404308a79b3cd315a2143f864d7c250a8f088ae1149d /after/bin/tcc
47832 /after/lib/libc.a a1313f0a2aef2e63a3d03b2c8de98e6c022f0999e4d7e039bd140c250be4a4da /after/lib/libc.a
47832 /after/lib/libc+gnu.a 12c07ae103e7e3b390150a79e5c600d88de14e9bb73a066f6342582729ef5a3f /after/lib/libgetopt.a
54049 /after/lib/libgetopt.a d1168ee9b528e39f0b40e8d51fb7fa3619c4a5ee928137f7faf6d0879b0916b0 /after/lib/crt1.o
23061 /after/lib/crt1.o 09d4f9821a2566f7e56381a19259c41bd97f3c5ed83f490705acbfd1139a7736 /after/lib/crti.o
16980 /after/lib/crti.o 461ca1494737fab86fe1c1d3addeaf9d0ece413e353abcdea8674db3f700cda3 /after/lib/crtn.o
47705 /after/lib/crtn.o
54138 /after/lib/tcc/libtcc1.a

View File

@ -1,2 +1 @@
c65633cb875609df7aab2225a24334b5853a0b3e097bdb3ba8a0ae80c1bf5bf0 /after/bin/tcc-musl c65633cb875609df7aab2225a24334b5853a0b3e097bdb3ba8a0ae80c1bf5bf0 /after/bin/tcc-musl
a650b13efc65073fb851e9db89728089d8845c401f85faaa09801874ab058089 /after/lib/tcc/libtcc1.a

View File

@ -1,2 +1 @@
068384be93b6654d6ad555881eaf24d221cc3edf229465f050fec30c30648047 /after/bin/tcc-musl 068384be93b6654d6ad555881eaf24d221cc3edf229465f050fec30c30648047 /after/bin/tcc-musl
a650b13efc65073fb851e9db89728089d8845c401f85faaa09801874ab058089 /after/lib/tcc/libtcc1.a

View File

@ -1 +0,0 @@
0bd8c89f8eee4b8e185b404308a79b3cd315a2143f864d7c250a8f088ae1149d /after/bin/tcc

View File

@ -6,10 +6,6 @@
set -ex set -ex
# libtcc1.a
tcc -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
tcc -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
cd ../mes-libc
# crt{1,n,i}.o # crt{1,n,i}.o
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crt1.o lib/linux/x86-mes-gcc/crt1.c
tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o ${libdir}/crtn.o lib/linux/x86-mes-gcc/crtn.c

View File

@ -10,11 +10,10 @@ set -ex
cd src/mes-libc cd src/mes-libc
# Patch # Patch
patch -Np0 -i ../../patches/mes-libc-qsort.patch patch -Np0 -i ../../patches-mes-libc/qsort.patch
patch -Np0 -i ../../patches/mes-libc-crt1.patch patch -Np0 -i ../../patches-mes-libc/crt1.patch
# Recompile libc # Recompile libc
cd ../tcc-0.9.27
kaem --file ../../compile-libc.kaem kaem --file ../../compile-libc.kaem
cd ../.. cd ../..

View File

@ -0,0 +1 @@
../patches/ignore-static-inside-array.patch

View File

@ -0,0 +1 @@
../patches/static-link.patch

@ -1 +0,0 @@
Subproject commit d348a9a51d32cece842b7885d27a411436d7887b

View File

@ -1,21 +1,31 @@
#!/bin/sh #!/bin/sh
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space> # SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
set -ex set -ex
cd src/tcc-0.9.27 cd build
# Extract
bunzip2 ../src/${pkg}.tar.bz2
tar xf ../src/${pkg}.tar
cd ${pkg}
# Create config.h # Create config.h
catm config.h catm config.h
# Compile the binary # Patch
tcc \ patch -Np0 -i ../../patches/static-link.patch
patch -Np0 -i ../../patches/ignore-static-inside-array.patch
# Compile
tcc-0.9.26 \
-v \ -v \
-static \ -static \
-o tcc \ -o ${bindir}/tcc \
-D TCC_TARGET_I386=1 \ -D TCC_TARGET_I386=1 \
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \ -D CONFIG_TCCDIR=\"${libdir}/tcc\" \
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \ -D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
@ -29,17 +39,14 @@ tcc \
-D ONE_SOURCE=1 \ -D ONE_SOURCE=1 \
tcc.c tcc.c
# Install the binary
cp tcc ${bindir}/tcc
chmod 755 ${bindir}/tcc
# Test # Test
tcc -version tcc -version
# Recompile libc # Recompile libc
cd ../../src/mes-libc/
kaem --file ../../compile-libc.kaem kaem --file ../../compile-libc.kaem
cd ../.. cd ../..
# Checksums # Checksums
fletcher16 checksums/tcc-0.9.27 sha256sum -c checksums/tcc-0.9.27

View File

@ -2,14 +2,10 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
src_unpack() {
cp -r ../src/tcc-0.9.27 .
}
src_prepare() { src_prepare() {
# Note that tcc includes static-link and ignore-static-inside-array patches default_src_prepare
# since we do not build from clean checkout.
patch -Np0 -i ../../patches/ignore-duplicate-symbols.patch touch config.h
} }
src_compile() { src_compile() {

View File

@ -3,15 +3,10 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
src_unpack() {
cp -r ../src/tcc-0.9.27 .
}
src_prepare() { src_prepare() {
# Note that tcc includes static-link and ignore-static-inside-array patches default_src_prepare
# since we do not build from clean checkout.
patch -Np0 -i ../../patches/ignore-duplicate-symbols.patch touch config.h
} }
src_compile() { src_compile() {

View File

@ -3,15 +3,10 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
src_unpack() {
cp -r ../src/tcc-0.9.27 .
}
src_prepare() { src_prepare() {
# Note that tcc includes static-link and ignore-static-inside-array patches default_src_prepare
# since we do not build from clean checkout.
: touch config.h
} }
src_compile() { src_compile() {

View File

@ -1,41 +0,0 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
cd src/tcc-0.9.27
# Patch
patch -Np0 -i ../../patches/static-link.patch
patch -Np0 -i ../../patches/ignore-static-inside-array.patch
# Compile
## We have to use 0.9.26 to recompile 0.9.27, 0.9.27 is not self-hosting for
## whatever reason.
tcc-0.9.26 \
-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
cd ../..
# Checksums
sha256sum -c checksums/tcc-patched