Debian Codegraph @

contrib/guix/patches/glibc-2.31-riscv64-fix-incorrect-jal-with-HIDDEN_JUMPTARGET.patch

raw
1 From: https://sourceware.org/git/?p=glibc.git;a=commit;h=68389203832ab39dd0dbaabbc4059e7fff51c29b
2 Context: https://sourceware.org/bugzilla/show_bug.cgi?id=28509
3
4 Resolves a build failure with glibc 2.31 + binutils >=2.40.
5 Patch can be removed if we update glibc to >= 2.35.
6
7 diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S
8 index 2cf31deeb4..3e61597b7a 100644
9 --- a/sysdeps/riscv/setjmp.S
10 +++ b/sysdeps/riscv/setjmp.S
11 @@ -21,7 +21,7 @@
12
13 ENTRY (_setjmp)
14 li a1, 0
15 - j __sigsetjmp
16 + j HIDDEN_JUMPTARGET (__sigsetjmp)
17 END (_setjmp)
18 ENTRY (setjmp)
19 li a1, 1
20 diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S
21 index fb9937517d..e7f1e6481b 100644
22 --- a/sysdeps/unix/sysv/linux/riscv/setcontext.S
23 +++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S
24 @@ -95,6 +95,7 @@ LEAF (__setcontext)
25 99: j __syscall_error
26
27 END (__setcontext)
28 +libc_hidden_def (__setcontext)
29 weak_alias (__setcontext, setcontext)
30
31 LEAF (__start_context)
32 @@ -108,7 +109,7 @@ LEAF (__start_context)
33 /* Invoke subsequent context if present, else exit(0). */
34 mv a0, s2
35 beqz s2, 1f
36 - jal __setcontext
37 -1: j exit
38 + jal HIDDEN_JUMPTARGET (__setcontext)
39 +1: j HIDDEN_JUMPTARGET (exit)
40
41 END (__start_context)