A couple of observations: you don't have to build and install the
latest
binutils, egcs and glibc as your native tools on the x86 to build
the
cross-tools. (If you just want to , that is fine. But why compilcate
life ?)
Mine worked perfectly fine on a Redhat 5.1 default native toolchain.
(Actually,
it might be a better idea to use the defailt, older toolchain for
native
stuff.)
You're right. I think what happened was that an earlier attempt to run GLIBC
"./configure" failed because I didn't call it with "CC=arm-linux-gcc". So I
got back a message saying the compiling tools were too old. I guess it would
have been if it was compiling for x86. I'm attaching my recorded list of
steps to get the ARM cross build going so you can see what happened. Actualy
this list should be a lot longer if I were to list every single detail.
Jason
-------------
Odyssey for Building an ARM Development Environment:
1) UnTARed 'binutils', applied patch and './configure
--target=arm-linux --prefix=/usr/local/arm', 'make' and 'make install'.
2) Added '/usr/local/arm/bin' to the path.
3) Expanded Linux v2.2.0 under '/home/chagas/linux-2.2.0', created
'/usr/local/arm/arm-linux/include' directory and created simbolic 'asm' and
'linux' simbolic links.
4) UnTARed 'egcs 1.1.1', applied patch and './configure
--target=arm-linux --prefix=/usr/local/arm'.
5) Modified 'Makefile' to add -Dinhibit_libc in CFLAGS
6) Ran 'make -i LANGUAGES=c'
7) Ran 'make -i LANGUAGES=c install'
8) Create '/usr/local/arm/glibc/arm-linux-glibc' subdirectory to take
the libs.
9) UnTARed 'glibc' and "add ons".
10) Ran ./configure --target=arm-linux
--prefix=/usr/local/arm/glibc/arm-linux-glibc -enable-add-ons. 'configure'
complained about old versions of 'gcc' installed by RedHat v5.2.
11) Installed latest 'binutils' and 'egcs' for x86.
12) Ran glibc's './configure --target=arm-linux
--prefix=/usr/local/arm/glibc/arm-linux-glibc -enable-add-ons' again. It
ran successfully this time.
13) Ran 'make' and 'make install' successfully.
14) Went back to 'egcs' and ran './configure --target=arm-linux
--prefix=/usr/local/arm
--with-headers=/usr/local/arm/glibc/arm-linux-glibc/include
--with-libs=/usr/local/arm/glibc/arm-linux-glibc/lib'. It returned the
following errors:
Created "Makefile" in /home/chagas/egcs/egcs-1.1.1 using "mt-frag"
conftest.c:0: malformed option `-D inhibit-libc'
*** The command 'gcc -o conftest -g -O2 -Dinhibit-libc conftest.c'
failed.
*** You must set the environment variable CC to a working compiler.
15) Edited 'Makefile' and removed reference to '-Dinhibit_libc'.
16) Ran './configure --target=arm-linux --prefix=/usr/local/arm
--with-headers=/usr/local/arm/glibc/arm-linux-glibc/include
--with-libs=/usr/local/arm/glibc/arm-linux-glibc/lib' again.
17) Ran 'make LANGUAGES="c c++" and got the following errors:
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 executables.
make: *** [configure-target-libiberty] Error 1
18) However, 'xgcc' seems to work fine:
#./xgcc -v
Reading specs from
/usr/local/arm/lib/gcc-lib/arm-linux/egcs-2.91.60/specs
gcc version egcs-2.91.60 19990113/philb (egcs-1.1.1 release)
19) However, 'glibc' was built for x86 instead of ARM. So I go back to
'glibc', ran "# CC=arm-linux-gcc ./configure arm-linux
--build=i686-pc-linux-gnu --prefix=/usr/local/arm/glibc/arm-linux-glibc
-enable-add-ons --with-headers=/usr/src/linux-2.0.36/include", make and
"make install". Note "-with-headers" switch point to the x86 kernel headers
currently installed the system.
20) It complained the kernel headers were too old. So I unTARed the
kernel v2.2.0, applied the ARM patch, fixed the Makefile with "ARCH := arm"
and "CROSS_COMPILE = /usr/local/arm/bin/arm-linux-". Then ran "make config"
followed by "make zImage". I verified if the headers were created.
21) Ran "CC=arm-linux-gcc ./configure arm-linux
--build=i686-pc-linux-gnu --prefix=/usr/local/arm/glibc/arm-linux-glibc
-enable-add-ons --with-headers=/home/chagas/linux-2.2.0/linux/include". Note
the headers now point to the right place. Also ran "make" and "make install"
successfully.
22) At this point I was able to cross compile and link a "Hello world"
application after copying contents of
"/usr/local/arm/glibc/arm-linux-glibc/lib" to "/usr/local/arm/arm-linux/lib"
23) I went back to 'egcs' and ran "#./configure --target=arm-linux
--prefix=/usr/local/arm
--with-headers=/usr/local/arm/glibc/arm-linux-glibc/include
--with-libs=/usr/local/arm/glibc/arm-linux-glibc/lib" followed by "make
LANGUAGES="c c++". I noticed the 'glibc' library files got copied when
running 'configure'. These are some of the errors returned:
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h: In function
`fmodl':
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h:365: unknown
register nam
e `ax' in `asm'
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h: In function
`pow':
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h:376: unknown
register nam
e `st(1)' in `asm'
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h: In function
`powf':
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h:376: unknown
register nam
e `st(1)' in `asm'
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h: In function
`powl':
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h:376: unknown
register nam
e `st(1)' in `asm'
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h: In function
`floatformat
_to_double':
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h:495:
inconsistent operand
constraints in an `asm'
/usr/local/arm/arm-linux/sys-include/bits/mathinline.h:495:
inconsistent operand
constraints in an `asm'
make[1]: *** [floatformat.o] Error 1
make[1]: Leaving directory
`/home/chagas/egcs/egcs-1.1.1/arm-linux/libiberty'
make: *** [all-target-libiberty] Error 2
24) Aparently, things were in a unknown state. So I removed everything
(binutils, egcs and glibc) and re-started all the steps from scratch again.
This time I was successful building everything including the EGCS C++
compiler.
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]