Make patches relative to where tarballs are extracted

Ever since an old patch version, it has (for reasonable security
reasons) not supported patched with ../ in the filename.
Many of our patches have been relying on this behaviour being OK,
because we start off with an ancient patch version that didn't perform
such checks. As soon as we need this behaviour after we build a newer
patch though, we will have problems.

So, let's change the policy.
Patches are relative to where tarballs are extracted, rather than the
"working directory" - e.g. have patches for `coreutils-9.4/src/cp.c`
instead of `src/cp.c`.
Keeping this consistent has a few implications;
- patches are applied from the build/ directory in bash era now, with
  `-p0`
- when patches are manually applied in the bash era, use `-p` as
  required, usually `-p1`
- in kaem era where patches are always manually applied, `-p1` is used
This commit is contained in:
fosslinux 2024-12-21 16:50:23 +11:00
parent 749b2bfe37
commit a67db8fcbd
156 changed files with 1265 additions and 1263 deletions

View file

@ -1,8 +1,8 @@
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
# SPDX-License-Identifier: MIT
diff -r -u musl-1.1.24.orig/arch/i386/pthread_arch.h musl-1.1.24/arch/i386/pthread_arch.h
--- arch/i386/pthread_arch.h 2019-10-13 21:58:27.000000000 +0000
+++ arch/i386/pthread_arch.h 2023-04-07 11:56:04.649119523 +0000
--- musl-1.1.24/arch/i386/pthread_arch.h 2019-10-13 21:58:27.000000000 +0000
+++ musl-1.1.24/arch/i386/pthread_arch.h 2023-04-07 11:56:04.649119523 +0000
@@ -1,8 +1,8 @@
+extern pthread_t g_pthread;
+
@ -16,8 +16,8 @@ diff -r -u musl-1.1.24.orig/arch/i386/pthread_arch.h musl-1.1.24/arch/i386/pthre
#define TP_ADJ(p) (p)
diff -r -u musl-1.1.24.orig/src/env/__init_tls.c musl-1.1.24/src/env/__init_tls.c
--- src/env/__init_tls.c 2019-10-13 21:58:27.000000000 +0000
+++ src/env/__init_tls.c 2023-04-07 11:56:43.565120289 +0000
--- musl-1.1.24/src/env/__init_tls.c 2019-10-13 21:58:27.000000000 +0000
+++ musl-1.1.24/src/env/__init_tls.c 2023-04-07 11:56:43.565120289 +0000
@@ -10,20 +10,19 @@
#include "syscall.h"

View file

@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
# SPDX-License-Identifier: MIT
--- src/process/posix_spawn.c 2019-10-13 21:58:27.000000000 +0000
+++ src/process/posix_spawn.c 2023-04-07 11:50:47.253113271 +0000
--- musl-1.1.24/src/process/posix_spawn.c 2019-10-13 21:58:27.000000000 +0000
+++ musl-1.1.24/src/process/posix_spawn.c 2023-04-07 11:50:47.253113271 +0000
@@ -182,8 +182,11 @@
args.envp = envp;
pthread_sigmask(SIG_BLOCK, SIGALL_SET, &args.oldmask);

View file

@ -7,8 +7,8 @@ tcc does not seem to support stmxcsr and ldmxcsr.
Remove those. This might break float exception handling but we
are unlikely to need it.
diff -U3 -r src/fenv/i386/fenv.s src/fenv/i386/fenv.s
--- src/fenv/i386/fenv.s 2019-10-13 22:58:27.000000000 +0100
+++ src/fenv/i386/fenv.s 2021-02-01 00:27:04.924135707 +0000
--- musl-1.1.24/src/fenv/i386/fenv.s 2019-10-13 22:58:27.000000000 +0100
+++ musl-1.1.24/src/fenv/i386/fenv.s 2021-02-01 00:27:04.924135707 +0000
@@ -17,7 +17,6 @@
jz 1f
fnclex

View file

@ -1,8 +1,8 @@
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
# SPDX-License-Identifier: MIT
diff -r -u musl-1.1.24.orig/src/malloc/malloc.c musl-1.1.24/src/malloc/malloc.c
--- src/malloc/malloc.c 2019-10-13 21:58:27.000000000 +0000
+++ src/malloc/malloc.c 2023-12-22 23:18:21.088570834 +0000
--- musl-1.1.24/src/malloc/malloc.c 2019-10-13 21:58:27.000000000 +0000
+++ musl-1.1.24/src/malloc/malloc.c 2023-12-22 23:18:21.088570834 +0000
@@ -496,7 +496,9 @@
uintptr_t a = (uintptr_t)self + SIZE_ALIGN+PAGE_SIZE-1 & -PAGE_SIZE;
uintptr_t b = (uintptr_t)next - SIZE_ALIGN & -PAGE_SIZE;

View file

@ -4,8 +4,8 @@ SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: MIT
tcc -ar does not support creating empty archives
--- Makefile 2019-10-13 22:58:27.000000000 +0100
+++ Makefile 2021-02-01 00:21:14.974687663 +0000
--- musl-1.1.24/Makefile 2019-10-13 22:58:27.000000000 +0100
+++ musl-1.1.24/Makefile 2021-02-01 00:21:14.974687663 +0000
@@ -167,7 +167,7 @@
$(EMPTY_LIBS):

View file

@ -20,8 +20,8 @@ SYS_set_thread_area's return value being an error) before modifying
diff --git src/thread/i386/__set_thread_area.s src/thread/i386/__set_thread_area.s
index c2c21dd5..aa6852be 100644
--- src/thread/i386/__set_thread_area.s
+++ src/thread/i386/__set_thread_area.s
--- musl-1.1.24/src/thread/i386/__set_thread_area.s
+++ musl-1.1.24/src/thread/i386/__set_thread_area.s
@@ -28,6 +28,7 @@ __set_thread_area:
ret
2:

View file

@ -4,8 +4,8 @@ SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: MIT
tcc does not like jecxz instruction.
--- src/signal/i386/sigsetjmp.s 2019-10-13 22:58:27.000000000 +0100
+++ src/signal/i386/sigsetjmp.s 2021-02-01 00:19:25.671735415 +0000
--- musl-1.1.24/src/signal/i386/sigsetjmp.s 2019-10-13 22:58:27.000000000 +0100
+++ musl-1.1.24/src/signal/i386/sigsetjmp.s 2021-02-01 00:19:25.671735415 +0000
@@ -5,7 +5,8 @@
sigsetjmp:
__sigsetjmp:

View file

@ -13,8 +13,8 @@ Subject: [PATCH] stdarg.h: add support for tcc.
diff --git a/arch/i386/bits/alltypes.h.in b/arch/i386/bits/alltypes.h.in
index 1a8432d3..44cb5987 100644
--- arch/i386/bits/alltypes.h.in
+++ arch/i386/bits/alltypes.h.in
--- musl-1.1.24/arch/i386/bits/alltypes.h.in
+++ musl-1.1.24/arch/i386/bits/alltypes.h.in
@@ -2,7 +2,19 @@
#define _Int64 long long
#define _Reg int