Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Musl fixes #490

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DEVEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ libraries that are compiled and installed.
## Conventions

- **Patches:**
- all patches are `-p0`
- all patches are relative to the directory where the tarball is extracted
- thus, no patch lines for `a/file.c`, but `coreutils-9.4/file.c`
- all patches begin with a patch header
- **parts.rst:**
- all packages are explained in `parts.rst`
Expand Down
34 changes: 22 additions & 12 deletions parts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ 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.

gzip 1.2.4
gzip 1.2.5
==========

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

We also get rid of a few functions from ``musl``, as they rely on pregenerated
files we are unable to generate at this stage.

We do not use any of ``/usr/lib/mes`` or ``/usr/include/mes`` any longer, rather
using ``/usr/lib`` and ``/usr/include`` like normal.

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

grep 2.4
========

GNU ``grep`` is a pattern matching utility. ``grep`` is needed to rebuild some
generated header files in ``musl``.

musl 1.1.24 (v3)
================

We are now able to regenerate those header files that we couldn't regenerate
earlier. We unlock the full range of ``musl`` support, required for a
number of applications (e.g. ``flex``) before the next ``musl`` rebuild.

sed 4.0.9
=========

Expand Down Expand Up @@ -485,12 +501,6 @@ a 3 stage process:

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

grep 2.4
========

GNU ``grep`` is a pattern matching utility. Is is not immediately needed
but will be useful later for autotools.

diffutils 2.7
=============

Expand Down Expand Up @@ -692,10 +702,10 @@ 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)
musl 1.1.24 (v4)
================

We rebuild musl for the third time. This time we can use GNU as to build assembly source files,
We rebuild musl for the fourth time. This time 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)
Expand All @@ -722,7 +732,7 @@ findutils 4.2.33
GNU Find Utilities can be used to search for files. We are mainly interested
in ``find`` and ``xargs`` that are often used in scripts.

musl 1.2.4
musl 1.2.5
==========

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

musl 1.2.4
musl 1.2.5
==========

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

musl 1.2.4
musl 1.2.5
==========

With GCC and binutils supporting a musl-based toolchain natively, musl itself is rebuilt
Expand Down
181 changes: 91 additions & 90 deletions steps/SHA256SUMS.pkgs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions steps/autoconf-2.53/patches/autoconf_252.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ SPDX-License-Identifier: GPL-3.0-or-later

Disable features unsupported by Autoconf 2.52

--- configure.ac Wed Mar 17 19:53:06 2021
+++ configure.ac.new Wed Mar 17 19:52:53 2021
--- autoconf-2.53/configure.ac Wed Mar 17 19:53:06 2021
+++ autoconf-2.53/configure.ac.new Wed Mar 17 19:52:53 2021
@@ -19,8 +19,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
Expand Down
4 changes: 2 additions & 2 deletions steps/automake-1.10.3/patches/aclocal_glob.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

Fixes aclocal-1.10 to work with our Perl

--- aclocal.in 2021-03-25 19:18:10.489134059 +0000
+++ aclocal.in 2021-03-25 19:18:20.159389339 +0000
--- automake-1.10.3/aclocal.in 2021-03-25 19:18:10.489134059 +0000
+++ automake-1.10.3/aclocal.in 2021-03-25 19:18:20.159389339 +0000
@@ -45,6 +45,7 @@
use Automake::FileUtils;
use File::Basename;
Expand Down
4 changes: 2 additions & 2 deletions steps/automake-1.11.2/patches/aclocal_glob.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

Fixes aclocal-1.10 to work with our Perl

--- aclocal.in 2021-03-25 19:18:10.489134059 +0000
+++ aclocal.in 2021-03-25 19:18:20.159389339 +0000
--- automake-1.11.2/aclocal.in 2021-03-25 19:18:10.489134059 +0000
+++ automake-1.11.2/aclocal.in 2021-03-25 19:18:20.159389339 +0000
@@ -44,6 +44,7 @@
use Automake::FileUtils;
use File::Basename;
Expand Down
4 changes: 2 additions & 2 deletions steps/automake-1.15.1/patches/aclocal_glob.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

Fixes aclocal to work with our Perl

