This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[dmj+@andrew.cmu.edu: Does libstdc++ v3 not work with Canadian crosses?]


Trying again, with a different audience...

I tried to build gcc 3.0 in a canadian cross.  It didn't work very well.

In the top level configure.in, we have this gem:
if [ x"${host}" = x"${target}" ] ; then
        # when doing a native toolchain, don't build the targets
        # that are in the 'cross only' list
        skipdirs="${skipdirs} ${cross_only}"
        is_cross_compiler=no
else

That is, we set is_cross_compiler based on whether what we are
currently building will be a cross compiler.


Then we have:
# Passing a --with-cross-host argument lets the target libraries know
# whether they are being built with a cross-compiler or being built
# native.  However, it would be better to use other mechanisms to make the
# sorts of decisions they want to make on this basis.  Please consider
# this option to be deprecated.  FIXME.
if [ x${is_cross_compiler} = xyes ]; then
  targargs="--with-cross-host=${host_alias} ${targargs}"
fi

So --with-cross-host is passed automatically only if host != target. 
That's not in agreement with the comment.


The problem is that if --with-cross-host is not passed, the xcompiling=1
and NATIVE=0 block in libstdc++'s configure.in is never reached.  We try to
run mknumeric_limits.  It fails, because it was compiled for the target.  We
lose.


It seems that --with-cross-host is being used to cover two different
things: tests that can not be run, because we can't execute target
programs, so we have to guess; and features that we turn off, because
we assume we're targetting a cross environment.  For instance, it
enables the small configuration for Boehm-GC, and a lot of comments in
various configure.in's about AC_REPLACE_FUNCS (should be AC_CHECK_FUNCS
now, I guess?) not working if we can not link target executables.

Neither of those assumptions are correct for a canadian cross.  We can
link target executables; that's what we're trying to do.  But we can't
run target binaries, like gen-numeric-limits.

Should the conditions for running gen-numeric-limits change?  Or should
I give in and use explicitly (or fix the implicit adding of)
--with-cross-host?  It costs some functionality I'd rather not turn
off.


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

----- End forwarded message -----

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]