From: Stéphane Glondu Date: Thu, 20 Jun 2024 00:37:06 +0000 (+0200) Subject: Fix FTBFS on m68k X-Git-Tag: archive/raspbian/5.2.0-2+rpi1^2~36 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=34a75930adbff02733c7e91e53afda4e5b3edfc9;p=ocaml.git Fix FTBFS on m68k --- diff --git a/debian/patches/0009-Remove-fixed-register-assignments-on-m68k.patch b/debian/patches/0009-Remove-fixed-register-assignments-on-m68k.patch new file mode 100644 index 00000000..26bc0693 --- /dev/null +++ b/debian/patches/0009-Remove-fixed-register-assignments-on-m68k.patch @@ -0,0 +1,37 @@ +From: Miod Vallat +Date: Wed, 19 Jun 2024 13:13:03 +0000 +Subject: Remove fixed register assignments on m68k. + +The use of %a5 conflicts with its internal usage as a GOT base by Glibc, and +given the scarce number of available registers on this platform, it is +probably better to trust the compiler to perform register assignment here. + +Origin: https://github.com/ocaml/ocaml/pull/13252 +--- + runtime/interp.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/runtime/interp.c b/runtime/interp.c +index 66f0123..b688a6d 100644 +--- a/runtime/interp.c ++++ b/runtime/interp.c +@@ -208,11 +208,18 @@ Caml_inline void check_trap_barrier_for_effect + #define SP_REG asm("%r17") + #define ACCU_REG asm("%r16") + #endif +-#ifdef __mc68000__ ++#ifdef __mc68000__ /* { */ ++#ifdef __linux__ ++/* glibc relies upon %a5 to always contain the base address of the GOT. */ ++#define PC_REG asm("a3") ++#define SP_REG asm("a4") ++#define ACCU_REG asm("d7") ++#else + #define PC_REG asm("a5") + #define SP_REG asm("a4") + #define ACCU_REG asm("d7") + #endif ++#endif /* } __mc68000 */ + /* PR#4953: these specific registers not available in Thumb mode */ + #if defined (__arm__) && !defined(__thumb__) + #define PC_REG asm("r6") diff --git a/debian/patches/series b/debian/patches/series index da8df5a1..65399d57 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ 0007-Put-manpages-in-section-3o-instead-of-3.patch 0008-Filter-out-f-debug-file-prefix-map-from-ocamlc_cflag.patch 0008-Fix-call-to-test-in-configure.ac.patch +0009-Remove-fixed-register-assignments-on-m68k.patch