Skip to content

Commit

Permalink
dev-lisp/gcl: Apply upstream patch for risc-v relocations
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/893938
Signed-off-by: Jakov Smolić <[email protected]>
  • Loading branch information
jsmolic committed Jun 25, 2024
1 parent 22add0b commit dc59458
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
67 changes: 67 additions & 0 deletions dev-lisp/gcl/files/gcl-2.6.15-riscv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From bc3324432b859477feed47e7db0e97dd33b61d1f Mon Sep 17 00:00:00 2001
From: Camm Maguire <[email protected]>
Date: Fri, 23 Feb 2024 07:47:26 -0500
Subject: update relocs for riscv64

---
gcl/h/elf64_riscv64_reloc.h | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/gcl/h/elf64_riscv64_reloc.h b/gcl/h/elf64_riscv64_reloc.h
index c2f8232..08e94ce 100644
--- a/h/elf64_riscv64_reloc.h
+++ b/h/elf64_riscv64_reloc.h
@@ -23,8 +23,50 @@
case R_RISCV_JAL:
break;
case R_RISCV_64:
- store_val(where,MASK(64),(s+a));
+ store_val(where,~0L,(s+a));
break;
case R_RISCV_32:
store_val(where,MASK(32),(s+a));
break;
+ case R_RISCV_32_PCREL:
+ store_val(where,MASK(32),(s+a)-p);
+ break;
+ case R_RISCV_ADD8:
+ add_val(where,MASK(8),(s+a));
+ break;
+ case R_RISCV_ADD16:
+ add_val(where,MASK(16),(s+a));
+ break;
+ case R_RISCV_ADD32:
+ add_val(where,MASK(32),(s+a));
+ break;
+ case R_RISCV_ADD64:
+ add_val(where,~0L,(s+a));
+ break;
+ case R_RISCV_SUB6:
+ add_val(where,MASK(6),-(s+a));
+ break;
+ case R_RISCV_SUB8:
+ add_val(where,MASK(8),-(s+a));
+ break;
+ case R_RISCV_SUB16:
+ add_val(where,MASK(16),-(s+a));
+ break;
+ case R_RISCV_SUB32:
+ add_val(where,MASK(32),-(s+a));
+ break;
+ case R_RISCV_SUB64:
+ add_val(where,~0L,-(s+a));
+ break;
+ case R_RISCV_SET6:
+ store_val(where,MASK(6),(s+a));
+ break;
+ case R_RISCV_SET8:
+ store_val(where,MASK(8),(s+a));
+ break;
+ case R_RISCV_SET16:
+ store_val(where,MASK(16),(s+a));
+ break;
+ case R_RISCV_SET32:
+ store_val(where,MASK(32),(s+a));
+ break;
--
cgit v1.1
6 changes: 5 additions & 1 deletion dev-lisp/gcl/gcl-2.6.15_pre3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ DEPEND="${RDEPEND}
app-text/texi2html
>=dev-build/autoconf-2.52"

PATCHES=( "${WORKDIR}"/${PF}-spelling.patch )
PATCHES=(
"${WORKDIR}"/${PF}-spelling.patch
# bug 893938
"${FILESDIR}"/${PN}-2.6.15-riscv.patch
)
S="${WORKDIR}"/${PN}-Version_2_6_15pre3/${PN}

src_configure() {
Expand Down

0 comments on commit dc59458

Please sign in to comment.