Hi Phil et al,
I've been trying to do a clean build of tools so that I can compile
Arm-Linux v2.2.2.
After running for over an hour, my GLIBC2.1 build failed with an
internal compiler error. I am using the half built ecgs1.1.1 to build
glibc so that I can finish building egcs.
Please not the following. I am using Solaris 2.5.x, and my normal
login shell is tcsh. For all my arm building I have run everything
from xterms running bash. I also set SHELL=/usr/bin/bash and
CONFIG_SHELL=/usr/bin/bash.
However, I still come up against problems when Makefiles assume
that bin/sh is actually bash, as follows: many sub makefiles explicitly
set the shell (to bin/sh) and then go and do things that bin/sh doesn't
do, like test -n ....., or echo -n ......
I have been explicitly forcing the makefile to use bash in the instances
that I have found, but I don't know whether I have caught all the
problems.
This is extremely frustrating.
I had to do this for binutils, and also for glibc.
The last case in glibc was in the csu directory where the makefile
generates the version_info.h file using an echo -n contruct.
Can something please be done in relation to this problem.
In regards my specific problem, here is the compiler error generated:
Can someone please help? I've also attached my own build log for
the whole build process on Solaris.
arm-linux-gcc gconv_conf.c -c -O -Wall -Winline -Wstrict-prototypes
-Wwrite-strings -g
-DGCONV_PATH='"/home/elph/tjl/work/sw/tools/arm-linux/lib/gconv"'
-I../include -I.
-I/a/elph/home/tjl/work/sw/tools/src/glibc-2.1-build/iconv -I..
-I../libio -I/a/elph/home/tjl/work/sw/tools/src/glibc-2.1-build
-I../sysdeps/arm/elf -I../crypt/sysdeps/unix
-I../linuxthreads/sysdeps/unix/sysv/linux
-I../linuxthreads/sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv
-I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/arm
-I../linuxthreads/sysdeps/pthread/no-cmpxchg
-I../sysdeps/unix/sysv/linux/arm -I../sysdeps/unix/sysv/linux
-I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
-I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm
-I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm/fpu
-I../sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754
-I../sysdeps/libm-ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic
-nostdinc -isystem
/home/elph/tjl/work/sw/tools/lib/gcc-lib/arm-linux/egcs-2.91.60/include
-isystem /home/elph/tjl/work/sw/kernel/linux/include -D_LIBC_REENTRANT
-include ../include/libc-symbols.h -o
/a/elph/home/tjl/work/sw/tools/src/glibc-2.1-build/iconv/gconv_conf.o
gconv_conf.c: In function `__gconv_read_conf':
gconv_conf.c:587: internal error--unrecognizable insn:
(insn 7879 7876 4902 (set (reg:QI 12 ip)
(mem:QI (plus:SI (reg:SI 12 ip)
(const_int -577)))) -1 (nil)
(nil))
../../egcs-1.1.1/gcc/toplev.c:1360: Internal compiler error in function
fatal_insn
make[2]: ***
[/a/elph/home/tjl/work/sw/tools/src/glibc-2.1-build/iconv/gconv_conf.o]
Error 1
make[2]: Leaving directory
`/a/elph/home/tjl/work/sw/tools/src/glibc-2.1/iconv'
make[1]: *** [iconv/subdir_lib] Error 2
make[1]: Leaving directory
`/a/elph/home/tjl/work/sw/tools/src/glibc-2.1'
make: *** [all] Error 2
1. Retrieved binutils: binutils-2.9.1.0.19a
2. Applied patch binutils-2.9.1.0.19a-arm-diff-981230
3. set SHELL = /usr/bin/bash
4. set CONFIG_SHELL = /usr/bin/bash
5. script to change all occurance of bin/sh to /usr/bin/bash
6. ./configure --target=arm-linux --prefix=...
7. Retrieved linux kernel v2.2.2
8. gzip -dc linux-2.2.2.tar.gz | tar xvf -
9. Retrieved patch-2.2.2-rmk5.gz from
ftp://ftp.arm.linux.org.uk/pub/armlinux/kernel-sources/v2.2/
10. Retrieved linux-2.2.2-philb-990318.gz from ftp://ftp.netwinder.org/users/p/philb/
11. Move both ungziped patches to linux directory.
12. Apply patch-2.2.2-rmk5 and linux-2.2.2-philb-990318 in order
13. Read linux/Documentation/ARM-README
14. Edit linux/Makefile to ARCH = arm and CROSS_COMPILE = path to cross compiler (eg
tools/arm-linux/bin)
15. make config
16. make dep
17. create links in tools/arm-linux/include to headers:
ln -s /home/elph/tjl/work/sw/kernel/linux/include/asm-arm asm
ln -s /home/elph/tjl/work/sw/kernel/linux/include/linux linux
18. add tools/arm-linux/bin (?) to PATH:
PATH=/home/elph/tjl/work/sw/tools/arm-linux/bin:$PATH
19. Retrieve egcs-1.1.1
20. Retrieve patch egcs-1.1.1-arm-diff-990113.gz from Phil Blundell:
21: Patch egcs:
gzip -dc egcs-1.1.1-arm-diff-990113.gz | /usr/local/bin/patch -p1
22 mkdir egcs-1.1.1-build
23 cd egcs-1.1.1-build and configure:
../egcs-1.1.1/configure --target=arm-linux
--prefix=/home/elph/tjl/work/sw/tools --with-cpu=strongarm110
24. cd gcc
25. Edit Makefile : add -Dinhibit_libc to CFLAGS (Did same for Makefile at top
level - necessary ???)
26. Make from gcc subdirectory:
make -i LANGUAGES=c
make -i LANGUAGES=c install
27. Return to tools directory
28. mkdir src, cd src
29. Retrieve glibc-2.1.tar.gz
30. Unpack:
gzip -dc ../../armlinux/glibc-2.1.tar.gz | tar xvf -
31. Retrieve glibc-crypt-2.1.tar.gz and glibc-linuxthreads-2.1.tar.gz into glibc-2.1
32. From glibc-2.1 directory, unpack:
gzip -dc glibc-crypt-2.1.tar.gz | tar xvf -
gzip -dc glibc-linuxthreads-2.1.tar.gz | tar xvf -
33. Return to src directory
34. mkdir glibc-2.1-build
35. cd glibc-2.1-build
36. Configure with --with-headers (Don't know if correct):
CC=arm-linux-gcc ../glibc-2.1/configure arm-linux --build=i586-linux
--prefix=/home/elph/tjl/work/sw/tools/arm-linux --enable-add-ons
--with-headers=/home/elph/tjl/work/sw/kernel/linux/include
37. Theoretically run make at this stage. However, it falls over because sub-makefiles
are reverting to /bin/sh for some unknown reason, and the Makefile in the
glibc-2.1/csu directory uses an echo -n "....." construct which fails under /bin/sh.
Fix at the moment was to add SHELL=/usr/bin/bash to top of csu Makefile.
38. make.