[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#344615: missinglib: ftbfs [sparc] *** [test] Bus error



On Tue, Jan 03, 2006 at 03:09:07PM +0100, Julien Cristau wrote:
> forwarded 344615 http://caml.inria.fr/mantis/view.php?id=3944
> kthxbye
> 
> On Mon, Jan  2, 2006 at 12:26:14 +0000, Jurij Smakov wrote:
> 
> > ldd is a double-word load, so the first argument (the memory location) 
> > must be double-word aligned. I bet it's not (what's the value of %i1?) and 
> > that's what causes the bus error.
> > 
> %i1 contains 0xa3f74, which is indeed not double-word aligned.
> The ocaml float allocation function doesn't take care of alignment, so
> we've reported this problem upstream.

As said on irc : configure has 

# Determine alignment constraints

case "$host" in
  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.
    # But there's a knack (PR#2572):
    # if we're in 64-bit mode (sizeof(long) == 8),
    # we must not doubleword-align floats...
    if test $2 = 8; then
      echo "Doubles can be word-aligned."
      echo "#undef ARCH_ALIGN_DOUBLE" >> m.h
    else
      echo "Doubles must be doubleword-aligned."
      echo "#define ARCH_ALIGN_DOUBLE" >> m.h
    fi;;
  *)
    sh ./runtest dblalign.c
    case $? in
      0) echo "Doubles can be word-aligned."
         echo "#undef ARCH_ALIGN_DOUBLE" >> m.h;;
      1) echo "Doubles must be doubleword-aligned."
         echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
      *) echo "Something went wrong during alignment determination for doubles."
         echo "I'm going to assume this architecture has alignment constraints over doubles."
         echo "That's a safe bet: Objective Caml will work even if"
         echo "this architecture has actually no alignment constraints."
         echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
    esac;;
esac

i guess sparc-*-* should be changed by sparc*-*-*, and we can then close this
bug.

Friendly,

Sven Luther



Reply to: