Hello. I am interested in having a cross compiler tool chain installed on my Raspberry Pi 3. That is, I want the Raspberry Pi 3 to act as a development system for writing code to target a microcontroller/Cortex M3.
I am using the default install OS they deliver with Raspberry Pi 3, Raspbian OS, Jessie. It comes with a version of GCC, so I figured I could use GCC to build the ARM-GCC cross compiler. I downloaded the source, followed the guide of installing the common tools, unzipped everything, and ran 'sudo ./build-prerequisites.sh'. The first problem I ran into is that the makefile for the prerequisites fail with the statement "unknown target arm7l' or something like that.
I then decided to just build the prerequisites manually by going into each directory and doing configure, make, make check, make install. That seemed to work fairly successfully. The make check would pass except for like one or two tests out of like a hundred. I then tried to go back to doing './build-toolchain.sh', and that's where the second problem happened. The configure stage would get to the step where it was checking gmp/mpc/mpfr versions...It would pass on the test that states "searching for header files", but would fail on the step for "checking for version". Which is strange since I could clearly see the library files in one of my lib directories.
Soooooo the next thing I tried was just downloading and building the latest versions of gmp/mpc/mpfr. I just downloaded the source and built as normal. Now when I run './build-toolchain.sh', it gets past the configure stage and into the make stage, calling gcc a billion times. This goes on for a really long time so I was hopeful I'd complete the task, but eventually it error'd out:
This is the last set of lines before the error:
g++ -c -DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -Ic -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/c -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../include -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../libcpp/include -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/build-native/host-libs/usr/include -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/build-native/host-libs/usr/include -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/build-native/host-libs/usr/include -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../libdecnumber -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../libbacktrace -I/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/build-native/host-libs/usr/include -o c/c-decl.o -MT c/c-decl.o -MMD -MP -MF c/.deps/c-decl.TPo /home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/c/c-decl.c
/bin/sh: line 1: 10492 Killed build/genautomata /home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/common.md /home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/config/arm/arm.md insn-conditions.md > tmp-automata.c
Makefile:2138: recipe for target 's-automata' failed
make[1]: *** [s-automata] Error 137
make[1]: *** Waiting for unfinished jobs....
/bin/sh /home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../move-if-change tmp-attrtab.c insn-attrtab.c
/bin/sh /home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../move-if-change tmp-dfatab.c insn-dfatab.c
/bin/sh /home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/src/gcc/gcc/../move-if-change tmp-latencytab.c insn-latencytab.c
echo timestamp > s-attrtab
rm cpp.pod gcov-tool.pod gfdl.pod fsf-funding.pod gcov.pod gcc.pod
make[1]: Leaving directory '/home/pi/tmp/gcc-arm-none-eabi-5_4-2016q3-20160926/build-native/gcc-first/gcc'
Makefile:4095: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2
Anybody got any hints to building the cross compiler on the RP3?