Re: [PATCH] Re: freeze for sbcl-2.6.2

Alexandru Popa <[email protected]> Sat, 28 Feb 2026 15:55:39 +0200
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <CAL2wRjTvQ=0rK4NJAYOTxZSDeJVk7QQC+sOzbrhs1Wrt9j+Ypg@mail.gmail.com>
With the 2nd patch SBCL on Haiku compiles and runs at first sight.

пт, 27 февр. 2026 г. в 20:11, Andreas Franke <[email protected]>:

> This one might be better, at least a bit. Still no guarantee, though.
> HTH
>

_______________________________________________
Sbcl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
0001-Add-fallback-ELF-relocation-type-definitions-for-Hai.patch (text/x-patch, 1.7 KB)
From c8e68353a3717d14fa62b0f8af1424097e65bd91 Mon Sep 17 00:00:00 2001
From: CC <cc@localhost>
Date: Fri, 27 Feb 2026 18:02:09 +0000
Subject: [PATCH] Add fallback ELF relocation type definitions for Haiku

Haiku's elf.h only defines i386 relocation constants, not x86-64,
AArch64, or PPC64 ones. This causes a compilation failure on Haiku
x86-64 because R_X86_64_64 is undefined in os-common.c.

Add architecture-guarded fallback definitions for R_X86_64_64,
R_AARCH64_ABS64, and R_PPC64_ADDR64 after the existing SHF_GNU_RETAIN
fallback, following the same pattern. Each is only defined on its
matching architecture. The values are stable ABI constants and the
guards make this a no-op on platforms that already define them.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 src/runtime/os-common.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/runtime/os-common.c b/src/runtime/os-common.c
index dd7dc3ef9..c9ead62bc 100644
--- a/src/runtime/os-common.c
+++ b/src/runtime/os-common.c
@@ -503,6 +503,17 @@ int sbcl_mprotect(void* addr, size_t length, int prot) {
 #ifndef SHF_GNU_RETAIN
 #define SHF_GNU_RETAIN (1 << 21)
 #endif
+/* Provide fallback definitions for relocation types that some platforms
+ * (e.g. Haiku) omit from their elf.h */
+#if defined(LISP_FEATURE_X86_64) && !defined(R_X86_64_64)
+#define R_X86_64_64 1
+#endif
+#if defined(LISP_FEATURE_ARM64) && !defined(R_AARCH64_ABS64)
+#define R_AARCH64_ABS64 257
+#endif
+#if defined(LISP_FEATURE_PPC64) && !defined(R_PPC64_ADDR64)
+#define R_PPC64_ADDR64 38
+#endif
 
 static off_t lisp_rel_section_offset;
 static ssize_t lisp_rel_section_size;
-- 
2.43.0