public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Tutorial 3
@ 2002-06-16 15:42 Mark Butcher
  2002-06-17  1:57 ` Andrew Haley
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mark Butcher @ 2002-06-16 15:42 UTC (permalink / raw)
  To: gcc-help; +Cc: gcc

Hi All

Here an update of my weary journey from innocent and gullable PC user to
hardened, grey-haired GCC cross-compiler guru. Actually the journey
probably has not yet reached further than the end of the garden path and I
must still be making some kind of beginners errors - but its hope that
drives me on.

So what have I learned ?

1. I downloaded GCC 3.1 (instead of 3.0.4) and tried again with the Mcore
target. This time the 'sjlj' error had disappeared and the build reaches
the same position as the ARM target attempt.

1.a. I assume that the Mcore target really does have a problem in 3.0.4
because I changed absolutely nothing except the compiler version.

2. So where is the build breaking now ? Still in the same place as before
(same with Arm and Mcore target attempty), so here are the details again
(as from ARM):

Configuring in mcore-elf/libiberty
loading cache ../config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo
checking for perl... perl
checking host system type... mcore-unknown-elf
checking build system type... i586-pc-cygwin
checking for mcore-elf-ar... (cached) mcore-elf-ar
checking for mcore-elf-ranlib... (cached) mcore-elf-ranlib
checking for gcc... (cached) /usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include
checking whether we are using GNU C... (cached) yes
checking whether /usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include accepts -g... (cached) yes
checking for POSIXized ISC... no
checking for working const... yes
checking for inline... inline
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking how to run the C preprocessor... (cached) /lib/cpp
checking for sys/file.h... grep: conftest.out: No such file or directory
yes
checking for sys/param.h... grep: conftest.out: No such file or directory
yes
checking for limits.h... grep: conftest.out: No such file or directory
yes
checking for stdlib.h... grep: conftest.out: No such file or directory
yes
checking for string.h... grep: conftest.out: No such file or directory
yes
checking for unistd.h... grep: conftest.out: No such file or directory
yes
checking for strings.h... grep: conftest.out: No such file or directory
yes
checking for sys/time.h... grep: conftest.out: No such file or directory
yes
checking for time.h... grep: conftest.out: No such file or directory
yes
checking for sys/resource.h... grep: conftest.out: No such file or
directory
yes
checking for sys/stat.h... grep: conftest.out: No such file or directory
yes
checking for sys/mman.h... grep: conftest.out: No such file or directory
yes
checking for fcntl.h... grep: conftest.out: No such file or directory
yes
checking for alloca.h... grep: conftest.out: No such file or directory
yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking whether time.h and sys/time.h may both be included... no
checking whether errno must be declared... yes
checking for ANSI C header files... grep: conftest.out: No such file or
directory
no
checking for uintptr_t... no
checking whether the C compiler (/usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot
create executables.
make: *** [configure-target-libiberty] Error 1

[The error is because the linker doesn't find "crt0.o"]



So maybe some path is not set up correctly ? But this could mean more than
one path since the missing header files are not all in one place - so I
poked around looking at the log files and to my suprise realised that
probably a whole bunch of other errors occured, which howver did not break
the build.

Here is a list of the config.log file I found on the computer, in order of
their save time (starting with the oldest).

  gcc/libiberty/config.log
  gcc/gcc/config.log
  gcc/mcore-elf/big/libstdc++-v3/config.log
  gcc/mcore-elf/m210/libstdc++-v3/config.log
  gcc/mcore-elf/big/m210/libstdc++-v3/config.log
  gcc/mcore-elf/libstdc++-v3/config.log
  gcc/mcore-elf/libiberty/config.log

The time between the first and last being about one hour (on slow laptop).
(Does this run sequentially or can the flow be nested ?)

Although the build broke in gcc/mcore-elf/libiberty I curiously checked out
the content of the others and to my horror and suprise found that they were
full of errors but none of them caused the build to stop, until for some
reason the last one.

The compiler seems to work until the linker is used. The linker never seems
to be able to find any of the programs it should link. For example, the
first error message was due to "asprintf()" not being linked. Then some
more:

  basename()
  insque()
  mkstemps()
  sigsetmask()
  vasprintf()
  _doprnt()
  ...
and on and on and on..., right through all library builds.


But maybe it's normal that they all fail .. (some of) the libraries seems
to exist and on a repeat of the build they are not repeatedly built.
Perhaps they are supposed to fail and only then are they actually created
(?).

Well, for example asprint.o and a bunch of other library .o files are in
gcc/libiberty (created some time around the beginning of the build attempt)
but the files mcore-elf/big, mcore-elf/libiberty, mcore-elf/libstdc++-v3/..
are all pretty much empty.

As for the missing header files, they are all in gcc-3.1 source directories
(quite deep, like gcc-3.1/gcc/fixinc/tests/base/sys/..). In the build
directory there are a number of headers (about 20), mainly in gcc/gcc and
gcc/gcc/include and I am wondering where they should be at this point. Are
they normally copied to the target directory or do they remain in the souce
directory, and if so, how should they be found ?

I think this has knocked me more or less back to square one and I can not
get my head around it any more (it's getting too late again). Perhaps some
of this may jog someones memory - " Ohh Yes, I remember now, it also took
me .. months to work it out until I did ........" (please free to fill in
the missing words).


Cheers


Mark in Switzerland

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Tutorial 3
@ 2002-06-18 14:41 Mark Butcher
  2002-06-18 16:56 ` Hans-Peter Nilsson
  2002-06-19 14:01 ` Peter Barada
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Butcher @ 2002-06-18 14:41 UTC (permalink / raw)
  To: Peter Barada; +Cc: gcc, gcc-help

Hi Peter

I think that Bill Gatliff's site should be compulsory reading for anyone
contemplating a GCC cross-build. [www.billgatliff.com]. Although there is
only a relatively small amount of information, it is the information that
is needed and the example script is even more or less understandable to a
dummy like myself.

Build BINUTILS
Build a minimum gcc without headers and libraries
Build NEWLIB with the minimum gcc
Build the full GCC

Logical once it is explained in plain text and not camouflaged with jargon
(why has it taken me a month to discover the 4 steps ?)

The full GCC build didn't work - failing for the same reason as before -
but I am sure that it is now something silly which I can, given adequate
time, solve myself. I see that I now really do have "mcore-elf-gcc.exe" in
the mcore/bin directory (I think that this must be the minimum gcc
compiler) "crt0.o" libraries like "libc.a" are also in /mcore-elf
directories. Since some things seem to be in /mcore and some others in
/mcore-elf I probably did something not quite right when setting prefixes,
resulting in the files not being found correctly - once I have gained a
little more strength I will probably be able to swat the last self-made bug
and will take time off to celebrate.

Hope to give the mailing list a rest very soon (I think I said this several
weeks ago, but perhaps it will really happen this time). 

Cheers

Mark

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Tutorial 3
@ 2002-06-18 14:41 Mark Butcher
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Butcher @ 2002-06-18 14:41 UTC (permalink / raw)
  To: Phil Edwards; +Cc: gcc-help

Hi Phil

Thanks for your notes.

I am also sure that the problem is due to not finding some headers and
library files. In the mean time I believe that I have managed to
successfully build NEWLIB and am quite sure that the (previously really)
missing items are present (mcore-elf-gcc.exe is now there, crt0.o is now
there and libraries like libc.a).

Although the full gcc build still failed for the same reason, it must be
something silly and so probably even I can fix it - given a little more
time.

I'm looking forward to posting details of my successful build for the mcore
soon, with a list of exactly what to type in to get it working - for any
other Windows Cygwin Dummies out there.

Cheers

Mark

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

end of thread, other threads:[~2002-06-19 21:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-16 15:42 Tutorial 3 Mark Butcher
2002-06-17  1:57 ` Andrew Haley
2002-06-17  9:31 ` Peter Barada
2002-06-17 13:25 ` Phil Edwards
2002-06-18 14:41 Mark Butcher
2002-06-18 16:56 ` Hans-Peter Nilsson
2002-06-19 14:01 ` Peter Barada
2002-06-18 14:41 Mark Butcher

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