merge bitcoin#28328: update time-machine

This commit is contained in:
Kittywhiskers Van Gogh 2024-11-05 14:23:25 +00:00
parent ef9c4bdc60
commit 0ac25311d5
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
6 changed files with 263 additions and 118 deletions

View File

@ -54,7 +54,8 @@ BASEPREFIX="${PWD}/depends"
store_path() { store_path() {
grep --extended-regexp "/[^-]{32}-${1}-[^-]+${2:+-${2}}" "${GUIX_ENVIRONMENT}/manifest" \ grep --extended-regexp "/[^-]{32}-${1}-[^-]+${2:+-${2}}" "${GUIX_ENVIRONMENT}/manifest" \
| head --lines=1 \ | head --lines=1 \
| sed --expression='s|^[[:space:]]*"||' \ | sed --expression='s|\x29*$||' \
--expression='s|^[[:space:]]*"||' \
--expression='s|"[[:space:]]*$||' --expression='s|"[[:space:]]*$||'
} }

View File

@ -51,7 +51,7 @@ fi
time-machine() { time-machine() {
# shellcheck disable=SC2086 # shellcheck disable=SC2086
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \ guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
--commit=998eda3067c7d21e0d9bb3310d2f5a14b8f1c681 \ --commit=160f78a4d92205df986ed9efcce7d3aac188cb24 \
--cores="$JOBS" \ --cores="$JOBS" \
--keep-failed \ --keep-failed \
--fallback \ --fallback \

View File

@ -58,16 +58,16 @@ FILE-NAME found in ./patches relative to the current file."
;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived ;; 2. Build cross-compiled kernel headers with XGCC-SANS-LIBC, derived
;; from BASE-KERNEL-HEADERS ;; from BASE-KERNEL-HEADERS
(xkernel (cross-kernel-headers target (xkernel (cross-kernel-headers target
base-kernel-headers #:linux-headers base-kernel-headers
xgcc-sans-libc #:xgcc xgcc-sans-libc
xbinutils)) #:xbinutils xbinutils))
;; 3. Build a cross-compiled libc with XGCC-SANS-LIBC and XKERNEL, ;; 3. Build a cross-compiled libc with XGCC-SANS-LIBC and XKERNEL,
;; derived from BASE-LIBC ;; derived from BASE-LIBC
(xlibc (cross-libc target (xlibc (cross-libc target
base-libc #:libc base-libc
xgcc-sans-libc #:xgcc xgcc-sans-libc
xbinutils #:xbinutils xbinutils
xkernel)) #:xheaders xkernel))
;; 4. Build a cross-compiling gcc targeting XLIBC, derived from ;; 4. Build a cross-compiling gcc targeting XLIBC, derived from
;; BASE-GCC ;; BASE-GCC
(xgcc (cross-gcc target (xgcc (cross-gcc target
@ -114,8 +114,7 @@ desirable for building Dash Core release binaries."
(define (gcc-mingw-patches gcc) (define (gcc-mingw-patches gcc)
(package-with-extra-patches gcc (package-with-extra-patches gcc
(search-our-patches "gcc-remap-guix-store.patch" (search-our-patches "gcc-remap-guix-store.patch"
"vmov-alignment.patch" "vmov-alignment.patch")))
"gcc-broken-longjmp.patch")))
(define (make-mingw-pthreads-cross-toolchain target) (define (make-mingw-pthreads-cross-toolchain target)
"Create a cross-compilation toolchain package for TARGET" "Create a cross-compilation toolchain package for TARGET"
@ -146,8 +145,7 @@ chain for " target " development."))
(define (make-nsis-for-gcc-10 base-nsis) (define (make-nsis-for-gcc-10 base-nsis)
(package-with-extra-patches base-nsis (package-with-extra-patches base-nsis
(search-our-patches "nsis-gcc-10-memmove.patch" (search-our-patches "nsis-gcc-10-memmove.patch")))
"nsis-disable-installer-reloc.patch")))
;; While LIEF is packaged in Guix, we maintain our own package, ;; While LIEF is packaged in Guix, we maintain our own package,
;; to simplify building, and more easily apply updates. ;; to simplify building, and more easily apply updates.
@ -247,7 +245,7 @@ thus should be able to compile on most platforms where these exist.")
(define-public python-oscrypto (define-public python-oscrypto
(package (package
(name "python-oscrypto") (name "python-oscrypto")
(version "1.2.1") (version "1.3.0")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -257,7 +255,7 @@ thus should be able to compile on most platforms where these exist.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"1d4d8s4z340qhvb3g5m5v3436y3a71yc26wk4749q64m09kxqc3l")) "1v5wkmzcyiqy39db8j2dvkdrv2nlsc48556h73x4dzjwd6kg4q0a"))
(patches (search-our-patches "oscrypto-hard-code-openssl.patch")))) (patches (search-our-patches "oscrypto-hard-code-openssl.patch"))))
(build-system python-build-system) (build-system python-build-system)
(native-search-paths (native-search-paths
@ -542,7 +540,8 @@ inspecting signatures in Mach-O binaries.")
"0wm0if2n4z48kpn85va6yb4iac34crds2f55ddpz1hykx6jp1pb6")) "0wm0if2n4z48kpn85va6yb4iac34crds2f55ddpz1hykx6jp1pb6"))
(patches (search-our-patches "glibc-2.27-fcommon.patch" (patches (search-our-patches "glibc-2.27-fcommon.patch"
"glibc-2.27-guix-prefix.patch" "glibc-2.27-guix-prefix.patch"
"glibc-2.27-no-librt.patch")))) "glibc-2.27-no-librt.patch"
"glibc-2.27-powerpc-ldbrx.patch"))))
(arguments (arguments
(substitute-keyword-arguments (package-arguments glibc) (substitute-keyword-arguments (package-arguments glibc)
((#:configure-flags flags) ((#:configure-flags flags)
@ -590,7 +589,7 @@ inspecting signatures in Mach-O binaries.")
;; Build tools ;; Build tools
cmake-minimal cmake-minimal
gnu-make gnu-make
libtool-2.4.7 libtool
autoconf-2.71 autoconf-2.71
automake automake
pkg-config pkg-config
@ -599,7 +598,7 @@ inspecting signatures in Mach-O binaries.")
gcc-toolchain-10 gcc-toolchain-10
(list gcc-toolchain-10 "static") (list gcc-toolchain-10 "static")
;; Scripting ;; Scripting
python-minimal ;; (3.9) python-minimal ;; (3.10)
;; Git ;; Git
git-minimal git-minimal
;; Tests ;; Tests

View File

@ -1,70 +0,0 @@
commit eb5698897c52702498938592d7f76e67d126451f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Wed May 5 22:48:51 2021 +0200
Fix PR target/100402
This is a regression for 64-bit Windows present from mainline down to the 9
branch and introduced by the fix for PR target/99234. Again SEH, but with
a twist related to the way MinGW implements setjmp/longjmp, which turns out
to be piggybacked on SEH with recent versions of MinGW, i.e. the longjmp
performs a bona-fide unwinding of the stack, because it calls RtlUnwindEx
with the second argument initially passed to setjmp, which is the result of
__builtin_frame_address (0) in the MinGW header file:
define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
This means that we directly expose the frame pointer to the SEH machinery
here (unlike with regular exception handling where we use an intermediate
CFA) and thus that we cannot do whatever we want with it. The old code
would leave it unaligned, i.e. not multiple of 16, whereas the new code
aligns it, but this breaks for some reason; at least it appears that a
.seh_setframe directive with 0 as second argument always works, so the
fix aligns it this way.
gcc/
PR target/100402
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
always return the establisher frame for __builtin_frame_address (0).
gcc/testsuite/
* gcc.c-torture/execute/20210505-1.c: New test.
This patch can be dropped when we are building with GCC 10.4.0 or later.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2f838840e96..06ad1b2274e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6356,12 +6356,29 @@ ix86_compute_frame_layout (void)
area, see the SEH code in config/i386/winnt.c for the rationale. */
frame->hard_frame_pointer_offset = frame->sse_reg_save_offset;
- /* If we can leave the frame pointer where it is, do so. Also, return
+ /* If we can leave the frame pointer where it is, do so; however return
the establisher frame for __builtin_frame_address (0) or else if the
- frame overflows the SEH maximum frame size. */
+ frame overflows the SEH maximum frame size.
+
+ Note that the value returned by __builtin_frame_address (0) is quite
+ constrained, because setjmp is piggybacked on the SEH machinery with
+ recent versions of MinGW:
+
+ # elif defined(__SEH__)
+ # if defined(__aarch64__) || defined(_ARM64_)
+ # define setjmp(BUF) _setjmp((BUF), __builtin_sponentry())
+ # elif (__MINGW_GCC_VERSION < 40702)
+ # define setjmp(BUF) _setjmp((BUF), mingw_getsp())
+ # else
+ # define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
+ # endif
+
+ and the second argument passed to _setjmp, if not null, is forwarded
+ to the TargetFrame parameter of RtlUnwindEx by longjmp (after it has
+ built an ExceptionRecord on the fly describing the setjmp buffer). */
const HOST_WIDE_INT diff
= frame->stack_pointer_offset - frame->hard_frame_pointer_offset;
- if (diff <= 255)
+ if (diff <= 255 && !crtl->accesses_prior_frames)
{
/* The resulting diff will be a multiple of 16 lower than 255,
i.e. at most 240 as required by the unwind data structure. */

View File

@ -0,0 +1,245 @@
From 50b0b3c9ff71ffd7ebbd74ae46844c3566478123 Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabrielftg@linux.ibm.com>
Date: Mon, 27 May 2019 15:21:22 -0300
Subject: [PATCH] powerpc: Fix build failures with current GCC
Since GCC commit 271500 (svn), also known as the following commit on the
git mirror:
commit e154242724b084380e3221df7c08fcdbd8460674
Author: amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed May 22 04:34:26 2019 +0000
[RS6000] Don't pass -many to the assembler
glibc builds are failing when an assembly implementation does not
declare the correct '.machine' directive, or when no such directive is
declared at all. For example, when a POWER6 instruction is used, but
'.machine power6' is not declared, the assembler will fail with an error
similar to the following:
../sysdeps/powerpc/powerpc64/power8/strcmp.S: Assembler messages:
24 ../sysdeps/powerpc/powerpc64/power8/strcmp.S:55: Error: unrecognized opcode: `cmpb'
This patch adds '.machine powerN' directives where none existed, as well
as it updates '.machine power7' directives on POWER8 files, because the
minimum binutils version required to build glibc (binutils 2.25) now
provides this machine version. It also adds '-many' to the assembler
command used to build tst-set_ppr.c.
Tested for powerpc, powerpc64, and powerpc64le, as well as with
build-many-glibcs.py for powerpc targets.
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
sysdeps/powerpc/Makefile | 5 +++
sysdeps/powerpc/powerpc64/power4/memcmp.S | 7 ++++
sysdeps/powerpc/powerpc64/power7/strncmp.S | 1 +
.../powerpc/powerpc64/power8/fpu/s_llround.S | 1 +
sysdeps/powerpc/powerpc64/power8/strcasecmp.S | 36 ++++++-------------
sysdeps/powerpc/powerpc64/power8/strcasestr.S | 14 ++------
sysdeps/powerpc/powerpc64/power8/strcmp.S | 1 +
7 files changed, 28 insertions(+), 37 deletions(-)
diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile
index 6aa683b03f..23126147df 100644
--- a/sysdeps/powerpc/Makefile
+++ b/sysdeps/powerpc/Makefile
@@ -45,6 +45,11 @@ ifeq ($(subdir),misc)
sysdep_headers += sys/platform/ppc.h
tests += test-gettimebase
tests += tst-set_ppr
+
+# This test is expected to run and exit with EXIT_UNSUPPORTED on
+# processors that do not implement the Power ISA 2.06 or greater.
+# But the test makes use of instructions from Power ISA 2.06 and 2.07.
+CFLAGS-tst-set_ppr.c += -Wa,-many
endif
ifneq (,$(filter %le,$(config-machine)))
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index e5319f101f..38dcf4c9a1 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -26,7 +26,14 @@
# define MEMCMP memcmp
#endif
+#ifndef __LITTLE_ENDIAN__
.machine power4
+#else
+/* Little endian is only available since POWER8, so it's safe to
+ specify .machine as power8 (or older), even though this is a POWER4
+ file. Since the little-endian code uses 'ldbrx', power7 is enough. */
+ .machine power7
+#endif
ENTRY_TOCLESS (MEMCMP, 4)
CALL_MCOUNT 3
diff --git a/sysdeps/powerpc/powerpc64/power7/strncmp.S b/sysdeps/powerpc/powerpc64/power7/strncmp.S
index 0c7429d19f..10f898c5a3 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/strncmp.S
@@ -28,6 +28,7 @@
const char *s2 [r4],
size_t size [r5]) */
+ .machine power7
ENTRY_TOCLESS (STRNCMP, 5)
CALL_MCOUNT 3
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
index a22fc63bb3..84c76ba0f9 100644
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
@@ -26,6 +26,7 @@
/* long long [r3] llround (float x [fp1]) */
+ .machine power8
ENTRY_TOCLESS (__llround)
CALL_MCOUNT 0
frin fp1,fp1 /* Round to nearest +-0.5. */
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
index 3a2efe2a64..eeacd40c7f 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
@@ -91,21 +91,7 @@
3: \
TOLOWER()
-#ifdef _ARCH_PWR8
-# define VCLZD_V8_v7 vclzd v8, v7;
-# define MFVRD_R3_V1 mfvrd r3, v1;
-# define VSUBUDM_V9_V8 vsubudm v9, v9, v8;
-# define VPOPCNTD_V8_V8 vpopcntd v8, v8;
-# define VADDUQM_V7_V8 vadduqm v9, v7, v8;
-#else
-# define VCLZD_V8_v7 .long 0x11003fc2
-# define MFVRD_R3_V1 .long 0x7c230067
-# define VSUBUDM_V9_V8 .long 0x112944c0
-# define VPOPCNTD_V8_V8 .long 0x110047c3
-# define VADDUQM_V7_V8 .long 0x11274100
-#endif
-
- .machine power7
+ .machine power8
ENTRY (__STRCASECMP)
#ifdef USE_AS_STRNCASECMP
@@ -265,15 +251,15 @@ L(different):
#ifdef __LITTLE_ENDIAN__
/* Count trailing zero. */
vspltisb v8, -1
- VADDUQM_V7_V8
+ vadduqm v9, v7, v8
vandc v8, v9, v7
- VPOPCNTD_V8_V8
+ vpopcntd v8, v8
vspltb v6, v8, 15
vcmpequb. v6, v6, v1
blt cr6, L(shift8)
#else
/* Count leading zero. */
- VCLZD_V8_v7
+ vclzd v8, v7
vspltb v6, v8, 7
vcmpequb. v6, v6, v1
blt cr6, L(shift8)
@@ -291,7 +277,7 @@ L(skipsum):
/* Merge and move to GPR. */
vmrglb v6, v6, v7
vslo v1, v6, v1
- MFVRD_R3_V1
+ mfvrd r3, v1
/* Place the characters that are different in first position. */
sldi rSTR2, rRTN, 56
srdi rSTR2, rSTR2, 56
@@ -301,7 +287,7 @@ L(skipsum):
vslo v6, v5, v8
vslo v7, v4, v8
vmrghb v1, v6, v7
- MFVRD_R3_V1
+ mfvrd r3, v1
srdi rSTR2, rRTN, 48
sldi rSTR2, rSTR2, 56
srdi rSTR2, rSTR2, 56
@@ -320,15 +306,15 @@ L(null_found):
#ifdef __LITTLE_ENDIAN__
/* Count trailing zero. */
vspltisb v8, -1
- VADDUQM_V7_V8
+ vadduqm v9, v7, v8
vandc v8, v9, v7
- VPOPCNTD_V8_V8
+ vpopcntd v8, v8
vspltb v6, v8, 15
vcmpequb. v6, v6, v10
blt cr6, L(shift_8)
#else
/* Count leading zero. */
- VCLZD_V8_v7
+ vclzd v8, v7
vspltb v6, v8, 7
vcmpequb. v6, v6, v10
blt cr6, L(shift_8)
@@ -343,10 +329,10 @@ L(skipsum1):
vspltisb v10, 7
vslb v10, v10, v10
vsldoi v9, v0, v10, 1
- VSUBUDM_V9_V8
+ vsubudm v9, v9, v8
vspltisb v8, 8
vsldoi v8, v0, v8, 1
- VSUBUDM_V9_V8
+ vsubudm v9, v9, v8
/* Shift and remove junk after null character. */
#ifdef __LITTLE_ENDIAN__
vslo v5, v5, v9
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr.S b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
index 9fc24c29f9..e10f06fd86 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcasestr.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
@@ -73,18 +73,8 @@
vor reg, v8, reg; \
vcmpequb. v6, reg, v4;
-/* TODO: change these to the actual instructions when the minimum required
- binutils allows it. */
-#ifdef _ARCH_PWR8
-#define VCLZD_V8_v7 vclzd v8, v7;
-#else
-#define VCLZD_V8_v7 .long 0x11003fc2
-#endif
-
#define FRAMESIZE (FRAME_MIN_SIZE+48)
-/* TODO: change this to .machine power8 when the minimum required binutils
- allows it. */
- .machine power7
+ .machine power8
ENTRY (STRCASESTR, 4)
CALL_MCOUNT 2
mflr r0 /* Load link register LR to r0. */
@@ -291,7 +281,7 @@ L(nullchk1):
vcmpequb. v6, v0, v7
/* Shift r3 by 16 bytes and proceed. */
blt cr6, L(shift16)
- VCLZD_V8_v7
+ vclzd v8, v7
#ifdef __LITTLE_ENDIAN__
vspltb v6, v8, 15
#else
diff --git a/sysdeps/powerpc/powerpc64/power8/strcmp.S b/sysdeps/powerpc/powerpc64/power8/strcmp.S
index 15e7351d1b..d592266d1d 100644
--- a/sysdeps/powerpc/powerpc64/power8/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcmp.S
@@ -31,6 +31,7 @@
64K as default, the page cross handling assumes minimum page size of
4k. */
+ .machine power8
ENTRY_TOCLESS (STRCMP, 4)
li r0,0
--
2.41.0

View File

@ -1,30 +0,0 @@
Patch NSIS so that it's installer stubs, produced at NSIS build time,
do not contain .reloc sections, which will exist by default when using
binutils/ld 2.36+.
This ultimately fixes an issue when running the installer with the
"Force randomization for images (Mandatory ASLR)" setting active.
This patch has not yet been sent upstream, because it's not clear if this
is the best fix, for the underlying issue, which seems to be that makensis
doesn't account for .reloc sections when it builds installers.
The existence of a reloc section shouldn't be a problem, and, if anything,
is actually a requirement for working ASLR. All other Windows binaries we
produce contain them, and function correctly when under the same
"Force randomization for images (Mandatory ASLR)" setting.
See:
https://github.com/bitcoin/bitcoin/issues/25726
https://sourceforge.net/p/nsis/bugs/1131/
--- a/SCons/Config/gnu
+++ b/SCons/Config/gnu
@@ -102,6 +102,7 @@ stub_env.Append(LINKFLAGS = ['-mwindows']) # build windows executables
stub_env.Append(LINKFLAGS = ['$NODEFLIBS_FLAG']) # no standard libraries
stub_env.Append(LINKFLAGS = ['$ALIGN_FLAG']) # 512 bytes align
stub_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file
+stub_env.Append(LINKFLAGS = ['-Wl,--disable-reloc-section'])
conf = FlagsConfigure(stub_env)
conf.CheckCompileFlag('-fno-tree-loop-distribute-patterns') # GCC 10: Don't generate msvcrt!memmove calls (bug #1248)