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

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

View file

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

View file

@ -1,2 +1 @@
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
# 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
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

View file

@ -10,11 +10,10 @@ set -ex
cd src/mes-libc
# Patch
patch -Np0 -i ../../patches/mes-libc-qsort.patch
patch -Np0 -i ../../patches/mes-libc-crt1.patch
patch -Np0 -i ../../patches-mes-libc/qsort.patch
patch -Np0 -i ../../patches-mes-libc/crt1.patch
# Recompile libc
cd ../tcc-0.9.27
kaem --file ../../compile-libc.kaem
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
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
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
catm config.h
# Compile the binary
tcc \
# Patch
patch -Np0 -i ../../patches/static-link.patch
patch -Np0 -i ../../patches/ignore-static-inside-array.patch
# Compile
tcc-0.9.26 \
-v \
-static \
-o tcc \
-o ${bindir}/tcc \
-D TCC_TARGET_I386=1 \
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
@ -29,17 +39,14 @@ tcc \
-D ONE_SOURCE=1 \
tcc.c
# Install the binary
cp tcc ${bindir}/tcc
chmod 755 ${bindir}/tcc
# Test
tcc -version
# Recompile libc
cd ../../src/mes-libc/
kaem --file ../../compile-libc.kaem
cd ../..
# 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
src_unpack() {
cp -r ../src/tcc-0.9.27 .
}
src_prepare() {
# Note that tcc includes static-link and ignore-static-inside-array patches
# since we do not build from clean checkout.
patch -Np0 -i ../../patches/ignore-duplicate-symbols.patch
default_src_prepare
touch config.h
}
src_compile() {

View file

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

View file

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