Trouble building Linux host mips target binutils

"Scott C. Karlin" (scott@cs.princeton.edu)
Thu, 29 Apr 1999 15:46:19 -0400


thunder7@xs4all.nl writes:
> 
> On Thu, Apr 29, 1999 at 10:53:58AM -0400, Scott C. Karlin wrote:
> > While following the guidelines of the CrossGCC FAQ
> > (version 0.9.1 dated 11/12/98), I ran across an internal
> > gcc error.  Here are the commands which led to the error:
> > 
> > ### Here is the command which generates the error
> > 
> > gcc -g -O2 .....
> >
> > gcc: Internal compiler error: program ld got fatal signal 11
> There is a sig-11 howto, which goes on to suggest this is probably a
> hardware failure - dodgy ram, dodgy motherboard,
> overheating/overclocking, something like that. Can you compile kernels
> without problems?

Ah.  Thanks.  I'll report this to the sysadm for the system.

I switched to a different machine and can now compile binutils.
However, I now get stuck in the GCC build when it wants to invoke the
assembler to build libgcc2.a.  Referring to the FAQ (thanks, Scott
Howard!), section 5.3 -  "Assembler errors while building GCC's enquire
or libgcc.a" suggests that GCC can't find the correct assembler.
This seems reasonable given the last bit of output from the build:

make GCC_FOR_TARGET="./xgcc -B./" \
  AR="/u/scott/CrossGCC/Install/mips-any-elf/bin/ar" AR_FLAGS="rc" CC="gcc" CFLAGS="-g" \
  HOST_PREFIX="" HOST_PREFIX_1="loser-" \
  LANGUAGES="c proto gcov  c++" \
  LIBGCC2_CFLAGS="-O2  -DCROSS_COMPILE -DIN_GCC    -g -I./include  -G 0 -g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fexceptions  " libgcc2.a
make[2]: Entering directory `/mnt/u/scott/CrossGCC/Source/build-gcc'
rm -f tmplibgcc2.a
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _op_new _op_vnew _new_handler _op_delete _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh _eh_compat _pure; \
do \
  echo ${name}; \
  ./xgcc -B./ -O2  -DCROSS_COMPILE -DIN_GCC    -g -I./include  -G 0 -g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fexceptions   -I. -I../gcc-2.8.1 -I../gcc-2.8.1/config -c -DL${name} \
      ../gcc-2.8.1/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  /u/scott/CrossGCC/Install/mips-any-elf/bin/ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
/tmp/cca21118.s: Assembler messages:
/tmp/cca21118.s:64: Error: unrecognized opcode `mult $5,$6'
/tmp/cca21118.s:65: Error: unrecognized opcode `mflo $10'
/tmp/cca21118.s:68: Error: unrecognized opcode `mult $4,$7'
/tmp/cca21118.s:69: Error: unrecognized opcode `mflo $13'
/tmp/cca21118.s:71: Error: unrecognized opcode `multu $5,$7'
/tmp/cca21118.s:75: Error: unrecognized opcode `mflo $9'
/tmp/cca21118.s:78: Error: unrecognized opcode `mfhi $12'
make[2]: *** [libgcc2.a] Error 1
make[2]: Leaving directory `/mnt/u/scott/CrossGCC/Source/build-gcc'
make[1]: *** [stmp-multilib-sub] Error 2
make[1]: Leaving directory `/mnt/u/scott/CrossGCC/Source/build-gcc'
make: *** [stmp-multilib] Error 1


"which as" tells me that "as" in my search path is /usr/bin/as.
(This is clearly not the "as" I want for mips.)


Here is the script I am following to perform the build:

#
# This script assumes the following directories and files exist:
#
#    /u/scott/CrossGCC/Source/binutils-2.9.1.tar.gz
#    /u/scott/CrossGCC/Source/tigon_binutils-2.9.1.patch
#    /u/scott/CrossGCC/Source/script                        (this file)
#    /u/scott/CrossGCC/Source/gcc-2.8.1.tar.gz
#    /u/scott/CrossGCC/Source/crossgcc-gcc-2.8.1.patch
#
# This is run from /u/scott/CrossGCC/Source
#
mkdir /u/scott/CrossGCC/Install
tar zxvf binutils-2.9.1.tar.gz
cd binutils-2.9.1
patch -p0 < ../tigon_binutils-2.9.1.patch
cd ..
mkdir build-binutils
cd build-binutils
../binutils-2.9.1/configure --target=mips-any-elf \
                            --prefix=/u/scott/CrossGCC/Install -v
make all install
cd ..
tar zxvf gcc-2.8.1.tar.gz
cd gcc-2.8.1
patch -p1 < ../crossgcc-gcc-2.8.1.patch
cd ..
mkdir build-gcc
cd build-gcc
../gcc-2.8.1/configure --target=mips-any-elf \
                       --prefix=/u/scott/CrossGCC/Install -v
make all install
cd ..



What I want to do is build the tools in a directory different than
the source and install them in my own directory.  I tried putting
a link for "as" in both the build directory as well as the $prefix/bin
directory to itself ($prefix/bin/mips-any-elf-as) but it didn't
help.  I also made sure that the $PATH had $prefix/bin first.

Any suggestions?

Thansk,
Scott


--------------------------------------------------------------------------
Scott C. Karlin                             Princeton University
Graduate Student                            Department of Computer Science
Voice: (609) 258-5386                       35 Olden Street
Email: scott@cs.princeton.edu               Princeton, NJ 08544-2087
WWW:   http://www.cs.princeton.edu/~scott
--------------------------------------------------------------------------
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.