This is an old revision of the document!


Deploy PIC32MX gcc toolchain on Solaris

The toolchain no longer works on s11u4sru37 due to missing /usr/lib/libmpc.so.2 and /usr/lib/libmpfr.so.1 libraries - /opt/mipsel/libexec/gcc/mipsel/4.5.2/cc1 depends on them. Reason being the libraries were upgraded to /usr/lib/limpc.so.3 and /usr/lib/libmpfr.so.4 respectively. To workaround the issue, missing libraries were copied from s11u4sru30 where both old as well as new versions of those libraries are available. Also, new tool chain has been built based on binutils 2.37, gcc 9.4.0, newlib 4.1.0

binutils 2.37

  • save existing toolchain and prepare for building new one
$ mv ~/projects/gcc-mips/ ~/projects/gcc-mips-ok/
# mv /data/apps-local/mipsel /data/apps-local/mipsel-ok
# mkdir /data/apps-local/mipsel
  • start building new one
$ export PATH=/usr/gnu/bin:$PATH
$ mkdir ~/projects/gcc-mips/
$ cd ~/projects/gcc-mips/
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz -O /tmp/binutils-2.37.tar.gz
$ tar xvpf /tmp/binutils-2.37.tar.gz
$ mkdir build-binutils-el
$ cd build-binutils-el
$ ../binutils-2.37/configure --target=mipsel --prefix=/opt/mipsel
$ make
$ sudo make install
  • man pages were not built - why?

binutils 2.22

  • prepare working area
$ mkdir ~/projects/gcc-mips/
$ cd ~/projects/gcc-mips/
$ mkdir build-binutils-el
  • download and unpack
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz -O /tmp/binutils-2.22.tar.gz
$ tar xvpf /tmp/binutils-2.22.tar.gz
  • build and install (all tools will be installed into /opt/mipsel/ directory)
$ cd build-binutils-el
$ ../binutils-2.22/configure --target=mipsel --prefix=/opt/mipsel
$ make
$ sudo make install

gcc 4.5.2 with newlib 1.20.0

  • prepare working area
$ cd ~/projects/gcc-mips/
$ mkdir build-gcc-el
$ mkdir build-newlib-el
  • download and unpack
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.2/gcc-4.5.2.tar.gz -O /tmp/gcc-4.5.2.tar.gz
$ tar xvpf /tmp/gcc-4.5.2.tar.gz
$ wget ftp://sources.redhat.com/pub/newlib/newlib-1.20.0.tar.gz -O /tmp/newlib-1.20.0.tar.gz
$ tar xvpf /tmp/newlib-1.20.0.tar.gz
  • build and install (tools will be installed into /opt/mipsel/ directory). Building gcc with newlib is done in three steps.

Stage 1 - build bootstrap gcc

$ cd build-gcc-el
$ ../gcc-4.5.2/configure --target=mipsel --prefix=/opt/mipsel --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without-headers --with-gnu-as --with-gnu-ld --with-newlib --enable-languages=c --with-local-prefix=/opt/mipsel --with-native-system-header-dir=/opt/mipsel/include/ --disable-nls --disable-shared  --enable-multilib --disable-decimal-float -disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath
$ make
$ sudo make install
  • –enable-multilib - builds several variants of libraries (big-endian, little-endian hard-float and soft-float). Default is little-endian hard-float.
$ /opt/mipsel/bin/mipsel-gcc -print-multi-lib
.;
soft-float;@msoft-float
eb;@EB
soft-float/eb;@msoft-float@EB
$

Stage 2 - deploy newlib

  • build and install
$ cd ~/projects/gcc-mips/build-newlib-el
$ ../newlib-1.20.0/configure --target=mipsel --prefix=/opt/mipsel
$ make
$ sudo make install

Stage 3 - deploy gcc with newlib suport

$ cd ~/projects/gcc-mips/build-gcc-el
$ ../gcc-4.5.2/configure --target=mipsel --prefix=/opt/mipsel --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --with-gnu-as --with-gnu-ld --with-newlib --enable-languages=c --with-local-prefix=/opt/mipsel --with-native-system-header-dir=/opt/mipsel/include --disable-nls --disable-shared  --enable-multilib --disable-decimal-float -disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath
$ make
$ sudo make install
howtos/pic32mx_tools_on_solaris.1632738911.txt.gz · Last modified: 2021/09/27 12:35 by admin
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0