This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Cross Compiler and Linker for Linux
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Cc: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>, <dave at joot dot com>, <gcc at gnu dot org>
- Date: Fri, 30 May 2003 18:38:38 -0400 (EDT)
- Subject: Re: Cross Compiler and Linker for Linux
On Fri, 30 May 2003, Joel Sherrill wrote:
> I vaguely recall not being able to build C++ because of the same thing
> you are seeing now. Some math functions are NOT there in the
> headers and libraries. Does C++ build natively on Solaris? Is so, how
> does
> it get past this point?
Native builds don't exhibit this problem. Cross compiles of libstdc++-v3
are complicated because they avoid autodetection of target features.
configure.in has:
if test -n "$with_cross_host" || test x"$build" != x"$host"; then
# We are being configured with some form of cross compiler.
GLIBCPP_IS_CROSS_COMPILING=1
# This lets us hard-code the functionality we know we'll have in the cross
# target environment. "Let" is a sugar-coated word placed on an especially
# dull and tedious hack, actually.
...
and proceeds to hardcode assumptions for various targets, including Solaris:
*-solaris*)
case "$target" in
*-solaris2.5)
os_include_dir="os/solaris/solaris2.5"
;;
...
These AC_DEFINE's etc. could easily become out-of-date and incorrect.
(The configure.in in libjava is similar.)
In short, configure is supporting cross-builds in the most generic way,
by assuming the toolchain and/or runtime libs may not yet be completely
built and AC_TRY_COMPILE won't work.
It'd be *really useful* if configure would first attempt AC_TRY_COMPILE
for cross-builds, falling back on the preconfigured defaults. In the
meantime, I've used a hack something like the one below with good results.
Jeff
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.125
diff -u -r1.125 configure.in
--- configure.in 22 May 2003 17:04:13 -0000 1.125
+++ configure.in 30 May 2003 22:34:46 -0000
@@ -82,7 +82,7 @@
fi
-if test -n "$with_cross_host" || test x"$build" != x"$host"; then
+if false; then
# We are being configured with some form of cross compiler.
GLIBCPP_IS_CROSS_COMPILING=1