--- bin/aclocal.in 2021-03-31 18:19:50.665806225 +0100
+++ bin/aclocal.in 2021-03-31 18:20:02.836132739 +0100
--- automake-1.15.1/bin/aclocal.in 2021-03-31 18:19:50.665806225 +0100
+++ automake-1.15.1/bin/aclocal.in 2021-03-31 18:20:02.836132739 +0100
@@ -42,6 +42,7 @@
use Automake::XFile;
use Automake::FileUtils;
Expand Down
4 changes: 2 additions & 2 deletions steps/automake-1.15.1/patches/bootstrap.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

Fixes dependency of bootstrapping script

--- gen-testsuite-part 2017-06-16 21:46:16.000000000 +0100
+++ gen-testsuite-part 2021-04-01 00:02:46.801098617 +0100
--- automake-1.15.1/gen-testsuite-part 2017-06-16 21:46:16.000000000 +0100
+++ automake-1.15.1/gen-testsuite-part 2021-04-01 00:02:46.801098617 +0100
@@ -64,8 +64,6 @@
$func->($fh);
close $fh
Expand Down
4 changes: 2 additions & 2 deletions steps/automake-1.15.1/patches/shellcheck-bypass.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
Fixes configure script to work with older bash


--- configure.ac.bak 2023-03-08 14:34:57.009268432 +1100
+++ configure.ac 2023-03-08 14:35:27.947964581 +1100
--- automake-1.15.1/configure.ac.bak 2023-03-08 14:34:57.009268432 +1100
+++ automake-1.15.1/configure.ac 2023-03-08 14:35:27.947964581 +1100
@@ -272,14 +272,6 @@
[], [am_score=1; break])

Expand Down
10 changes: 5 additions & 5 deletions steps/bash-2.05b/pass1.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ touch include/pipesize.h
rm y.tab.c y.tab.h

# Patch
patch -Np0 -i ../../patches/mes-libc.patch
patch -Np0 -i ../../patches/tinycc.patch
patch -Np0 -i ../../patches/missing-defines.patch
patch -Np0 -i ../../patches/locale.patch
patch -Np0 -i ../../patches/dev-tty.patch
patch -Np1 -i ../../patches/mes-libc.patch
patch -Np1 -i ../../patches/tinycc.patch
patch -Np1 -i ../../patches/missing-defines.patch
patch -Np1 -i ../../patches/locale.patch
patch -Np1 -i ../../patches/dev-tty.patch

# Compile
make mkbuiltins
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/dev-tty.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ some reason, bash has a fixation on /dev/tty, even though we are not
interactive. Removing this check entirely fixes this issue.

diff --color -ru shell.c
--- shell.c 2002-07-02 01:27:11.000000000 +1000
+++ shell.c 2021-01-16 11:23:36.407287955 +1100
--- bash-2.05b/shell.c 2002-07-02 01:27:11.000000000 +1000
+++ bash-2.05b/shell.c 2021-01-16 11:23:36.407287955 +1100
@@ -342,8 +342,6 @@
# endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/extern.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

tinycc's extern support is bad. i.e. these externs don't propagate through.

--- builtins/common.c 2021-01-15 21:32:56.938683418 +1100
+++ builtins/common.c 2021-01-15 21:34:09.102153806 +1100
--- bash-2.05b/builtins/common.c 2021-01-15 21:32:56.938683418 +1100
+++ bash-2.05b/builtins/common.c 2021-01-15 21:34:09.102153806 +1100
@@ -46,6 +46,9 @@
#include "../flags.h"
#include "../jobs.h"
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/locale.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

mes libc + setting locale = not worky.

--- locale.c 2021-01-15 09:38:55.729307629 +1100
+++ locale.c 2021-01-15 11:19:01.929391346 +1100
--- bash-2.05b/locale.c 2021-01-15 09:38:55.729307629 +1100
+++ bash-2.05b/locale.c 2021-01-15 11:19:01.929391346 +1100
@@ -190,7 +190,7 @@
set_lang (var, value)
char *var, *value;
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/mes-libc.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ mes libc does not have locale support...

