Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| howtos:pic32mx_tools_on_solaris [2021/11/08 17:45] admin [gcc 9.4.0 with newlib 4.1.0] | howtos:pic32mx_tools_on_solaris [2023/11/29 17:44] (current) admin [Stage 3 - deploy gcc and g++ with newlib suport] | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Deploy PIC32MX gcc toolchain on Solaris ====== | ====== 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. | + | * The toolchain **binutils-2.36**, **gcc-10.3.0**, **newlib-1.4** no longer works after upgrade from **SRU62** to **SRU63**, since **libisl** was upgraded from version **15** to version **23**. Re-compilation with libisl 23 fixed the problem. | 
| - | Reason being the libraries were upgraded to /usr/lib/limpc.so.3 and /usr/lib/libmpfr.so.4 respectively. | + | * 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. | 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 | + | Also, new tool chain has been built based on binutils 2.36, gcc 10.3.0, newlib 4.1.0. | 
| ===== binutils 2.36 ===== | ===== binutils 2.36 ===== | ||
| * start building new one | * start building new one | ||
| <code> | <code> | ||
| $ export PATH=/usr/gnu/bin:$PATH | $ export PATH=/usr/gnu/bin:$PATH | ||
| - | $ mkdir ~/projects/gcc-mips/ | + | $ mkdir ~/projects/gcc-mips-10.3.0/ | 
| - | $ cd ~/projects/gcc-mips/ | + | $ cd ~/projects/gcc-mips-10.3.0/ | 
| $ wget http://ftp.gnu.org/gnu/binutils/binutils-2.36.tar.gz -O /tmp/binutils-2.36.tar.gz | $ wget http://ftp.gnu.org/gnu/binutils/binutils-2.36.tar.gz -O /tmp/binutils-2.36.tar.gz | ||
| $ tar xvpf /tmp/binutils-2.36.tar.gz | $ tar xvpf /tmp/binutils-2.36.tar.gz | ||
| Line 20: | Line 20: | ||
| ===== binutils 2.37 ===== | ===== binutils 2.37 ===== | ||
| + | * man pages were not built - instead use binutils 2.36 | ||
| + | |||
| * save existing toolchain and prepare for building new one | * save existing toolchain and prepare for building new one | ||
| <code> | <code> | ||
| Line 39: | Line 41: | ||
| $ sudo make install | $ sudo make install | ||
| </code> | </code> | ||
| - | * man pages were not built - why? | ||
| ===== gcc 10.3.0 with newlib 4.1.0 ===== | ===== gcc 10.3.0 with newlib 4.1.0 ===== | ||
| * prepare working area | * prepare working area | ||
| Line 57: | Line 58: | ||
| ===== Stage 1 - build bootstrap gcc ===== | ===== Stage 1 - build bootstrap gcc ===== | ||
| <code> | <code> | ||
| - | $ cd build-gcc-el | + | $ cd build-gcc-el-10.3.0 | 
| - | $ ../gcc-9.4.0/configure --target=mipsel --prefix=/opt/mipsel --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 | + | $ ../gcc-10.3.0/configure --target=mipsel --prefix=/opt/mipsel-10.3.0 --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 | $ make | ||
| $ sudo make install | $ sudo make install | ||
| Line 64: | Line 65: | ||
| * **--enable-multilib** - builds several variants of libraries (big-endian, little-endian hard-float and soft-float). Default is little-endian hard-float. | * **--enable-multilib** - builds several variants of libraries (big-endian, little-endian hard-float and soft-float). Default is little-endian hard-float. | ||
| <code> | <code> | ||
| - | $ /opt/mipsel/bin/mipsel-gcc -print-multi-lib | + | $ /opt/mipsel-10.3.0/bin/mipsel-gcc -print-multi-lib | 
| .; | .; | ||
| soft-float;@msoft-float | soft-float;@msoft-float | ||
| Line 71: | Line 72: | ||
| $ | $ | ||
| </code> | </code> | ||
| - | ===== Stage 2 - deploy newlib - FAILS ===== | + | ===== Stage 2 - deploy newlib ===== | 
| * newlib requires mips-cc | * newlib requires mips-cc | ||
| <code> | <code> | ||
| - | # cd /opt/mipsel/bin | + | # cd /opt/mipsel-10.3.0/bin | 
| # ln -s mipsel-gcc mipsel-cc | # ln -s mipsel-gcc mipsel-cc | ||
| </code> | </code> | ||
| * build and install | * build and install | ||
| - | <code>$ export PATH=/opt/mipsel/bin:$PATH | + | <code>$ export PATH=/opt/mipsel-10.3.0/bin:$PATH | 
| - | $ cd ~/projects/gcc-mips/build-newlib-el | + | $ cd ~/projects/gcc-mips-10.3.0/build-newlib-el-4.1.0 | 
| - | $ ../newlib-4.1.0/configure --target=mipsel --prefix=/opt/mipsel | + | $ ../newlib-4.1.0/configure --target=mipsel --prefix=/opt/mipsel-10.3.0 | 
| $ make ; echo $? | $ make ; echo $? | ||
| ... | ... | ||
| Line 149: | Line 150: | ||
| </code> | </code> | ||
| + | * **LDBL_EQ_DBL** not defined in some header files | ||
| + | <code> | ||
| + | $ pwd | ||
| + | ~/projects/gcc-mips-10.3.0/build-newlib-el-4.1.0 | ||
| + | $ ggrep -Rl LDBL_EQ ./ | ||
| + | ./mipsel/newlib/targ-include/newlib.h | ||
| + | ./mipsel/newlib/newlib.h | ||
| + | ./mipsel/soft-float/newlib/targ-include/newlib.h | ||
| + | ./mipsel/soft-float/newlib/config.log | ||
| + | ./mipsel/soft-float/newlib/config.status | ||
| + | ./mipsel/soft-float/newlib/newlib.h | ||
| + | ./mipsel/soft-float/eb/newlib/newlib.h | ||
| + | ./mipsel/soft-float/eb/newlib/targ-include/newlib.h | ||
| + | ./mipsel/soft-float/eb/newlib/config.log | ||
| + | ./mipsel/soft-float/eb/newlib/config.status | ||
| + | ./mipsel/eb/newlib/config.log | ||
| + | ./mipsel/eb/newlib/targ-include/newlib.h | ||
| + | ./mipsel/eb/newlib/newlib.h | ||
| + | ./mipsel/eb/newlib/config.status | ||
| + | </code> | ||
| + | * define **LDBL_EQ_DBL** in files where it is not defined | ||
| + | <code> | ||
| + | $ vim -p ./mipsel/newlib/targ-include/newlib.h ./mipsel/newlib/newlib.h | ||
| + | $ make ; echo $? | ||
| + | $ sudo make install | ||
| + | </code> | ||
| + | |||
| + | ===== Stage 3 - deploy gcc and g++ with newlib suport ===== | ||
| + | <code> | ||
| + | $ cd ~/projects/gcc-mips-10.3.0/build-gcc-el-10.3.0 | ||
| + | $ ../gcc-10.3.0/configure --target=mipsel --prefix=/opt/mipsel-10.3.0 --with-gnu-as --with-gnu-ld --with-newlib --enable-languages=c,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 -j 10 ; echo $? | ||
| + | $ sudo make install | ||
| + | </code> | ||
| ===== binutils 2.22 ===== | ===== binutils 2.22 ===== | ||
| * prepare working area | * prepare working area | ||




