Re: hppa ocaml build failure :(((
On Thu, Oct 16, 2003 at 02:54:25PM +0200, Xavier Leroy wrote:
> Hello,
>
> > GAH! Make that: ocaml was doing a 64-bit store (with fstd) to a 32-bit
> > aligned address. (Gotta remember to keep my architectures straight...)
> >
> > Since malloc always returns a 64-bit aligned address, you have to work to
> > be unaligned...
>
> Right. OCaml has its own garbage-collected memory management, and,
> yes, it can access double floats at word-aligned addresses.
>
> However, alignment constraints are detected during autoconfiguration,
> and if doubles need alignment above 1 word, accesses to doubles go
> through special re-aligning routines (functions Double_val and
> Store_double_val in ocamlrun).
>
> This is the theory. The practice is that the autoconfiguration
> procedure might have detected incorrectly the alignment constraints
> (this happened to Sven Luther on the SPARC with a recent version of
> gcc), or were fooled by a kernel that performs alignment fixups behind
> the program's back.
>
> One way to circumvent the problem is to add a special case to the
> "configure" script, next to the SPARC special case:
LaMont, could you copy the attached dpatch to the
ocaml-3.07/debian/patches directory, add a hppa line to
ocaml-3.07/debian/patches/00list, and try building it, and see if it
solves this problem ? I don't know if building it on paer will work, but
anyway, here is what i get from the first steps of configuration :
...
# Add here commands to configure the package.
./configure --with-pthread -prefix /usr \
-mandir /usr/share/man \
-tkdefs "-I/usr/include/tcl8.4" \
-tklibs "-L/usr/lib -ltk8.4 -ltcl8.4"
Configuring for a hppa64-unknown-linux-gnu ...
gcc found
The C compiler is ANSI-compliant.
Checking the sizes of integers and pointers...
OK, this is a regular 32 bit architecture.
64-bit "long long" integer type found (printf with "%ll").
This is a big-endian architecture.
Doubles must be doubleword-aligned.
64-bit integers can be word-aligned.
Native division and modulus have round-towards-zero semantics, will use them.
ranlib found
...
So, it discovers that doubles must be doubleword-aligned, which should
solve our problem. BTW, it also say that 64-bit integers can be
word-aligned, i guess this is ok.
Anyway, i don't have enough knowledge of the hppa arch to be able to
detect myself if it did work or not, and furthermore, i don't want to
kill paer or something such.
Friendly,
Sven Luther
#! /bin/sh -e
## hppa.dpatch by <luther@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Makefiles, configure scripts and other build stuff adapted for
## DP: debian package creation
if [ $# -ne 1 ]; then
echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
exit 1
fi
case "$1" in
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
*)
echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
exit 1;;
esac
exit 0
@DPATCH@
--- ocaml-3.07/configure.orig 2003-10-16 13:15:23.000000000 +0000
+++ ocaml-3.07/configure 2003-10-16 13:15:54.000000000 +0000
@@ -401,9 +401,10 @@
# Determine alignment constraints
case "$host" in
- sparc-*-*)
+ sparc-*-*|hppa*-*-*)
# On Sparc V9 with certain versions of gcc, determination of double
# alignment is not reliable (PR#1521), hence force it
+ # Same goes for hppa.
echo "Doubles must be doubleword-aligned."
echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
*)
Reply to: