I'm still having problems building an ARM [cross] development environment.
Any ideas???
Thanks,
Jason
-----------------
This is a [resumed] list steps and problems found trying to build an ARM
development environment:
1) Built and installed Binutils v2.9.1.0.19a for RedHat Linux 5.2
(x86).
2) Applied the ARM patch, built and installed Binutils v2.9.1.0.19a to
cross develop for 'arm-linux' (ELF) (./configure -target=arm-linux
-prefix=/usr).
3) Built and installed Binutils v2.9.1.0.19a to cross develop for
'arm-linuxaout' (a.out) (./configure -target=arm-linuxaout -prefix=/usr).
4) Applied the ARM patch, built and installed EGCS 1.1.1 for RedHat
Linux 5.2 (x86)
5) Attempted to build (make cross) EGCS 1.1.1 to cross develop for
'arm-linux' (ELF). It failed with the following messages:
touch stmp-int-hdrs
echo "#error float.h values not known for cross-compiler" >
t-flat.h-cross
mv t-float.h-cross flat.h-cross
rm -f gfloat.h
cp gfloat.h include/float.h
touch stmp-headers
mv libgcc1.a libgcc1.cross || (echo You must find a way to make
libgcc1.a; false)
mv: libgcc1.a: No such file or directory
You must find a way to make libgcc1.a
make: *** [libgcc1.cross] Error 1
#
6) I fixed this problem by downloading (and expanding) the Kernel
sources for Linux v2.2.0 and doing something like this:
# cd PREFIX/arm-linux
# makdir include
# cd include
# ln -s /usr/src/linux/include/asm-arm asm
# ln -s /usr/src/linux/include/linux linux
7) Ran 'make cross" again and this time the build failed with the
following messages:
touch stmp-int-hdrs
echo "#error float.h values not known for cross-compiler" >
t-flat.h-cross
mv t-float.h-cross flat.h-cross
rm -f gfloat.h
cp gfloat.h include/float.h
touch stmp-headers
mv libgcc1.a libgcc1.cross || (echo You must find a way to make
libgcc1.a; false)
mv: libgcc1.a: No such file or directory
You must find a way to make libgcc1.a
make: *** [libgcc1.cross] Error 1
#
7) Moved to the 'gcc' subdirectory (# cd gcc), ran configure (#
./configure -target=arm-linux -prefix=/usr) and [apparently] successfully
built the 'c' compiler (# make LANGUAGES="c") and installed it (# make
LANGUAGES="c" install).
8) Returned to the 'egcs-1.1.1' directory and tried to finish building
EGCS (# make cross). The build failed with the following error messages:
checking whether the C compiler
(/home/chagas/egcs/egcs-1.1.1/gcc/xgcc -B/home/c
hagas/egcs/egcs-1.1.1/gcc/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler
cannot create
e executables.
make[1]: *** [configure-target-libiberty] Error 1
make[1]: Leaving directory `/home/chagas/egcs/egcs-1.1.1'
make: *** [cross] Error 2
9) I tested ./gcc/xgcc and it seems to be working fine. So I 'greped'
all subdiretories under '~/egcs-1.1.1' and commented out the offending code
in ./gcc/configure, ./libf2c/configure, ./libf2c/libF77/configure,
./libf2c/libI77/configure, ./libf2c/libU77/configure, ./libiberty/configure,
./texinfo/configure to prevent the error from happening.
10) Ran '~/egcc-1.1.1/make cross' again and I get the following error
messages:
make[2]: Leaving directory `/home/chagas/egcs/egcs-1.1.1/gcc'
make[2]: Entering directory
`/home/chagas/egcs/egcs-1.1.1/arm-linux/libiberty'
test x"no" != xyes || \
/home/chagas/egcs/egcs-1.1.1/gcc/xgcc
-B/home/chagas/egcs/egcs-1.1.1/gcc/ -c -
DHAVE_CONFIG_H -g -O2 -I. -I./../../include choose-temp.c -o
pic/choose-temp.o
/home/chagas/egcs/egcs-1.1.1/gcc/xgcc
-B/home/chagas/egcs/egcs-1.1.1/gcc/ -c -DH
AVE_CONFIG_H -g -O2 -I. -I./../../include choose-temp.c
choose-temp.c:40: sys/types.h: No such file or directory
choose-temp.c:41: sys/file.h: No such file or directory
choose-temp.c:50: stdio.h: No such file or directory
make[2]: *** [choose-temp.o] Error 1
make[2]: Leaving directory
`/home/chagas/egcs/egcs-1.1.1/arm-linux/libiberty'
make[1]: *** [all-target-libiberty] Error 2
make[1]: Leaving directory `/home/chagas/egcs/egcs-1.1.1'
make: *** [cross] Error 2
11) Looking into Phil Blundell's notes a see a reference to CFLAGS
definition '-Dinhibit_libc'. So I go back into the ./gcc subdirectory, add
'-Dinhibit_libc' to the Makefile, called 'make clean', called 'make
LANGUAGES="c"' and finally [successfully] 'make LANGUAGES="c" install'.
12) Next I move on to build 'glibc'. I 'untar'ed 'glibc-2.0.111', and
add-ons 'crypt' and 'linuxthreads' under 'glibc-2.0.111' subdirectory. I
first ran './configure' to attempt to build for RedHat Linux 5.2 (x86). It
failed with the following messages:
checking for __builtin_expect... no
running configure fragment for ./sysdeps/unix/sysv/linux
checking installed Linux kernel header files... 2.0.10 or later
*** You should not compile the GNU libc without the `linuxthreads'
and
*** `crypt' add-on. Not using them risks to be incompatible with
the
*** libraries of other systems. Consider getting the add-ons and
restart
*** the configuration.
*** If you really mean to avoid those add-ons run configure again,
now
*** using the extra parameter `--disable-sanity-checks'.
13) Ran './configure -enable-add-ons' to build for the x86 platform.
This time 'configure' runs successfully. 'make' also runs successfully.
However, I didn't dare to run 'make install' and run the risk of getting
hosed. Then I ran 'make clean'.
14) Successfully configured ('CC=arm-linux-gcc ./configure arm-linux
-build=i586-linux -prefix=/usr/arm-linux -enable-add-ons), built (make) and
installed (make installed) libc for arm-linux (ELF).
15) Before attempting to finish building 'egcs-1.1.1' for arm-linux
(ELF) I first blow away all the files that were under the 'egcs-1.1.1'
subdirectory to get rid of any previous modifications, the un-tar egcs
again, run configure (./configure -target=arm-linux -prefix=/usr), go under
the 'gcc' subdirectory, run configure again (./configure -target=arm-linux
-prefix=/usr), build 'gcc' ('make LANGUAGES="c"'), install it ('make
LANGUAGES="c" install'), step back to the './egcs-1.1.1' directory and run
'make cross'. These are the errors I get:
checking for unistd.h... yes
checking whether the C compiler
(/home/chagas/egcs/egcs-1.1.1/gcc/xgcc -B/home/c
hagas/egcs/egcs-1.1.1/gcc/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler
cannot creat
e executables.
make[1]: *** [configure-target-libiberty] Error 1
make[1]: Leaving directory `/home/chagas/egcs/egcs-1.1.1'
make: *** [cross] Error 2
16) I ran './gcc/xgcc -dumpmachine' and it returns 'arm-linux' as
expected ('gcc -dumpmachine' returns 'i686-pc-linux-gnu'). However, when I
try to cross compile a "Hello World" application the arm-linux compiler
returns with the following error message:
# ./egcs/egcs-1.1.1/gcc/xgcc -o helloarm hello.c
/usr/arm-linux/lib/crt1.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
#
17) I also tried cross compiling for 'arm-linux' defining 'CC=arm-linux-gcc'
but it builds for x86 instead:
# CC=arm-linux-gcc gcc -o helloarm hello.c
# ./helloarm
Hello World!
#
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]