Skip to content

Commit d652494

Browse files
authored
Merge pull request #490 from fosslinux/musl-fixup
Musl fixes
2 parents c5175b4 + 19b205a commit d652494

24 files changed

+223
-128
lines changed

parts.rst

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ patch 2.5.9
286286
``patch`` is a very useful tool at this stage, allowing us to make
287287
significantly more complex edits, including just changes to lines.
288288

289-
gzip 1.2.4
289+
gzip 1.2.5
290290
==========
291291

292292
``gzip`` is the most common compression format used for software source
@@ -399,6 +399,9 @@ from building many newer or more complex programs.
399399
``tcc`` has slight problems when building and linking ``musl``, so we
400400
apply a few patches.
401401

402+
We also get rid of a few functions from ``musl``, as they rely on pregenerated
403+
files we are unable to generate at this stage.
404+
402405
We do not use any of ``/usr/lib/mes`` or ``/usr/include/mes`` any longer, rather
403406
using ``/usr/lib`` and ``/usr/include`` like normal.
404407

@@ -422,6 +425,19 @@ tcc 0.9.27 (musl v2)
422425
Now that we have a ‘fixed’ ``musl``, we now recompile ``tcc`` as ``tcc``
423426
uses floats extensively.
424427

428+
grep 2.4
429+
========
430+
431+
GNU ``grep`` is a pattern matching utility. ``grep`` is needed to rebuild some
432+
generated header files in ``musl``.
433+
434+
musl 1.1.24 (v3)
435+
================
436+
437+
We are now able to regenerate those header files that we couldn't regenerate
438+
earlier. We unlock the full range of ``musl`` support, required for a
439+
number of applications (e.g. ``flex``) before the next ``musl`` rebuild.
440+
425441
sed 4.0.9
426442
=========
427443

@@ -485,12 +501,6 @@ a 3 stage process:
485501

486502
Finally we have a fully functional ``bison`` executable.
487503

488-
grep 2.4
489-
========
490-
491-
GNU ``grep`` is a pattern matching utility. Is is not immediately needed
492-
but will be useful later for autotools.
493-
494504
diffutils 2.7
495505
=============
496506

@@ -692,10 +702,10 @@ In particular we can now use full featured ``ar`` instead of ``tcc -ar``,
692702
the GNU linker ``ld``, which allows us building shared libraries,
693703
and the GNU assembler ``as``.
694704

695-
musl 1.1.24 (v3)
705+
musl 1.1.24 (v4)
696706
================
697707

698-
We rebuild musl for the third time. This time we can use GNU as to build assembly source files,
708+
We rebuild musl for the fourth time. This time we can use GNU as to build assembly source files,
699709
so those assembly files that tcc failed to compile no longer have to be patched.
700710

701711
tcc 0.9.27 (musl v3)
@@ -722,7 +732,7 @@ findutils 4.2.33
722732
GNU Find Utilities can be used to search for files. We are mainly interested
723733
in ``find`` and ``xargs`` that are often used in scripts.
724734

725-
musl 1.2.4
735+
musl 1.2.5
726736
==========
727737

728738
GCC can build the latest as of the time of writing musl version.
@@ -879,7 +889,7 @@ swap
879889
If enabled in ``bootstrap.cfg``, creates and activates a swap file under the
880890
name ``/swapfile``.
881891

882-
musl 1.2.4
892+
musl 1.2.5
883893
==========
884894

