Page 1 of 1

cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 4:18 am
by blackoil
in checking whether to use setjmp/longjmp exceptions

Code: Select all

# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
# libobjc/configure.ac (for Objective-C).
# FIXME: This should be centralized in config/sjlj.m4.
# Check whether --enable-sjlj-exceptions was given.
if test "${enable_sjlj_exceptions+set}" = set; then :
  enableval=$enable_sjlj_exceptions; case "$enableval" in
   yes|no|auto) ;;
   *) as_fn_error "unknown argument to --enable-sjlj-exceptions" "$LINENO" 5 ;;
   esac
else
  enable_sjlj_exceptions=auto
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use setjmp/longjmp exceptions" >&5
$as_echo_n "checking whether to use setjmp/longjmp exceptions... " >&6; }
if test "${libgcc_cv_lib_sjlj_exceptions+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

void bar ();
void clean (int *);
void foo ()
{
  int i __attribute__ ((cleanup (clean)));
  bar();
}

_ACEOF
CFLAGS_hold=$CFLAGS
CFLAGS="--save-temps -fexceptions"
libgcc_cv_lib_sjlj_exceptions=unknown
if ac_fn_c_try_compile; then :
  if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
    libgcc_cv_lib_sjlj_exceptions=yes
  elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
    libgcc_cv_lib_sjlj_exceptions=no
  fi
fi
CFLAGS=$CFLAGS_hold
rm -f conftest*

Re: cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 4:56 am
by sortie
Uh - what? You'll have to give more context.

Re: cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 5:27 am
by blackoil
os: ubuntu 8.04
host_gcc: 4.3.2
target_gcc: 4.7.2
important-options: without-headers

the cc1 crashed, while compiling libgcc.
the configure script needs to determine what exceptions model, by grep unwind_resume or unwind_sjlj_resume from assembly output.
ac_fn_c_try_compile, maybe crashed here.

Re: cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 5:43 am
by bluemoon
blackoil wrote:os: ubuntu 8.04
Are you kidding me, or it's a very special embedded build?
As of today ubuntu has version 13.04, nearly double the version number you're using.

Anyway, have you check the wiki on building cross compiling toolchain?

Re: cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 6:34 am
by blackoil
yes. My cross build is almost done.

If I don't flag -fexceptions, the conftest passed. Otherwise internal compiler error.

Re: cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 7:53 am
by sortie
Right, you probably want to either:

1) Upgrade your current OS (Ubuntu 8.04 is FIVE YEARS OLD AND OBSOLETE)
2) Upgrade your current gcc (see http://wiki.osdev.org/Building_GCC) and then building the cross-compiler with your new gcc.
3) Actually give some real context. You appear to be doing crazy ****.

Re: cross build cc1 crashed, while in libgcc stage

Posted: Sun Sep 22, 2013 8:17 am
by blackoil
I think I missed some target debugging hook functions, that make cc1 crashed unexpectively.