live-bootstrap/steps/gcc-4.7.4/patches/0003-unwind-fix-for-musl.patch
fosslinux a67db8fcbd 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
2024-12-23 15:20:42 +11:00

35 lines
1.1 KiB
Diff

SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-FileCopyrightText: 2015 Gregor Richards <gregor.richards@uwaterloo.ca>
SPDX-FileCopyrightText: 2015 Szabolcs Nagy <szabolcs.nagy@arm.com>
SPDX-License-Identifier: GPL-2.0-or-later
Backported from upstream commit 15aa7b447218e45da835472bbf4740ae00db9982
unwind fix for musl
2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
* unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on
Linux if target provides dl_iterate_phdr.
Co-Authored-By: Szabolcs Nagy <szabolcs.nagy@arm.com>
From-SVN: r222328
--- gcc-4.7.4/libgcc/unwind-dw2-fde-dip.c
+++ gcc-4.7.4/libgcc/unwind-dw2-fde-dip.c
@@ -53,6 +53,12 @@
# define USE_PT_GNU_EH_FRAME
#endif
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+ && defined(TARGET_DL_ITERATE_PHDR) \
+ && defined(__linux__)
+# define USE_PT_GNU_EH_FRAME
+#endif
+
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
&& defined(__FreeBSD__) && __FreeBSD__ >= 7
# define ElfW __ElfN