From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Sherrill To: Neal Becker Cc: egcs@cygnus.com Subject: Re: egcs1.0.2 + libg++ cross build failure Date: Thu, 02 Apr 1998 03:41:00 -0000 Message-id: References: X-SW-Source: 1998-04/msg00039.html On Tue, 31 Mar 1998, Neal Becker wrote: > I am trying to build egcs-1.0.2 + libg++-2.8.1 patch as cross with > host i686-pc-linux-gnu target m68k-unknown-coff. > > I am building with newlib-1.8.0. I regularly build m68k-rtems using newlib 1.8.0 and egcs 1.0.2 for all languages (including fortran and objective-c) and don't have any real problems. It is just a matter of doing things in the right order. > Problem 1) Headers aren't found. Yes I've read the FAQ. Headers > can't possibly be found, because you have to install the compiler > first, then you can install newlib. My solution: I added > --with-headers=/newlib/libc/include. *Luckily* the > needed headers are all in this directory. -Dinhibit-libc should be included on LIBGCC2_CFLAGS. I thought the configure scripts added this automatically on egcs. This used ot be part of the crossgcc patch. > Problem 2) Configuring in m68k-unknown-coff/librx > creating cache ./config.cache > checking for gcc... /usr/local/src/m68k/egcs-1.0.2/gcc/xgcc -B/usr/local/src/m68k/egcs-1.0.2/gcc/ > checking whether the C compiler (/usr/local/src/m68k/egcs-1.0.2/gcc/xgcc -B/usr/local/src/m68k/egcs-1.0.2/gcc/ -g -O2 ) works... no > configure: error: installation or configuration problem: C compiler > cannot create executables. Look at config.log but this indicates that the configure script is trying to link a test program and can't. It is probably because you have not gotten a crt0.o yet as that is built with newlib. > My solution: Go ahead and make -k install LANGUAGES="c c++". Then > build and install newlib. Then go back and build in egcs+libg++ again > (now that crt0 is installed this last error will hopefully go away). Yep. This is how the RTEMS tool build script does it. It does this + build/install c and c++ + remove limits.h and libgcc.a and rebuild them so they don't have to do the inhibit_libc (RTEMS' limits.h is in newlib and gcc can't find it the first time it generates xlimits.h) + build/install all other languages This seems to work pretty reliably so I think you are on the right track. --joel