885895
At this point, it is guaranteed that we are running on Linux with thread support,
@@ -1173,7 +1183,7 @@ We use the `gnu-autogen-bootstrapping <https://github.com/schierlm/gnu-autogen-b
11731183
project to rebuild those and create (slightly crippled) ``autogen`` that
11741184
is then able to build a full-featured version.
11751185

1176-
musl 1.2.4
1186+
musl 1.2.5
11771187
==========
11781188

11791189
With GCC and binutils supporting a musl-based toolchain natively, musl itself is rebuilt

steps/SHA256SUMS.pkgs

Lines changed: 90 additions & 89 deletions
Large diffs are not rendered by default.

steps/manifest

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ build: musl-1.1.24
6464
build: tcc-0.9.27
6565
build: musl-1.1.24
6666
build: tcc-0.9.27
67+
build: grep-2.4
68+
build: musl-1.1.24
6769
build: sed-4.0.9
6870
build: bzip2-1.0.8
6971
build: m4-1.4.7
@@ -74,7 +76,6 @@ uninstall: heirloom-devtools-070527
7476
build: bison-3.4.1
7577
build: bison-3.4.1
7678
build: bison-3.4.1
77-
build: grep-2.4
7879
build: diffutils-2.7
7980
build: coreutils-5.0
8081
build: coreutils-6.10
@@ -111,7 +112,7 @@ build: tcc-0.9.27
111112
improve: populate_device_nodes
112113
build: gcc-4.0.4
113114
build: findutils-4.2.33
114-
build: musl-1.2.4
115+
build: musl-1.2.5
115116
build: linux-headers-4.14.341-openela
116117
build: gcc-4.0.4
117118
build: util-linux-2.19.1
@@ -135,7 +136,7 @@ improve: finalize_job_count
135136
improve: finalize_fhs
136137
improve: open_console ( CONSOLES == True )
137138
improve: swap ( SWAP_SIZE != 0 )
138-
build: musl-1.2.4
139+
build: musl-1.2.5
139140
build: curl-8.5.0
140141
improve: get_network ( CHROOT == False )
141142
build: bash-5.2.15
@@ -180,7 +181,7 @@ build: which-2.21
180181
build: grep-3.7
181182
build: sed-4.8
182183
build: autogen-5.18.16
183-
build: musl-1.2.4
184+
build: musl-1.2.5
184185
build: python-2.0.1
185186
build: python-2.0.1
186187
build: python-2.3.7
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
SPDX-FileCopyrightText: 2024 fosslinux <[email protected]>
2+
3+
SPDX-License-Identifier: MIT
4+
5+
diff --color -ru include/wchar.h include/wchar.h
6+
--- musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wchar.h 2024-12-21 11:29:46.207537390 +1100
7+
+++ musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wchar.h 2024-12-21 12:03:00.494377416 +1100
8+
@@ -175,10 +175,7 @@
9+
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10+
int wcwidth (wchar_t);
11+
int wcswidth (const wchar_t *, size_t);
12+
-int iswalnum(wint_t);
13+
-int iswalpha(wint_t);
14+
int iswblank(wint_t);
15+
-int iswcntrl(wint_t);
16+
int iswdigit(wint_t);
17+
int iswgraph(wint_t);
18+
int iswlower(wint_t);
19+
@@ -187,9 +184,6 @@
20+
int iswspace(wint_t);
21+
int iswupper(wint_t);
22+
int iswxdigit(wint_t);
23+
-int iswctype(wint_t, wctype_t);
24+
-wint_t towlower(wint_t);
25+
-wint_t towupper(wint_t);
26+
wctype_t wctype(const char *);
27+
28+
#ifndef __cplusplus
29+
diff --color -ru include/wctype.h include/wctype.h
30+
--- musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wctype.h 2024-12-21 11:29:46.207537390 +1100
31+
+++ musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wctype.h 2024-12-21 12:07:48.030354351 +1100
32+
@@ -24,10 +24,7 @@
33+
34+
#undef iswdigit
35+
36+
-int iswalnum(wint_t);
37+
-int iswalpha(wint_t);
38+
int iswblank(wint_t);
39+
-int iswcntrl(wint_t);
40+
int iswdigit(wint_t);
41+
int iswgraph(wint_t);
42+
int iswlower(wint_t);
43+
@@ -36,10 +33,6 @@
44+
int iswspace(wint_t);
45+
int iswupper(wint_t);
46+
int iswxdigit(wint_t);
47+
-int iswctype(wint_t, wctype_t);
48+
-wint_t towctrans(wint_t, wctrans_t);
49+
-wint_t towlower(wint_t);
50+
-wint_t towupper(wint_t);
51+
wctrans_t wctrans(const char *);
52+
wctype_t wctype(const char *);
53+

steps/musl-1.1.24/pass1.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
src_prepare() {
66
default
77

8+
# meslibc is insufficient to regenerate src/ctype or src/iconv
9+
# disable everything using a generated header
10+
patch -Np1 -i ../../files/disable_ctype_headers.patch
11+
rm src/ctype/iswalpha.c src/ctype/iswalnum.c src/ctype/iswctype.c \
12+
src/ctype/towctrans.c
13+
rm include/iconv.h src/locale/iconv.c src/locale/iconv_close.c
14+
815
# tcc does not support complex types
916
rm -rf src/complex
1017

steps/musl-1.1.24/pass3.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ src_prepare() {
77

88
# tcc does not support complex types
99
rm -rf src/complex
10+
11+
# Configure fails without this
12+
mkdir -p /dev
1013
}
1114

1215
src_configure() {
@@ -15,7 +18,7 @@ src_configure() {
1518
--disable-shared \
1619
--prefix="${PREFIX}" \
1720
--libdir="${LIBDIR}" \
18-
--includedir="${PREFIX}/include"
21+
--includedir="${PREFIX}/include/"
1922

2023
# configure script creates this file
2124
if test -f /dev/null; then
@@ -24,9 +27,5 @@ src_configure() {
2427
}
2528

2629
src_compile() {
27-
make "${MAKEJOBS}" PREFIX="${PREFIX}" CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<'
28-
}
29-
30-
src_install() {
31-
make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install
30+
make "${MAKEJOBS}" CROSS_COMPILE= AR="tcc -ar" RANLIB=true CFLAGS="-DSYSCALL_NO_TLS"
3231
}

steps/musl-1.1.24/pass4.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <[email protected]>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
src_prepare() {
6+
default
7+
8+
# tcc does not support complex types
9+
rm -rf src/complex
10+
}
11+
12+
src_configure() {
13+
CC=tcc ./configure \
14+
--host=i386 \
15+
--disable-shared \
16+
--prefix="${PREFIX}" \
17+
--libdir="${LIBDIR}" \
18+
--includedir="${PREFIX}/include"
19+
20+
# configure script creates this file
21+
if test -f /dev/null; then
22+
rm /dev/null
23+
fi
24+
}
25+
26+
src_compile() {
27+
make "${MAKEJOBS}" PREFIX="${PREFIX}" CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<'
28+
}
29+
30+
src_install() {
31+
make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install
32+
}

0 commit comments

Comments
 (0)