title: build libgcc for mips with micromips
body: <p>I am trying to build cross compiler gcc for mips architecture. Build and host are x86_64 and target is mips. I also want -micromips built version of libgcc.</p>
  <p>I am able to build and install binutils and bootstrap gcc as below:</p>
  <pre><code>TARGET=mips-sde-elf
  
  cd binutils-2.31-build
  ../binutils-2.31/configure --prefix=$PREFIX --target=$TARGET --disable-nls
  make -j24
  make install
  </code></pre>
  <pre><code>cd gcc-6.5.0-build
  ../gcc-6.5.0/configure --prefix=$PREFIX --target=$TARGET \
                         --enable-languages=c,c++ --disable-nls \
                         --with-newlib --disable-threads --disable-shared --disable-libssp  \
                         --disable-libstdcxx-pch --disable-libgomp --with-system-zlib
  make -j24 all-gcc
  </code></pre>
  <p>However, when trying to build libgcc I get below error.</p>
  <pre><code>make -j24 all-target-libgcc
  </code></pre>
  <p>/projects/k2072/users/nima/tools/sources/gcc/gcc-6.5.0/gcc-6.5.0-build-mips/./gcc/xgcc -B/projects/k2072/users/nima/tools/sources/gcc/gcc-6.5.0/gcc-6.5.0-build-mips/./gcc/ -B/projects/k2072/users/nima/jadarite/toolchain/gcc-6.5.0-mips/mips-sde-elf/bin/ -B/projects/k2072/users/nima/jadarite/toolchain/gcc-6.5.0-mips/mips-sde-elf/lib/ -isystem /projects/k2072/users/nima/jadarite/toolchain/gcc-6.5.0-mips/mips-sde-elf/include -isystem /projects/k2072/users/nima/jadarite/toolchain/gcc-6.5.0-mips/mips-sde-elf/sys-include    -g -O2 -Os -mcode-readable=pcrel -mno-gpopt -mmicromips -O2  -g -O2 -Os -minterlink-mips16 -mcode-readable=pcrel -mno-gpopt -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../gcc-6.5.0/libgcc -I../../../../gcc-6.5.0/libgcc/. -I../../../../gcc-6.5.0/libgcc/../gcc -I../../../../gcc-6.5.0/libgcc/../include  -DHAVE_CC_TLS  -o fixsfsi.o -MT fixsfsi.o -MD -MP -MF fixsfsi.dep -DFUNC=__fixsfsi -DOP_fixsi -DTYPE=sf -c ../../../../gcc-6.5.0/libgcc/config/hardfp.c -fvisibility=hidden -DHIDE_EXPORTS -Wno-missing-prototypes</p>
  <p><strong>/tmp/cc8vFnc3.s: Assembler messages:
  /tmp/cc8vFnc3.s:29: Error: invalid operands `trunc.w.s $f0,$f12,$2'</strong></p>
  <p>If I remove -mmicromips from above compile command, compilation passes. I also can build libgcc with other compile options like -EL -msoft-float, etc. but not micromips.</p>
  <pre><code>find -name &quot;libgcc.a&quot;
  ./libgcc/libgcc.a
  ./el/libgcc/libgcc.a
  ./mips32/libgcc/libgcc.a
  ./mips32r2/libgcc/libgcc.a
  ./mips64/libgcc/libgcc.a
  ./mips64r2/libgcc/libgcc.a
  ./mips16/libgcc/libgcc.a
  </code></pre>
  <p>Greatly appreciate any help.</p>