Bug#773409: updated patch
Le 14/02/2016 12:28, Adam Borowski a écrit :
> x32 support has been accepted upstream. I'd be great to have it in Debian
> as well -- not having ocaml blocks hundreds of packages, both those written
> in ocaml as well as those which depend on ones written in ocaml.
>
> As you probably don't want to go with new upstream versions yet, here's an
> updated version of the patch. It needed fixing -- a directory has been
> moved in the meantime, but there are no actual code changes.
>
> Please apply!
What has been applied upstream is attached. It is different from what
you propose. I would prefer to apply that instead. Could you propose a
patch based on that? I guess there is work left in otherlibs/num, which
has disappeared in upstream trunk. In particular, I'm not sure the
BNG_ARCH_x32 variable is there anymore with upstream's way of adding
support for x32.
Cheers,
--
Stéphane
>From 58c07fa89ec6546cea911f1d2e7803fd7aa75de9 Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavier.leroy@inria.fr>
Date: Fri, 24 Jul 2015 12:31:42 +0000
Subject: [PATCH] PR#6722: compatibility with x32 architecture (x86-64 in
ILP32 mode)
configure: deselect ocamlopt, which is not supported
signals_machdep.h: use i386 instruction sequence, not amd64.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16243 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
---
Changes | 2 ++
byterun/caml/signals_machdep.h | 2 +-
configure | 11 +++++------
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Changes b/Changes
index 15a12be..99a9d4a 100644
--- a/Changes
+++ b/Changes
@@ -137,6 +137,8 @@ Features wishes:
(Jeremy Yallop, review by Gabriel Radanne)
- PR#6691: install .cmt[i] files for stdlib and compiler-libs
(David Sheets, request by Gabriel Radanne)
+- PR#6722: compatibility with x32 architecture (x86-64 in ILP32 mode).
+ ocamlopt is not supported, but bytecode compiles cleanly.
- PR#6742: remove duplicate virtual_flag information from Tstr_class
- PR#6719: improve Buffer.add_channel when not enough input is available
(Simon Cruanes)
diff --git a/byterun/caml/signals_machdep.h b/byterun/caml/signals_machdep.h
index 4987e2f..ce6bd2e 100644
--- a/byterun/caml/signals_machdep.h
+++ b/byterun/caml/signals_machdep.h
@@ -16,7 +16,7 @@
#ifndef CAML_SIGNALS_MACHDEP_H
#define CAML_SIGNALS_MACHDEP_H
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__)))
#define Read_and_clear(dst,src) \
asm("xorl %0, %0; xchgl %0, %1" \
diff --git a/configure b/configure
index 0842bcd..6f45591 100755
--- a/configure
+++ b/configure
@@ -855,14 +855,13 @@ esac
# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
# by $target. Turn off native code compilation on platforms where 64-bit mode
-# is not supported. (PR#4441)
+# is not supported (PR#4441).
+# Sometimes, it's 32-bit mode that is not supported (PR#6722).
-if $arch64; then
- case "$arch,$model" in
- sparc,default|power,ppc)
+case "$arch64,$arch,$model" in
+ true,sparc,*|true,power,ppc|false,amd64,*)
arch=none; model=default; system=unknown;;
- esac
-fi
+esac
if test -z "$ccoption"; then
nativecc="$bytecc"
--
2.7.0
Reply to: