guix: fix riscv64-linux-gnu build
Some checks are pending
ci/gh-actions/build / build-ubuntu-without-scanner (push) Waiting to run
ci/gh-actions/guix / arm64-apple-darwin (push) Blocked by required conditions
ci/gh-actions/guix / riscv64-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-apple-darwin (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-linux-gnu.no-tor-bundle (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-linux-gnu.pack (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-w64-mingw32.installer (push) Blocked by required conditions
ci/gh-actions/guix / x86_64-w64-mingw32 (push) Blocked by required conditions
ci/gh-actions/guix / bundle-logs (push) Blocked by required conditions
ci/gh-actions/guix / cache-sources (push) Waiting to run
ci/gh-actions/guix / aarch64-linux-gnu (push) Blocked by required conditions
ci/gh-actions/guix / arm-linux-gnueabihf (push) Blocked by required conditions

This commit is contained in:
tobtoht 2024-11-03 01:12:52 +01:00
parent 1df5842ea3
commit 0195bdc59c
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
2 changed files with 43 additions and 1 deletions

View file

@ -203,7 +203,8 @@ chain for " target " development."))
(sha256
(base32
"1zi0s9yy5zkisw823vivn7zlj8w6g9p3mm7lmlqiixcxdkz4dbn6"))
(patches (search-our-patches "glibc-guix-prefix.patch"))))
(patches (search-our-patches "glibc-guix-prefix.patch"
"glibc-2.31-riscv64-fix-incorrect-jal-with-HIDDEN_JUMPTARGET.patch"))))
(arguments
(substitute-keyword-arguments (package-arguments glibc)
((#:configure-flags flags)

View file

@ -0,0 +1,41 @@
From: https://sourceware.org/git/?p=glibc.git;a=commit;h=68389203832ab39dd0dbaabbc4059e7fff51c29b
Context: https://sourceware.org/bugzilla/show_bug.cgi?id=28509
Resolves a build failure with glibc 2.31 + binutils >=2.40.
Patch can be removed if we update glibc to >= 2.35.
diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S
index 2cf31deeb4..3e61597b7a 100644
--- a/sysdeps/riscv/setjmp.S
+++ b/sysdeps/riscv/setjmp.S
@@ -21,7 +21,7 @@
ENTRY (_setjmp)
li a1, 0
- j __sigsetjmp
+ j HIDDEN_JUMPTARGET (__sigsetjmp)
END (_setjmp)
ENTRY (setjmp)
li a1, 1
diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S
index fb9937517d..e7f1e6481b 100644
--- a/sysdeps/unix/sysv/linux/riscv/setcontext.S
+++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S
@@ -95,6 +95,7 @@ LEAF (__setcontext)
99: j __syscall_error
END (__setcontext)
+libc_hidden_def (__setcontext)
weak_alias (__setcontext, setcontext)
LEAF (__start_context)
@@ -108,7 +109,7 @@ LEAF (__start_context)
/* Invoke subsequent context if present, else exit(0). */
mv a0, s2
beqz s2, 1f
- jal __setcontext
-1: j exit
+ jal HIDDEN_JUMPTARGET (__setcontext)
+1: j HIDDEN_JUMPTARGET (exit)
END (__start_context)