From: jcburt@gatsibm.larc.nasa.gov
Subject: Problems building gcc 2.1 on RS/6000
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 13 Apr 1992 07:35:51 GMT

I pulled a copy of gcc-2.1.tar.Z from prep.ai.mit.edu on 
april 7, 1991. I'm trying to install it on an IBM RS/6000 running
AIX version 3.1.5. I had IBM send me the "fixed" assembler
as recommended in the file README-RS6000. I ran 
"configure rs6000-ibm-aix" which produced the following output:

>gatsibm:~/xfer/unix/gcc-2.1>configure rs6000-ibm-aix
>Linked `config.h' to `.//config/xm-rs6000.h'
>Linked `tm.h' to `.//config/rs6000.h'
>Linked `md' to `.//config/rs6000.md'
>Linked `aux-output.c' to `.//config/rs6000.c'
>Linked `tconfig.h' to `.//config/xm-rs6000.h'
>Merged x-rs6000.
>Merged t-rs6000.
>Created `Makefile'.
>Links are now set up for target rs6000-ibm-aix.
>

 I then tried "make LANGUAGES=c" which produced

>	cc    -g     -I. -I./ -I.//config \
>		  -DGCC_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/rs6000/`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' .//version.c`/include\" \
>		  -DGPLUSPLUS_INCLUDE_DIR=\"/usr/local/lib/g++-include\" \
>		  -DLOCAL_INCLUDE_DIR=\"/usr/local/include\" \
>		  -DCROSS_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/rs6000/`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' .//version.c`/sys-include\" \
>		  -c `echo .//cccp.c | sed 's,^\./,,'`
>xlc: 1501-228 input file /cccp.c not found
>1254-004  The error code from the last failed command is -4.
>
>Make Quitting.
>

 I edited Makefile and changed the line "srcdir=./" to "srcdir=."
and reran the make command which produced:

>	cc    -g     -I. -I. -I./config \
>		  -DGCC_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/rs6000/`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' ./version.c`/include\" \
>		  -DGPLUSPLUS_INCLUDE_DIR=\"/usr/local/lib/g++-include\" \
>		  -DLOCAL_INCLUDE_DIR=\"/usr/local/include\" \
>		  -DCROSS_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/rs6000/`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' ./version.c`/sys-include\" \
>		  -c `echo ./cccp.c | sed 's,^\./,,'`
>	cc    -g     -I. -I. -I./config -c ./cexp.c
>	cc -c    -g     -I. -I. -I./config version.c
>	cc -c    -g     -I. -I. -I./config obstack.c
>	cc    -g     -I. -I. -I./config -c \
>		  `echo ./alloca.c | sed 's,^\./,,'`
>	rm alloca.s
>rm: 0653-601 File alloca.s does not exist.
>1254-005  The error code from the last failed command is 2.
>	This value will be ignored.
>	cc    -g   -o cccp cccp.o cexp.o version.o obstack.o ` case "cc" in "cc") echo alloca.o ;; esac `  -lm -lld
>	rm -f cpp
>	ln cccp cpp
>	cc    -g     -I. -I. -I./config -c ./c-parse.c
>	cc -c    -g     -I. -I. -I./config c-lang.c
>	cc -c    -g     -I. -I. -I./config c-lex.c
>	cc -c    -g     -I. -I. -I./config c-decl.c
>	cc -c    -g     -I. -I. -I./config c-typeck.c
>	cc -c    -g     -I. -I. -I./config c-convert.c
>	cc -c    -g     -I. -I. -I./config c-aux-info.c
>	cc -c    -g     -I. -I. -I./config c-common.c
>	cc -c    -g     -I. -I. -I./config ./genattr.c
>	cc -c    -g     -I. -I. -I./config rtl.c
>	cc    -g   -o genattr \
>		 genattr.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genattr md > tmp-attr.h
>	./move-if-change tmp-attr.h insn-attr.h
>	touch stamp-attr
>	cc -c    -g     -I. -I. -I./config toplev.c
>	cc -c    -g     -I. -I. -I./config tree.c
>	cc -c    -g     -I. -I. -I./config print-tree.c
>	cc -c    -g     -I. -I. -I./config stor-layout.c
>	cc -c    -g     -I. -I. -I./config fold-const.c
>	cc -c    -g     -I. -I. -I./config ./genflags.c
>	cc    -g   -o genflags \
>		 genflags.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genflags md > tmp-flags.h
>	./move-if-change tmp-flags.h insn-flags.h
>	touch stamp-flags
>	cc -c    -g     -I. -I. -I./config ./gencodes.c
>	cc    -g   -o gencodes \
>		 gencodes.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./gencodes md > tmp-codes.h
>	./move-if-change tmp-codes.h insn-codes.h
>	touch stamp-codes
>	cc -c    -g     -I. -I. -I./config ./genconfig.c
>	cc    -g   -o genconfig \
>		  genconfig.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genconfig md > tmp-config.h
>	./move-if-change tmp-config.h insn-config.h
>	touch stamp-config
>	cc -c    -g     -I. -I. -I./config function.c
>	cc -c    -g     -I. -I. -I./config stmt.c
>	cc -c    -g     -I. -I. -I./config expr.c
>	cc -c    -g     -I. -I. -I./config calls.c
>	cc -c    -g     -I. -I. -I./config expmed.c
>	cc -c    -g     -I. -I. -I./config explow.c
>	cc -c    -g     -I. -I. -I./config optabs.c
>	cc -c    -g     -I. -I. -I./config varasm.c
>	cc -c    -g     -I. -I. -I./config print-rtl.c
>	cc -c    -g     -I. -I. -I./config rtlanal.c
>	cc -c    -g     -I. -I. -I./config emit-rtl.c
>	cc -c    -g     -I. -I. -I./config dbxout.c
>	cc -c    -g     -I. -I. -I./config sdbout.c
>	cc -c    -g     -I. -I. -I./config dwarfout.c
>	cc -c    -g     -I. -I. -I./config xcoffout.c
>	cc -c    -g     -I. -I. -I./config integrate.c
>	cc -c    -g     -I. -I. -I./config jump.c
>	cc -c    -g     -I. -I. -I./config cse.c
>	cc -c    -g     -I. -I. -I./config loop.c
>	cc -c    -g     -I. -I. -I./config unroll.c
>	cc -c    -g     -I. -I. -I./config flow.c
>	cc -c    -g     -I. -I. -I./config stupid.c
>	cc -c    -g     -I. -I. -I./config combine.c
>	cc -c    -g     -I. -I. -I./config regclass.c
>      247 |           p = &reg_class_superclasses[i][0];
>            ............a...............................
>a - 1506-152: (W) Operands are pointers to different types.
>      251 |           p = &reg_class_subclasses[j][0];
>            ............a.............................
>a - 1506-152: (W) Operands are pointers to different types.
>	cc -c    -g     -I. -I. -I./config local-alloc.c
>	cc -c    -g     -I. -I. -I./config global-alloc.c
>	cc -c    -g     -I. -I. -I./config reload.c
>	cc -c    -g     -I. -I. -I./config reload1.c
>	cc -c    -g     -I. -I. -I./config caller-save.c
>	cc -c    -g     -I. -I. -I./config ./genpeep.c
>	cc    -g   -o genpeep \
>		 genpeep.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genpeep md > tmp-peep.c
>	./move-if-change tmp-peep.c insn-peep.c
>	touch stamp-peep
>	cc    -g     -I. -I. -I./config -c insn-peep.c
>	cc -c    -g     -I. -I. -I./config reorg.c
>	cc -c    -g     -I. -I. -I./config sched.c
>	cc -c    -g     -I. -I. -I./config final.c
>	cc -c    -g     -I. -I. -I./config recog.c
>	cc -c    -g     -I. -I. -I./config reg-stack.c
>	cc -c    -g     -I. -I. -I./config ./genrecog.c
>	cc    -g   -o genrecog \
>		 genrecog.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genrecog md > tmp-recog.c
>	./move-if-change tmp-recog.c insn-recog.c
>	touch stamp-recog
>	cc    -g     -I. -I. -I./config -c insn-recog.c
>	cc -c    -g     -I. -I. -I./config ./genextract.c
>	cc    -g   -o genextract \
>		 genextract.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genextract md > tmp-extract.c
>	./move-if-change tmp-extract.c insn-extract.c
>	touch stamp-extract
>	cc    -g     -I. -I. -I./config -c insn-extract.c
>	cc -c    -g     -I. -I. -I./config ./genoutput.c
>	cc    -g   -o genoutput \
>		 genoutput.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genoutput md > tmp-output.c
>	./move-if-change tmp-output.c insn-output.c
>	touch stamp-output
>	cc    -g     -I. -I. -I./config -c insn-output.c
>	cc -c    -g     -I. -I. -I./config ./genemit.c
>	cc    -g   -o genemit \
>		 genemit.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genemit md > tmp-emit.c
>	./move-if-change tmp-emit.c insn-emit.c
>	touch stamp-emit
>	cc    -g     -I. -I. -I./config -c insn-emit.c
>	cc -c    -g     -I. -I. -I./config ./genattrtab.c
>	cc    -g   -o genattrtab \
>		 genattrtab.o rtl.o rtlanal.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "cc"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `   	    -lm -lld
>	./genattrtab md > tmp-attrtab.c
>	./move-if-change tmp-attrtab.c insn-attrtab.c
>	touch stamp-attrtab
>	cc    -g     -I. -I. -I./config -c insn-attrtab.c
>	cc -c    -g     -I. -I. -I./config aux-output.c
>	cc -c    -g     -I. -I. -I./config getpwd.c
>	cc    -g   -o cc1 c-parse.o c-lang.o     c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o   function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o   rtl.o print-rtl.o rtlanal.o emit-rtl.o   dbxout.o sdbout.o dwarfout.o xcoffout.o   integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o   regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o   insn-peep.o reorg.o sched.o final.o re
cog.o reg-stack.o   insn-recog.o insn-extract.o insn-output.o insn-emit.o   insn-attrtab.o aux-output.o getpwd.o  obstack.o ` case "cc" in "cc") echo alloca.o ;; esac `  -lm -lld
>	cc    -g     -I. -I. -I./config \
>	  -DSTANDARD_STARTFILE_PREFIX=\"/usr/local/lib/\" \
>	  -DSTANDARD_BIN_PREFIX=\"/usr/local/bin/\" \
>	  -DSTANDARD_EXEC_PREFIX=\"/usr/local/lib/gcc-lib/\" \
>	  -DDEFAULT_TARGET_MACHINE=\"rs6000\" \
>	  -c `echo ./collect2.c | sed 's,^\./,,'`
>	cc    -g   -o collect2 collect2.o version.o obstack.o ` case "cc" in "cc") echo alloca.o ;; esac `  -lm -lld
>	rm -f ld
>	ln collect2 ld
>	cc    -g     -I. -I. -I./config \
>	  -DSTANDARD_STARTFILE_PREFIX=\"/usr/local/lib/\" \
>	  -DSTANDARD_EXEC_PREFIX=\"/usr/local/lib/gcc-lib/\" \
>	  -DDEFAULT_TARGET_MACHINE=\"rs6000\" \
>	  -c `echo ./gcc.c | sed 's,^\./,,'`
>	cc    -g   -o gccnew gcc.o version.o obstack.o ` case "cc" in "cc") echo alloca.o ;; esac `  -lm -lld
>	mv -f gccnew gcc
>	./gcc -dumpspecs > specs
>	rm -f tmplibgcc1.a
>	set -e; \
>		for name in _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3     _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3     _divdf3 _muldf3 _negdf2 _adddf3 _subdf3     _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2     _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3     _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2     _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2; \
>		do \
>		  echo ${name}; \
>		  rm -f ${name}.o; \
>		  cc -O -I. -I. -I./config -c -DL${name} ./libgcc1.c; \
>		  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		  mv libgcc1.o ${name}.o; \
>		  ar qc tmplibgcc1.a ${name}.o; \
>		  rm -f ${name}.o; \
>		done
>_mulsi3
>_udivsi3
>_divsi3
>_umodsi3
>_modsi3
>_lshrsi3
>_lshlsi3
>_ashrsi3
>_ashlsi3
>_divdf3
>_muldf3
>_negdf2
>_adddf3
>_subdf3
>_fixdfsi
>_fixsfsi
>_floatsidf
>_floatsisf
>_truncdfsf2
>_extendsfdf2
>_addsf3
>_negsf2
>_subsf3
>_mulsf3
>_divsf3
>_eqdf2
>_nedf2
>_gtdf2
>_gedf2
>_ltdf2
>_ledf2
>_eqsf2
>_nesf2
>_gtsf2
>_gesf2
>_ltsf2
>_lesf2
>	for file in .. ; \
>		do \
>		  if [ x${file} != x.. ]; then \
>		    name=`echo ${file} | sed -e 's/[.]c$//' -e 's/[.]asm$//'`; \
>		    echo ${name}; \
>		    if [ ${name}.asm = ${file} ]; then \
>		      cp ${file} ${name}.s; file=${name}.s; \
>		      if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		    else true; fi; \
>		    cc -O -I. -I. -I./config -c ${file}; \
>		    if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		    ar qc tmplibgcc1.a ${name}.o; \
>		    if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		    rm -f ${name}.[so]; \
>		  else true; \
>		  fi; \
>		done
>	mv tmplibgcc1.a libgcc1.a
>	if [ -f libgcc2.ready ] ; then \
>			true; \
>		else \
>			touch libgcc2.ready; \
>		fi
>	rm -f tmplibgcc2.a
>	set -e; \
>		for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2       _lshrdi3 _lshldi3 _ashldi3 _ashrdi3       _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf      _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi      _varargs _eprintf _builtin_new _builtin_New _builtin_del      _bb _shtab _clear_cache _trampoline __main _exit; \
>		do \
>		  echo ${name}; \
>		  ./gcc -O2    -g -B./ -g1 -I. -I. -I./config -c -DL${name} \
>		      ./libgcc2.c -o ${name}.o; \
>		  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		  ar rc tmplibgcc2.a ${name}.o; \
>		  rm -f ${name}.o; \
>		done
>_muldi3
>_divdi3
>_moddi3
>_udivdi3
>_umoddi3
>_negdi2
>_lshrdi3
>_lshldi3
>_ashldi3
>_ashrdi3
>_udivmoddi4
>_cmpdi2
>_ucmpdi2
>_floatdidf
>_floatdisf
>_fixunsdfsi
>_fixunssfsi
>_fixunsdfdi
>_fixdfdi
>_fixunssfdi
>_fixsfdi
>_varargs
>_eprintf
>_builtin_new
>_builtin_New
>_builtin_del
>_bb
>_shtab
>_clear_cache
>_trampoline
>__main
>_exit
>	for file in .. ; \
>		do \
>		  if [ x${file} != x.. ]; then \
>		    name=`echo ${file} | sed -e 's/[.]c$//' -e 's/[.]asm$//'`; \
>		    echo ${name}; \
>		    if [ ${name}.asm = ${file} ]; then \
>		      cp ${file} ${name}.s; file=${name}.s; \
>		      if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		    else true; fi; \
>		    ./gcc -O2    -g -B./ -g1 -I. -I. -I./config -c ${file}; \
>		    if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>		    ar rc tmplibgcc2.a ${name}.o; \
>		    rm -f ${name}.[so]; \
>		  else true; \
>		  fi; \
>		done
>	mv tmplibgcc2.a libgcc2.a
>	rm -rf tmplibgcc.a libgcc.a tmpcopy
>	mkdir tmpcopy
>	if [ xlibgcc1.a != x ];			\
>		then (cd tmpcopy; ar x ../libgcc1.a);	\
>		else true;					\
>		fi
>	(cd tmpcopy; ar x ../libgcc2.a)
>	(cd tmpcopy; ar rc ../tmplibgcc.a *.o)
>	rm -rf tmpcopy
>	if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then ranlib tmplibgcc.a; else true; fi
>	mv tmplibgcc.a libgcc.a
>	cp ./enquire.c . > /dev/null 2>&1
>1254-005  The error code from the last failed command is 2.
>	This value will be ignored.
>	./gcc    -g -B./    -DNO_SC -DNO_MEM -DNO_STDDEF -O0 -I. -c enquire.c
>	./gcc    -g -B./  enquire.o -o enquire
>0654-208 nm: p is not a recognized flag.
>	./enquire -f > tmp-float.h
>	mv tmp-float.h float.h
>

 As per the INSTALL file instructions I then tried "make stage1" which produced:

>	if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
>	mv *.o insn-flags.h insn-config.h insn-codes.h   insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c   insn-attr.h insn-attrtab.c   stamp-flags stamp-config stamp-codes   stamp-output stamp-recog stamp-emit stamp-extract stamp-peep   stamp-attr stamp-attrtab   genemit genoutput genrecog genextract genflags gencodes genconfig genpeep   genattrtab genattr   gcc cc1 cpp   gcc-cross cccp cc1plus cc1obj enquire   protoize unprotoize specs collect2 stage1
>mv: cannot access gcc-cross
>mv: cannot access cc1plus
>mv: cannot access cc1obj
>mv: cannot access protoize
>mv: cannot access unprotoize
>1254-005  The error code from the last failed command is 1.
>	This value will be ignored.
>	rm -f stage1/libgcc.a
>	cp libgcc.a stage1
>	if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then ranlib stage1/libgcc.a; else true; fi
>

 As per the INSTALL file instructions I then tried "make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
which produced the following:

>	stage1/gcc    -g -O -Bstage1/     -I. -I. -I./config \
>		  -DGCC_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/rs6000/`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' ./version.c`/include\" \
>		  -DGPLUSPLUS_INCLUDE_DIR=\"/usr/local/lib/g++-include\" \
>		  -DLOCAL_INCLUDE_DIR=\"/usr/local/include\" \
>		  -DCROSS_INCLUDE_DIR=\"/usr/local/lib/gcc-lib/rs6000/`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' ./version.c`/sys-include\" \
>		  -c `echo ./cccp.c | sed 's,^\./,,'`
>	stage1/gcc    -g -O -Bstage1/     -I. -I. -I./config -c ./cexp.c
>	stage1/gcc -c    -g -O -Bstage1/     -I. -I. -I./config version.c
>	stage1/gcc -c    -g -O -Bstage1/     -I. -I. -I./config obstack.c
>	stage1/gcc    -g -O -Bstage1/     -I. -I. -I./config -c \
>		  `echo ./alloca.c | sed 's,^\./,,'`
>	rm alloca.s
>rm: 0653-601 File alloca.s does not exist.
>1254-005  The error code from the last failed command is 2.
>	This value will be ignored.
>	stage1/gcc    -g -O -Bstage1/   -o cccp cccp.o cexp.o version.o obstack.o ` case "stage1/gcc" in "cc") echo alloca.o ;; esac `  -lm -lld
>stage1/gcc: Internal compiler error: program ld got fatal signal 11
>1254-004  The error code from the last failed command is 1.
>
>Make Quitting.
>
>


Okay, what am I doing wrong? what other info can I provide you? HELP!!!!


John

+--------------------------------------------------------------------+
| John Burton                                                        |
| G & A Technical Software                                           |
| jcburt@gatsibm.larc.nasa.gov                                       |
| jcburt@cs.wm.edu                                                   |
|                                                                    |
| Disclaimer: Hey, what can I say...These are *my* views, not those  |
|             of anyone else, be they employer, school, or government|
+--------------------------------------------------------------------+