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]
Other format: [Raw text]

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


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