[Top][All Lists]

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

Guile FTBFS on hppa - problem in detecting stack direction?

From: Neil Jerram
Subject: Guile FTBFS on hppa - problem in detecting stack direction?
Date: Wed, 6 Aug 2008 21:38:32 +0100

Hi hppa people!  I'm hoping you can help me fix a FTBFS that we're
getting with Guile on hppa.

The build log is here:;ver=1.8.5%2B1-2;arch=hppa;stamp=1217809852

The specific problem is a segmentation fault, at a point in a build
that probably won't mean anything to non-Guile folks - but the key
point is that we were recently seeing exactly the same segmentation
fault (i.e. at the same place) on several other architectures (mips,
mipsel, powerpc), and that was caused by the code in not
detecting the stack direction properly.

This patch -;a=commit;h=9143131b2766d1e29e05d61b5021395b4c93a6bc
- fixed the problem for mips, mipsel and powerpc, but it looks as
though we are still getting the stack direction wrong on hppa.  (My
understanding is that on hppa the stack actually grows upwards,
whereas on most platforms it's downwards.)

I've appended the relevant bit of below.  Can anyone help
with why this might not be working on hppa?


# Which way does the stack grow?
# Following code comes from Autoconf 2.61's internal _AC_LIBOBJ_ALLOCA
# macro (/usr/share/autoconf/autoconf/functions.m4).  Gnulib has
# very similar code, so in future we could look at using that.
# An important detail is that the code involves find_stack_direction
# calling _itself_ - which means that find_stack_direction (or at
# least the second find_stack_direction() call) cannot be inlined.
# If the code could be inlined, that might cause the test to give
# an incorrect answer.

AC_CACHE_CHECK([stack direction],
find_stack_direction ()
  static char *addr = 0;
  auto char dummy;
  if (addr == 0)
      addr = &dummy;
      return find_stack_direction ();
    return (&dummy > addr) ? 1 : -1;

main ()
  return find_stack_direction () < 0;
               [AC_MSG_WARN(Guessing that stack grows down -- see 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]