diff --git lib/sh/snprintf.c lib/sh/snprintf.c
index 7669576..747aeba 100644
--- lib/sh/snprintf.c
+++ lib/sh/snprintf.c
--- bash-2.05b/lib/sh/snprintf.c
+++ bash-2.05b/lib/sh/snprintf.c
@@ -376,7 +376,7 @@ static void xfree __P((void *));
if ((p)->flags & PF_STAR_P) \
(p)->precision = GETARG (int)
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/missing-defines.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We don't actually want any of these things, which should really be hidden
behind the ifdefs given here to disable them when they are not being
used (as we do).

--- execute_cmd.c 2021-01-15 09:38:55.730307635 +1100
+++ execute_cmd.c 2021-01-15 09:43:41.046896754 +1100
--- bash-2.05b/execute_cmd.c 2021-01-15 09:38:55.730307635 +1100
+++ bash-2.05b/execute_cmd.c 2021-01-15 09:43:41.046896754 +1100
@@ -286,12 +286,18 @@
{
if (currently_executing_command->type == cm_simple)
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/size.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

We don't yet have the size command.

--- Makefile.in 2023-03-11 15:41:13.297307977 +1100
+++ Makefile.in 2023-03-11 15:43:51.677298993 +1100
--- bash-2.05b/Makefile.in 2023-03-11 15:41:13.297307977 +1100
+++ bash-2.05b/Makefile.in 2023-03-11 15:43:51.677298993 +1100
@@ -471,7 +471,6 @@
$(RM) $@
$(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
Expand Down
4 changes: 2 additions & 2 deletions steps/bash-2.05b/patches/tinycc.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ to reflect this.

diff --git lib/sh/oslib.c lib/sh/oslib.c
index 90d7be9..37fdf2a 100644
--- lib/sh/oslib.c
+++ lib/sh/oslib.c
--- bash-2.05b/lib/sh/oslib.c
+++ bash-2.05b/lib/sh/oslib.c
@@ -192,8 +192,7 @@ bzero (s, n)
# include <sys/utsname.h>
int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Add missing AC_CONFIG_MACRO_DIR.

Required by autoreconf to create aclocal.m4 correctly.

--- /libiberty/configure.ac 2022-01-22 14:14:09.000000000 +0200
+++ libiberty/configure.ac 2022-09-04 00:01:02.941738129 +0300
--- binutils-2.30//libiberty/configure.ac 2022-01-22 14:14:09.000000000 +0200
+++ binutils-2.30/libiberty/configure.ac 2022-09-04 00:01:02.941738129 +0300
@@ -2,6 +2,7 @@

AC_INIT
Expand Down
4 changes: 2 additions & 2 deletions steps/binutils-2.30/patches/new-gettext.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-3.0-or-later

In new gettext external is required for AM_GNU_GETTEXT.

--- intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
+++ intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
--- binutils-2.30/intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
+++ binutils-2.30/intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
@@ -4,7 +4,7 @@
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR(../config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-3.0-or-later

Ensure i386-init.h dependencies are satisfied.

--- opcodes/Makefile.am 2022-01-22 14:14:09.000000000 +0200
+++ opcodes/Makefile.am 2022-09-13 21:09:04.353324699 +0300
--- binutils-2.30/opcodes/Makefile.am 2022-01-22 14:14:09.000000000 +0200
+++ binutils-2.30/opcodes/Makefile.am 2022-09-13 21:09:04.353324699 +0300
@@ -575,7 +575,7 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcd
$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
@echo $@
Expand Down
4 changes: 2 additions & 2 deletions steps/binutils-2.41/patches/new-gettext.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-3.0-or-later

In new gettext external is required for AM_GNU_GETTEXT.

--- intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
+++ intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
--- binutils-2.41/intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
+++ binutils-2.41/intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
@@ -4,7 +4,7 @@
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR(../config)
Expand Down
4 changes: 2 additions & 2 deletions steps/binutils-2.41/patches/no-maint-functions-texi.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-3.0-or-later

Ensure functions.texi dependencies are satisfied.

--- libiberty/Makefile.in 2023-12-08 15:18:57.985791235 +1100
+++ libiberty/Makefile.in 2023-12-08 15:19:15.391252344 +1100
--- binutils-2.41/libiberty/Makefile.in 2023-12-08 15:18:57.985791235 +1100
+++ binutils-2.41/libiberty/Makefile.in 2023-12-08 15:19:15.391252344 +1100
@@ -368,12 +368,12 @@
libiberty.html : $(srcdir)/libiberty.texi $(TEXISRC)
$(MAKEINFO) --no-split --html -I$(srcdir) -o $@ $<
Expand Down
4 changes: 2 additions & 2 deletions steps/binutils-2.41/patches/no-maint-opcodes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SPDX-License-Identifier: GPL-3.0-or-later

Ensure i386-tbl.h dependencies are satisfied.

--- opcodes/Makefile.am 2023-12-08 17:13:05.669136957 +1100
+++ opcodes/Makefile.am 2023-12-08 17:13:18.410480026 +1100
--- binutils-2.41/opcodes/Makefile.am 2023-12-08 17:13:05.669136957 +1100
+++ binutils-2.41/opcodes/Makefile.am 2023-12-08 17:13:18.410480026 +1100
@@ -540,7 +540,7 @@
# i386-gen will generate all headers in one go. Use a pattern rule to properly
# express this, with the inner dash ('-') arbitrarily chosen to be the stem.
Expand Down
4 changes: 2 additions & 2 deletions steps/bison-2.3/patches/autover-mismatch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
This macro does not exist in newer versions of autoconf and is unrequired.
There is no version of autoconf supporting this project + gnulib + this macro.

--- m4/po_gl.m4 2021-04-11 18:39:53.353069610 +1000
+++ m4/po_gl.m4 2021-04-11 18:40:20.422242498 +1000
--- bison-2.3/m4/po_gl.m4 2021-04-11 18:39:53.353069610 +1000
+++ bison-2.3/m4/po_gl.m4 2021-04-11 18:40:20.422242498 +1000
@@ -24,7 +24,6 @@
[
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
Expand Down
4 changes: 2 additions & 2 deletions steps/bison-2.3/patches/fopen-safer.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later

fopen-safer.c for whatever reason does not exist when added by gnulib.

--- lib/Makefile.am 2021-04-11 19:01:01.265993928 +1000
+++ lib/Makefile.am 2021-04-11 19:01:40.413232722 +1000
--- bison-2.3/lib/Makefile.am 2021-04-11 19:01:01.265993928 +1000
+++ bison-2.3/lib/Makefile.am 2021-04-11 19:01:40.413232722 +1000
@@ -31,7 +31,8 @@
lib_SOURCES = \
get-errno.h get-errno.c \
Expand Down
4 changes: 2 additions & 2 deletions steps/bison-2.3/patches/gnulib-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
This should be declared for gnulib, but for some reason is not, most likely
use of a different version (but CVS history no longer exists).

--- lib/Makefile.am 2021-04-11 13:49:09.414805465 +1000
+++ lib/Makefile.am 2021-04-11 13:49:26.418916036 +1000
--- bison-2.3/lib/Makefile.am 2021-04-11 13:49:09.414805465 +1000
+++ bison-2.3/lib/Makefile.am 2021-04-11 13:49:26.418916036 +1000
@@ -19,6 +19,7 @@

BUILT_SOURCES =
Expand Down
4 changes: 2 additions & 2 deletions steps/bison-2.3/patches/our-bison.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
This doesn't actually make sense, you can't use the built bison to bootstrap
itself. Make it use our bison instead.

--- src/Makefile.am 2021-04-10 21:37:11.570390316 +1000
+++ src/Makefile.am 2021-04-10 21:38:01.805804332 +1000
--- bison-2.3/src/Makefile.am 2021-04-10 21:37:11.570390316 +1000
+++ bison-2.3/src/Makefile.am 2021-04-10 21:38:01.805804332 +1000
@@ -23,10 +23,6 @@

LDADD = ../lib/libbison.a $(LIBINTL)
Expand Down
4 changes: 2 additions & 2 deletions steps/bison-3.4.1/patches/fseterr.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Date: Thu Mar 26 18:02:01 2020 +0100

diff --git lib/fseterr.c lib/fseterr.c
index 8cd68e8..0ec7e2c 100644
--- lib/fseterr.c
+++ lib/fseterr.c
--- bison-3.4.1/lib/fseterr.c
+++ bison-3.4.1/lib/fseterr.c
@@ -53,7 +53,7 @@ fseterr (FILE *fp)
#elif defined EPLAN9 /* Plan9 */
if (fp->state != 0 /* CLOSED */)
Expand Down
Loading
Loading