Re: building native cross compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




../../../gcc/libgcc/../libdecnumber/decContext.c:33:43: fatal error: string.h: No such file or directory
The question now is whether you have a C library for your target system.
Please elaborate Ian - what do you mean?

A C library contains things like <stdio.h>, <string.h>, and the
associated functions like fopen, strcpy, etc.  GCC does not provide a C
library.

You've described your target in terms of processor, but not in terms of
operating system.  Some operating systems have a C library.  Some do
not.  Either way, you're going to need one if you want to write C code.
And you're going to cross-compiler your C library in order to
cross-build programs that run on your target system.
Yes, apologies - I hit the send button a little bit too fast before thinking it through. My target system is Linux, though it would come with two known variants - LFS (Linux from scratch) and Fedora. It will be used with both architectures (i586/i686 and ppc).

From what I gather by reading the INSTALL (and FAQ) files from the source archives I would need to build glibc separately, after I built binutils, use the same prefix and probably specify the "--with-headers" option as well. I take it glibc won't be relying on the GCC cross-compiler otherwise we have a chicken-and-egg scenario on our hands?

There are a couple of paragraphs from the same file which I am not sure of:

"You must first build the library (`make'), optionally check it
(`make check'), switch the include directories and then install (`make
install').  The steps must be done in this order.  Not moving the
directory before install will result in an unusable mixture of header
files from both libraries, but configuring, building, and checking the
library requires the ability to compile and run programs against the old
library."

Do I need to do this as i am building with a specific prefix and, I take it, my original system won't be affected (I won't be chrooted yet). If I do need to follow that what does the 'switch the include directories' mean?

"You may also need to reconfigure GCC to work with the new library.
The easiest way to do that is to figure out the compiler switches to
make it work again (`-Wl,--dynamic-linker=/lib/ld-linux.so.2' should
work on GNU/Linux systems) and use them to recompile gcc."

Do I need to do that too? If so, should I specify the --dynamic-linker path to "prefix/target/lib/ld-linux.so.2"?

"You can install glibc somewhere other than where you configured it
to go by setting the `install_root' variable on the command line for
`make install'.  The value of this variable is prepended to all the
paths for installation.  This is useful when setting up a chroot
environment or preparing a binary distribution.  The directory should be
specified with an absolute file name."

Same here - I assumed when specifying the prefix that will be enough (without specifying 'install_root') or is it?

Finally, in the same file there is mention that I would also need the header files for the Linux arch (presumably the target arch as I already have the host ones installed) - is that really a requirement?

Also, I take it it is not possible to build glibc at the same time I build GCC (i.e. by dropping the source tree into the GCC main tree), right?

MZ


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux