Painful newbie questions...
Chan Shih-Ping Richard
cshihpin@dso.org.sg
Sat Apr 1 00:00:00 GMT 2000
Folks, hope you don't mind some painful newbie
questions about building cross gcc for embedded systems.
Can you folks clarify the steps about building cross gcc for
bare targets, i.e., no OS, headers or libaries.
I will contrast this experience with building a cross-gcc
for a full target (OS with headers and libraries).
Host is i686-linux-pc-gnu.
Hypothetically, say I have a bare system with
arm and Angel-type monitor. For contrast
let's say I also want to build a cross gcc for
a full target like sparc-sun-solaris2.7.
1) Build binutils
For Solaris would do
configure --target=sparc-sun-solaris2.7
For bare arm system would do
configure --target=arm-elf
These steps will typically both succeed.
(BTW: How do cross-lds determine whether
to output relocatable (a.out/coff/elf) binaries
or absolute (ROMable) binaries?
Is the magic purely in the ld scripts?
I.e., can a single cross-ld binary output
both relocatable binaries and absolute binaries
just based on different script files?)
2) Build cross gcc for bare target - HOW?
For a *full* target I think I know how to do this.
I can ./configure with --with-lib or --with-headers
or I can copy over all the target headers, libraries,
to ${prefix}/${target}/include,lib. This method
uses the target OS headers and standard libraries.
For a bare system what would you do at *this stage*???
given that there are no target headers and libraries
to prepare on the host system. Do you just ignore this step?
If I ignore this step, the build dies at choose-temp.c.
Obviously, there are no include files to compile with.
build1/gcc/xgcc -Bbuild1/gcc/
-B/usr/test//arm-elf/bin/ -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../../src/libiberty/.
./include ../../../src/libiberty/choose-temp.c
../../../src/libiberty/choose-temp.c:29: stdio.h: No such file or
directory
../../../src/libiberty/choose-temp.c:30: sys/types.h: No such file or
directory
../../../src/libiberty/choose-temp.c:32: unistd.h: No such file or
directory
../../../src/libiberty/choose-temp.c:35: stdlib.h: No such file or
directory
../../../src/libiberty/choose-temp.c:38: sys/file.h: No such file or
directory
make[1]: *** [choose-temp.o] Error 1
make[1]: Leaving directory
`/home1/cshihpin/src/gnu-toolchain/build1/arm-elf/libiberty'
make: *** [all-target-libiberty] Error 2
--
Chan Shih-Ping (Richard) <cshihpin@dso.org.sg>
DSO National Laboratories
20 Science Park Drive
Singapore 118230
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list