public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs1.0.2 + libg++ cross build failure
@ 1998-03-31  5:29 Neal Becker
  1998-04-01 17:05 ` Jim Wilson
  1998-04-02  3:41 ` Joel Sherrill
  0 siblings, 2 replies; 5+ messages in thread
From: Neal Becker @ 1998-03-31  5:29 UTC (permalink / raw)
  To: egcs

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.

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=<path_to_newlib>/newlib/libc/include.  *Luckily* the
needed headers are all in this directory.

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.

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).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: egcs1.0.2 + libg++ cross build failure
  1998-03-31  5:29 egcs1.0.2 + libg++ cross build failure Neal Becker
@ 1998-04-01 17:05 ` Jim Wilson
  1998-04-02  8:32   ` David Edelsohn
  1998-04-02  3:41 ` Joel Sherrill
  1 sibling, 1 reply; 5+ messages in thread
From: Jim Wilson @ 1998-04-01 17:05 UTC (permalink / raw)
  To: Neal Becker; +Cc: egcs

	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.

You probably did something wrong, but since you haven't said exactly what
you did or what error you got, I can't tell what is wrong.

The toplevel Makefile will build gcc first, and then newlib.  You don't need
any headers to build gcc, so it should all magically work.

	Problem 2) Configuring in m68k-unknown-coff/librx
	configure: error: installation or configuration problem: C compiler
	cannot create executables.

Looks like the libg++-2.8.1 patch is broken for cross compilers.  I would
suggest not using it.

Jim

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: egcs1.0.2 + libg++ cross build failure
  1998-03-31  5:29 egcs1.0.2 + libg++ cross build failure Neal Becker
  1998-04-01 17:05 ` Jim Wilson
@ 1998-04-02  3:41 ` Joel Sherrill
  1 sibling, 0 replies; 5+ messages in thread
From: Joel Sherrill @ 1998-04-02  3:41 UTC (permalink / raw)
  To: Neal Becker; +Cc: egcs

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=<path_to_newlib>/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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: egcs1.0.2 + libg++ cross build failure
  1998-04-01 17:05 ` Jim Wilson
@ 1998-04-02  8:32   ` David Edelsohn
  1998-04-03 21:52     ` Jim Wilson
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 1998-04-02  8:32 UTC (permalink / raw)
  To: Jim Wilson; +Cc: Neal Becker, egcs

>>>>> Jim Wilson writes:

> 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.

Jim> You probably did something wrong, but since you haven't said exactly what
Jim> you did or what error you got, I can't tell what is wrong.

Jim> The toplevel Makefile will build gcc first, and then newlib.  You don't need
Jim> any headers to build gcc, so it should all magically work.

	This is the exact same problem that I reported a few weeks ago.
The build of GCC requires some of the header supplied by newlib to
determine the sizes of basic types, e.g. scan-types.sh.

	The current Makefile does not automatically add
-I../../<source>/newlib/libc/include to the CFLAGS so that the
not-yet-installed header files are found.  When I pre-installed
the header files in the target installation location, things proceeded
fine.

	Either scan-types.sh and other steps which require the newlib
header files should not be run with "make cross" or EGCS should be able to
find the header files prior to newlib being built and installed to avoid
the chicken and egg problem.

	On a separate note, I also was surprised that EGCS actually had to
"fix" some of the newlib header files during that phase of the build --
not just scan them.

	When I reported this before, Jeff Johnston of Cygnus replied that
the current EGCS releases were not fully setup for cross builds yet.  He
said that the next Cygnus progressive release (98R1) incorporates egcs-1.0
and newlib-1.8 and does not have these problems.  He mentioned that the
Cygnus development version of GCC "... only runs scan-types.sh if
SYSTEM_HEADER_DIR exists which only occurs if --with-headers option was
used [to configure the tree]."

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: egcs1.0.2 + libg++ cross build failure
  1998-04-02  8:32   ` David Edelsohn
@ 1998-04-03 21:52     ` Jim Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Jim Wilson @ 1998-04-03 21:52 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Neal Becker, egcs

	This is the exact same problem that I reported a few weeks ago.
	The build of GCC requires some of the header supplied by newlib to
	determine the sizes of basic types, e.g. scan-types.sh.

This is trivial to workaround.  Don't run scan-types.sh.  It isn't needed when
using newlib.

	 He mentioned that the
	Cygnus development version of GCC "... only runs scan-types.sh if
	SYSTEM_HEADER_DIR exists which only occurs if --with-headers option was
	used [to configure the tree]."

Yes, this is one of the cross-compiler related patches that we need to merge
from the Cygnus gcc sources into the EGCS gcc sources.  It is on my list of
things to do, but I don't know when I will get around it.

Jim

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-04-03 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-31  5:29 egcs1.0.2 + libg++ cross build failure Neal Becker
1998-04-01 17:05 ` Jim Wilson
1998-04-02  8:32   ` David Edelsohn
1998-04-03 21:52     ` Jim Wilson
1998-04-02  3:41 ` Joel Sherrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).