[RFC] Do we care about binary compatibility of code produced by cross-compilers?

Ian Lance Taylor iant@google.com
Mon Aug 25 18:32:00 GMT 2008


Paolo Carlini <paolo.carlini@oracle.com> writes:

> By the way, two other stumbling block seem GCC_CHECK_UNWIND_GETIPINFO
> (I think it has to do with an ABI issue on darwin...), which also
> links and we can't easily move, and similarly AM_ICONV. Any
> suggestions about those?

Right now, when building a cross-compiler, libstdc++ simply assumes
that _Unwind_GetIPInfo is available.  When building with a native
compiler, GCC_CHECK_UNWIND_GETIPINFO does a link test to see whether
it is there.

I note that libjava calls both GCC_CHECK_TLS and
GCC_CHECK_UNWIND_GETIPINFO unconditionally, even when building with a
cross-compiler.

I assume your goal to have libstdc++ configury not perform any link
tests.

In this specific case, because _Unwind_GetIPInfo is provided by the
compiler support libraries when it is present, it might be possible to
write a link test which works even if libc has not yet been built.
The idea would be something like this:

  hold_LDFLAGS="$LDFLAGS"
  hold_LIBS="$LIBS"
  LDFLAGS="$LDFLAGS -nostdlib"
  LIBS="$LIBS -lgcc"
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern void Unwind_GetIPInfo();]],
                                  [[Unwind_GetIPInfo();]])],
                 [gcc_cv_getipinfo=yes],
                 [gcc_cv_getipinfo=no])
  LDFLAGS="$hold_LDFLAGS"
  LIBS="$hold_LIBS"


I don't see how to run AM_ICONV without doing a link test.

Ian



More information about the Libstdc++ mailing list