Merge pull request #55 from stikonas/musl-rebuild

Rebuild musl with binutils
This commit is contained in:
Andrius Štikonas 2021-03-04 10:07:45 +00:00 committed by GitHub
commit ad54802f21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 114 additions and 3 deletions

View File

@ -407,3 +407,15 @@ managing binary programs, object files, libraries, profile data, and assembly so
In particular we can now use full featured ``ar`` instead of ``tcc -ar``,
the GNU linker ``ld``, which allows us building shared libraries,
and the GNU assembler ``as``.
musl 1.1.24 (v3)
================
We rebuild musl for the third time. This time we use GNU ar rather than ``tcc -ar``,
so we can drop weak symbols patch. Also, we can use GNU as to build assembly source files,
so those assembly files that tcc failed to compile no longer have to be patched.
tcc 0.9.27 (musl v3)
====================
We rebuild tcc against new musl and without a patch to ignore duplicate symbols.

View File

@ -22,7 +22,7 @@ build () {
cd "$pkg" || (echo "Cannot cd into ${pkg}!"; kill $$)
echo "${pkg}: beginning build using script ${script_name}"
base_dir="${PWD}"
patch_dir="${base_dir}/patches"
patch_dir="${base_dir}/${4:-patches}"
mk_dir="${base_dir}/mk"
files_dir="${base_dir}/files"

View File

@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default_src_prepare
# tcc does not support complex types
rm -rf src/complex
}
src_configure() {
CC=tcc ./configure \
--host=i386 \
--disable-shared \
--prefix=/after \
--libdir=/after/lib/musl/ \
--includedir=/after/include/musl
# configure script creates this file
test -f /dev/null && rm /dev/null
}
src_compile() {
make CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<'
}

View File

@ -0,0 +1,14 @@
a50500329680bed4dcc5ec3891fd50f65af9cae7de0b8e8fe925c37f1c6bb16b /after/lib/musl/Scrt1.o
457fff81b3188b82621f3ae49847ebc60128017fcbdba012245169af76cf122a /after/lib/musl/crt1.o
73f64b61e6e9ae83726ab4cc909a7b549b06b6df2b087aedddbcd39cb7146f69 /after/lib/musl/crti.o
f5e325819d86fb381574692b8f9ea24f88f44f185a75adfe461705ecf2619c6e /after/lib/musl/crtn.o
a18d576a501a596ffe67df13eeededeca0d61da42100b9b5687be3d479379641 /after/lib/musl/libc.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libcrypt.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libdl.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libm.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libpthread.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libresolv.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/librt.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libutil.a
f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libxnet.a
b60b59a94f10f039977cea2cea6f15b55b402b25df2e1b2a4e83fa84ccf2fd43 /after/lib/musl/rcrt1.o

View File

@ -0,0 +1 @@
../patches/set_thread_area.patch

View File

@ -0,0 +1 @@
../patches/tcc_static.patch

View File

@ -0,0 +1 @@
../patches/va_list.patch

View File

@ -84,4 +84,11 @@ build autoconf-2.12
build binutils-2.14
# Build musl with fewer patches
build musl-1.1.24 binutils-rebuild.sh checksums/pass3 patches-pass3
populate_device_nodes
# Rebuild tcc-musl using new musl
build tcc-0.9.27 tcc-musl-pass3.sh checksums/tcc-musl-pass3
echo "Bootstrapping completed."

View File

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

View File

@ -37,8 +37,8 @@ src_compile() {
tcc.c
# libtcc1.a
${TCC} -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
${TCC} -ar cr libtcc1.a libtcc1.o
tcc-musl -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
tcc-musl -ar cr libtcc1.a libtcc1.o
}
src_install() {

View File

@ -0,0 +1,47 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_unpack() {
cp -r ../src/tcc-0.9.27 .
}
src_prepare() {
:
}
src_compile() {
export prefix=/after
export libdir=${prefix}/lib/musl
export incdir=${prefix}/include/musl
export bindir=${prefix}/bin
mkdir -p ${libdir}/tcc
tcc-musl \
-v \
-static \
-o tcc-musl \
-D TCC_TARGET_I386=1 \
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
-D CONFIG_TCC_ELFINTERP=\"/musl/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-musl -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
ar cr libtcc1.a libtcc1.o
}
src_install() {
install tcc-musl ${bindir}
install -m 644 libtcc1.a ${libdir}
}