Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| howtos:pic32mx_ubuntu [2025/02/24 17:26] admin created | howtos:pic32mx_ubuntu [2025/02/24 18:31] (current) admin | ||
|---|---|---|---|
| Line 60: | Line 60: | ||
| $ cd ~/projects/gcc-mips-10.3.0/build-newlib-el-4.1.0 | $ cd ~/projects/gcc-mips-10.3.0/build-newlib-el-4.1.0 | ||
| $ ../newlib-4.1.0/configure --target=mipsel --prefix=/opt/mipsel-10.3.0 | $ ../newlib-4.1.0/configure --target=mipsel --prefix=/opt/mipsel-10.3.0 | ||
| - | $ make ; echo $? | ||
| - | ... | ||
| - | mipsel-cc -B/home/dambi/projects/gcc-mips/build-newlib-el/mipsel/newlib/ -isystem /home/dambi/projects/gcc-mips/build[27/1919] | ||
| - | l/mipsel/newlib/targ-include -isystem /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include -B/home/dambi/projects/gcc-mips/build-newlib-el/mipsel/libgloss/mips -L/home/dambi/projects/gcc-mips/build-newlib-el/mipsel/libgloss/libnosys -L/home/d | ||
| - | ambi/projects/gcc-mips/newlib-4.1.0/libgloss/mips  -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION= | ||
| - | \"4.1.0\" -DPACKAGE_STRING=\"newlib\ 4.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../newlib-4.1.0/new | ||
| - | lib/libc/stdlib -fno-builtin -DMISSING_SYSCALL_NAMES -DHAVE_INIT_FINI  -g -O2 -c -o lib_a-dtoa.o `test -f 'dtoa.c' || echo '../../../../../newlib-4.1.0/newlib/libc/stdlib/'`dtoa.c | ||
| - | In file included from ../../../../../newlib-4.1.0/newlib/libc/stdlib/mprec.h:29, | ||
| - | from ../../../../../newlib-4.1.0/newlib/libc/stdlib/dtoa.c:33: | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:152:2: error: #error "double and long double are the s | ||
| - | ame size but LDBL_EQ_DBL is not defined" | ||
| - | 152 | #error "double and long double are the same size but LDBL_EQ_DBL is not defined" | ||
| - | | ^~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:195:3: error: unknown type name '__ieee_ext_field_type | ||
| - | ' | ||
| - | 195 | __ieee_ext_field_type  ext_fracl : EXT_FRACLBITS; | ||
| - | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:195:38: error: 'EXT_FRACLBITS' undeclared here (not in | ||
| - | a function); did you mean 'EXT_FRACBITS'? | ||
| - | 195 | __ieee_ext_field_type  ext_fracl : EXT_FRACLBITS; | ||
| - | | ^~~~~~~~~~~~~ | ||
| - | | EXT_FRACBITS | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:195:26: error: bit-field 'ext_fracl' width not an inte | ||
| - | ger constant | ||
| - | 195 | __ieee_ext_field_type  ext_fracl : EXT_FRACLBITS; | ||
| - | | ^~~~~~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:196:3: error: unknown type name '__ieee_ext_field_type | ||
| - | ' | ||
| - | 196 | __ieee_ext_field_type  ext_frach : EXT_FRACHBITS; | ||
| - | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:196:38: error: 'EXT_FRACHBITS' undeclared here (not in | ||
| - | a function); did you mean 'EXT_FRACBITS'? | ||
| - | 196 | __ieee_ext_field_type  ext_frach : EXT_FRACHBITS; | ||
| - | | ^~~~~~~~~~~~~ | ||
| - | | EXT_FRACBITS | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:196:26: error: bit-field 'ext_frach' width not an inte | ||
| - | ger constant | ||
| - | 196 | __ieee_ext_field_type  ext_frach : EXT_FRACHBITS; | ||
| - | | ^~~~~~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:197:3: error: unknown type name '__ieee_ext_field_type | ||
| - | ' | ||
| - | 197 | __ieee_ext_field_type  ext_exp  : EXT_EXPBITS; | ||
| - | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:197:38: error: 'EXT_EXPBITS' undeclared here (not in a | ||
| - | function); did you mean 'EXT_EXP_BIAS'? | ||
| - | 197 | __ieee_ext_field_type  ext_exp  : EXT_EXPBITS; | ||
| - | | ^~~~~~~~~~~ | ||
| - | | EXT_EXP_BIAS | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:197:26: error: bit-field 'ext_exp' width not an integer constant | ||
| - | 197 | __ieee_ext_field_type  ext_exp  : EXT_EXPBITS; | ||
| - | | ^~~~~~~ | ||
| - | /home/dambi/projects/gcc-mips/newlib-4.1.0/newlib/libc/include/ieeefp.h:198:3: error: unknown type name '__ieee_ext_field_type' | ||
| - | 198 | __ieee_ext_field_type  ext_sign  : 1; | ||
| - | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| - | make[5]: *** [Makefile:734: lib_a-dtoa.o] Error 1 | ||
| - | make[5]: Leaving directory '/data/smb/users/dambi/projects/gcc-mips/build-newlib-el/mipsel/newlib/libc/stdlib' | ||
| - | make[4]: *** [Makefile:683: all-recursive] Error 1 | ||
| - | make[4]: Leaving directory '/data/smb/users/dambi/projects/gcc-mips/build-newlib-el/mipsel/newlib/libc' | ||
| - | make[3]: *** [Makefile:641: all-recursive] Error 1 | ||
| - | make[3]: Leaving directory '/data/smb/users/dambi/projects/gcc-mips/build-newlib-el/mipsel/newlib' | ||
| - | make[2]: *** [Makefile:452: all] Error 2 | ||
| - | make[2]: Leaving directory '/data/smb/users/dambi/projects/gcc-mips/build-newlib-el/mipsel/newlib' | ||
| - | make[1]: *** [Makefile:8492: all-target-newlib] Error 2 | ||
| - | make[1]: Leaving directory '/data/smb/users/dambi/projects/gcc-mips/build-newlib-el' | ||
| - | make: *** [Makefile:879: all] Error 2 | ||
| - | 2 | ||
| - | </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 $? | $ make ; echo $? | ||
| $ sudo make install | $ sudo make install | ||
| Line 158: | Line 67: | ||
| <code> | <code> | ||
| $ cd ~/projects/gcc-mips-10.3.0/build-gcc-el-10.3.0 | $ 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 | + | $ ../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-10.3.0 --with-native-system-header-dir=/opt/mipsel-10.3.0/include --disable-nls --disable-shared  --enable-multilib --disable-decimal-float -disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath | 
| $ make -j 10 ; echo $? | $ make -j 10 ; echo $? | ||
| $ sudo make install | $ sudo make install | ||
| </code> | </code> | ||
| - | ===== binutils 2.22 ===== | + | ===== copy Microchip libraries ===== | 
| - | * prepare working area | + | |
| <code> | <code> | ||
| - | $ mkdir ~/projects/gcc-mips/ | + | # mkdir /opt/mipsel-10.3.0/lib/microchip/ | 
| - | $ cd ~/projects/gcc-mips/ | + | # cp libc_s_n.a libdsp.a libgcc_s_n.a /opt/mipsel-10.3.0/lib/microchip/ | 
| - | $ mkdir build-binutils-el | + | |
| - | </code> | + | |
| - | * download and unpack | + | |
| - | <code> | + | |
| - | $ 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 | + | |
| - | </code> | + | |
| - | * build and install (all tools will be installed into /opt/mipsel/ directory) | + | |
| - | <code> | + | |
| - | $ cd build-binutils-el | + | |
| - | $ ../binutils-2.22/configure --target=mipsel --prefix=/opt/mipsel | + | |
| - | $ make | + | |
| - | $ sudo make install | + | |
| - | </code> | + | |
| - | ===== gcc 4.5.2 with newlib 1.20.0 ===== | + | |
| - | * prepare working area | + | |
| - | <code> | + | |
| - | $ cd ~/projects/gcc-mips/ | + | |
| - | $ mkdir build-gcc-el | + | |
| - | $ mkdir build-newlib-el | + | |
| - | </code> | + | |
| - | * download and unpack | + | |
| - | <code> | + | |
| - | $ 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 | + | |
| - | </code> | + | |
| - | * 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 ===== | + | |
| - | <code> | + | |
| - | $ 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 | + | |
| - | </code> | + | |
| - | * **--enable-multilib** - builds several variants of libraries (big-endian, little-endian hard-float and soft-float). Default is little-endian hard-float. | + | |
| - | <code> | + | |
| - | $ /opt/mipsel/bin/mipsel-gcc -print-multi-lib | + | |
| - | .; | + | |
| - | soft-float;@msoft-float | + | |
| - | eb;@EB | + | |
| - | soft-float/eb;@msoft-float@EB | + | |
| - | $ | + | |
| - | </code> | + | |
| - | ===== Stage 2 - deploy newlib ===== | + | |
| - | * build and install | + | |
| - | <code> | + | |
| - | $ cd ~/projects/gcc-mips/build-newlib-el | + | |
| - | $ ../newlib-1.20.0/configure --target=mipsel --prefix=/opt/mipsel | + | |
| - | $ make | + | |
| - | $ sudo make install | + | |
| - | </code> | + | |
| - | ===== Stage 3 - deploy gcc with newlib suport ===== | + | |
| - | <code> | + | |
| - | $ 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 | + | |
| </code> | </code> | ||
| + | |||




