Skip to content

Commit 0db330d

Browse files
committed
partial bitcoin#33185: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
excludes: - 91b5cba - 59c4898
1 parent fcbe2e1 commit 0db330d

File tree

4 files changed

+65
-7
lines changed

4 files changed

+65
-7
lines changed

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def check_MACHO_sdk(binary) -> bool:
253253
return False
254254

255255
def check_MACHO_lld(binary) -> bool:
256-
if binary.build_version.tools[0].version == [18, 1, 8]:
256+
if binary.build_version.tools[0].version == [19, 1, 4]:
257257
return True
258258
return False
259259

contrib/guix/libexec/prelude.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fi
7171
time-machine() {
7272
# shellcheck disable=SC2086
7373
guix time-machine --url=https://codeberg.org/guix/guix.git \
74-
--commit=53396a22afc04536ddf75d8f82ad2eafa5082725 \
74+
--commit=5cb84f2013c5b1e48a7d0e617032266f1e6059e2 \
7575
--cores="$JOBS" \
7676
--keep-failed \
7777
--fallback \

contrib/guix/manifest.scm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ inspecting signatures in Mach-O binaries.")
453453
(define-public glibc-2.31
454454
(let ((commit "7b27c450c34563a28e634cccb399cd415e71ebfe"))
455455
(package
456-
(inherit glibc) ;; 2.35
456+
(inherit glibc) ;; 2.39
457457
(version "2.31")
458458
(source (origin
459459
(method git-fetch)
@@ -464,7 +464,8 @@ inspecting signatures in Mach-O binaries.")
464464
(sha256
465465
(base32
466466
"017qdpr5id7ddb4lpkzj2li1abvw916m3fc6n7nw28z4h5qbv2n0"))
467-
(patches (search-our-patches "glibc-guix-prefix.patch"))))
467+
(patches (search-our-patches "glibc-guix-prefix.patch"
468+
"glibc-riscv-jumptarget.patch"))))
468469
(arguments
469470
(substitute-keyword-arguments (package-arguments glibc)
470471
((#:configure-flags flags)
@@ -537,9 +538,9 @@ inspecting signatures in Mach-O binaries.")
537538
(list gcc-toolchain-12 "static")
538539
(make-bitcoin-cross-toolchain target)))
539540
((string-contains target "darwin")
540-
(list clang-toolchain-18
541-
lld-18
542-
(make-lld-wrapper lld-18 #:lld-as-ld? #t)
541+
(list clang-toolchain-19
542+
lld-19
543+
(make-lld-wrapper lld-19 #:lld-as-ld? #t)
543544
python-signapple
544545
zip))
545546
(else '())))))
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
commit 68389203832ab39dd0dbaabbc4059e7fff51c29b
2+
Author: Fangrui Song <maskray@google.com>
3+
Date: Thu Oct 28 11:39:49 2021 -0700
4+
5+
riscv: Fix incorrect jal with HIDDEN_JUMPTARGET
6+
7+
A non-local STV_DEFAULT defined symbol is by default preemptible in a
8+
shared object. j/jal cannot target a preemptible symbol. On other
9+
architectures, such a jump instruction either causes PLT [BZ #18822], or
10+
if short-ranged, sometimes rejected by the linker (but not by GNU ld's
11+
riscv port [ld PR/28509]).
12+
13+
Use HIDDEN_JUMPTARGET to target a non-preemptible symbol instead.
14+
15+
With this patch, ld.so and libc.so can be linked with LLD if source
16+
files are compiled/assembled with -mno-relax/-Wa,-mno-relax.
17+
18+
Acked-by: Palmer Dabbelt <palmer@dabbelt.com>
19+
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
20+
21+
Can be dropped when we are using glibc 2.35 or later.
22+
23+
diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S
24+
index 0b92016b31..bec7ff80f4 100644
25+
--- a/sysdeps/riscv/setjmp.S
26+
+++ b/sysdeps/riscv/setjmp.S
27+
@@ -21,7 +21,7 @@
28+
29+
ENTRY (_setjmp)
30+
li a1, 0
31+
- j __sigsetjmp
32+
+ j HIDDEN_JUMPTARGET (__sigsetjmp)
33+
END (_setjmp)
34+
ENTRY (setjmp)
35+
li a1, 1
36+
diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S
37+
index 9510518750..e44a68aad4 100644
38+
--- a/sysdeps/unix/sysv/linux/riscv/setcontext.S
39+
+++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S
40+
@@ -95,6 +95,7 @@ LEAF (__setcontext)
41+
99: j __syscall_error
42+
43+
END (__setcontext)
44+
+libc_hidden_def (__setcontext)
45+
weak_alias (__setcontext, setcontext)
46+
47+
LEAF (__start_context)
48+
@@ -108,7 +109,7 @@ LEAF (__start_context)
49+
/* Invoke subsequent context if present, else exit(0). */
50+
mv a0, s2
51+
beqz s2, 1f
52+
- jal __setcontext
53+
-1: j exit
54+
+ jal HIDDEN_JUMPTARGET (__setcontext)
55+
+1: j HIDDEN_JUMPTARGET (exit)
56+
57+
END (__start_context)

0 commit comments

Comments
 (0)