On Fri, 07 May 2010 07:53:05 -0700, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: > <chandrakumar@xxxxxxxxxxxxxxx> writes: > >> I am building a native compiler with sources gcc-2.95.3, binutils-2.10.1 >> and glibc-2.2.5. > > You know that these are all very old versions, right? You are pretty > much on your own when it comes to debugging these. You are most > likely running into problems which were fixed long ago. > > >> Note: Versions of gcc and binutils used to do the above steps are >> gcc-4.4.1 and binutils-2.20 > > Ah, so you do know. > > >> /home/ckumar/ck/gcc295_installation/glibc_build/csu/init-first.o >> gcc: Internal compiler error: program as got fatal signal 11 > >> Please provide me some lead in solving this. > > Run the compilation command with the --save-temps -v option to save > the assembler input file and see precisely how the assembler is being > run. Then start up the debugger and find out what happened. > > >> gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.10.1/gas -I. -D_GNU_SOURCE -I. >> -I../../binutils-2.10.1/gas -I../bfd -I../../binutils-2.10.1/gas/config >> -I../../binutils-2.10.1/gas/../include -I../../binutils-2.10.1/gas/.. >> -I../../binutils-2.10.1/gas/../bfd -I../../binutils-2.10.1/gas/../intl >> -I../intl -DLOCALEDIR="\"/usr/local/gcc2953_install//share/locale\"" >> -O2 >> -U_FORTIFY_SOURCE -c ../../binutils-2.10.1/gas/app.c >> In file included from ./targ-cpu.h:1, >> from ../../binutils-2.10.1/gas/config/obj-elf.h:40, >> from ./obj-format.h:1, >> from ../../binutils-2.10.1/gas/config/te-linux.h:4, >> from ./targ-env.h:1, >> from ../../binutils-2.10.1/gas/as.h:620, >> from ../../binutils-2.10.1/gas/app.c:29: >> ../../binutils-2.10.1/gas/config/tc-i386.h:441: error: array type has >> incomplete element type >> make[3]: *** [app.o] Error 1 >> make[3]: Leaving directory >> `/home/ckumar/ck/gcc295_installation/binutils_build/gas' >> make[2]: *** [all-recursive] Error 1 >> make[2]: Leaving directory >> `/home/ckumar/ck/gcc295_installation/binutils_build/gas' >> make[1]: *** [all-recursive-am] Error 2 >> make[1]: Leaving directory >> `/home/ckumar/ck/gcc295_installation/binutils_build/gas' >> make: *** [all-gas] Error 2 >> --snip end-- >> >> Modified md_relax_table[] to *md_relax_table in files tc-i386.h and >> tc-i386.c. > > That doesn't sound right to me. At least in current binutils sources, > the array type is defined in as.h. After making this change, did you > try running the assembler testsuite, via make check-gas? > No, I didn't. I did now and there are 5 failures as shown below: --snip start-- Running /home/ckumar/ck/gcc295_installation/binutils-2.10.1/gas/testsuite/gas/i386/i386.exp ... FAIL: i386 general FAIL: i386 opcode FAIL: i386 intel FAIL: i386 jump FAIL: i386 jump16 ... ... === gas Summary === # of expected passes 72 # of unexpected failures 5 ../as-new 2.10.1 --snip end-- I checked with the current binutils sources for the array type defined in as.h. In binutils-2.10.1, that definition was moved into tc.h. I included the definition in as.h of binutils-2.10.1 and built the binutils-2.10.1. The build is successful. On running the assembler testsuites via make check-gas: --snip start-- === gas Summary === # of expected passes 77 ../as-new 2.10.1 --snip end-- Now, I started the build of glibc-2.2.5 with the installed binutils-2.10.1 and gcc-2.95.3. The phenomenon I said earlier (gcc: Internal compiler error: program as got fatal signal 11) is not observed. But instead I got the problem of "*** buffer overflow detected ***: /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar terminated" as shown below: --snip start-- ... ... ... a - login/utmpxname.os a - login/updwtmpx.os a - login/getutmpx.os a - login/getutmp.os a - elf/dl-open.os a - elf/dl-close.os a - elf/dl-iteratephdr.os a - elf/dl-addr.os a - elf/dl-profstub.os a - elf/dl-origin.os a - elf/dl-libc.os a - elf/dl-sym.os a - elf/unwind-dw2-fde-glibc.os a - elf/framestate.os *** buffer overflow detected ***: /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar terminated ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0x4010ede8] /lib/tls/i686/cmov/libc.so.6[0x4010de20] /lib/tls/i686/cmov/libc.so.6[0x4010d558] /lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0x9e)[0x4009759e] /lib/tls/i686/cmov/libc.so.6(_IO_padn+0xd8)[0x4008b048] /lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0x2b0e)[0x4006d64e] /lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xad)[0x4010d60d] /lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0x4010d54d] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x804fdc5] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x804e13b] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x80508be] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x8052e32] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x804b77c] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x804c267] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x40044b56] /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar[0x8049721] ======= Memory map: ======== 08048000-08089000 r-xp 00000000 08:01 1711 /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar 08089000-0808a000 r--p 00040000 08:01 1711 /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar 0808a000-0808b000 rw-p 00041000 08:01 1711 /usr/local/gcc2953_install/i686-pc-linux-gnu/bin/ar 0957f000-09cfc000 rw-p 00000000 00:00 0 [heap] 40000000-4001b000 r-xp 00000000 08:01 921 /lib/ld-2.10.1.so 4001b000-4001c000 r--p 0001a000 08:01 921 /lib/ld-2.10.1.so 4001c000-4001d000 rw-p 0001b000 08:01 921 /lib/ld-2.10.1.so 4001d000-4001e000 r-xp 00000000 00:00 0 [vdso] 4001e000-40020000 rw-p 00000000 00:00 0 40020000-40021000 r--p 00000000 08:01 135873 /usr/lib/locale/en_IN/LC_MESSAGES/SYS_LC_MESSAGES 40021000-4002c000 rw-p 00000000 00:00 0 4002e000-4016c000 r-xp 00000000 08:01 1917 /lib/tls/i686/cmov/libc-2.10.1.so 4016c000-4016e000 r--p 0013e000 08:01 1917 /lib/tls/i686/cmov/libc-2.10.1.so 4016e000-4016f000 rw-p 00140000 08:01 1917 /lib/tls/i686/cmov/libc-2.10.1.so 4016f000-40173000 rw-p 00000000 00:00 0 40181000-4019d000 r-xp 00000000 08:01 971 /lib/libgcc_s.so.1 4019d000-4019e000 r--p 0001b000 08:01 971 /lib/libgcc_s.so.1 4019e000-4019f000 rw-p 0001c000 08:01 971 /lib/libgcc_s.so.1 bfc3e000-bfc59000 rw-p 00000000 00:00 0 [stack] Aborted make[2]: *** [/home/ckumar/ck/gcc295_installation/glibc_build/libc_pic.a] Error 134 make[2]: Leaving directory `/home/ckumar/ck/gcc295_installation/glibc-2.2.5/elf' make[1]: *** [elf/subdir_lib] Error 2 make[1]: Leaving directory `/home/ckumar/ck/gcc295_installation/glibc-2.2.5' make: *** [all] Error 2 --snip end--