R0b0t1 wrote 27.2.2018 klo 5:33:
> In file included from
> /home/R0b0t1/devel/toolgen/build/gcc-7.3.0/gcc/include/arm_cmse.h:38:0,
> from > ../../../../../../source/gcc-7.3.0/libgcc/config/arm/cmse.c:27:
> /home/R0b0t1/devel/toolgen/build/gcc-7.3.0/gcc/include/stdint.h:9:16:
> fatal error: stdint.h: No such file or directory
> # include_next <stdint.h>
> ^~~~~~~~~~
> compilation terminated.
Please read :
https://gcc.gnu.org/install/prerequisites.html
There is written :
"C standard library and headers
In order to build GCC, the C standard library and headers must be
present for
all target variants for which target libraries will be built"
Here it means that if one aims to use newlib as the "C standard library
and headers", a prebuilt newlib for
the target would be required or then the newlib sources so that the
extra "target libraries" provided with
the GCC sources could be built with the "C standard library and headers"
already being available.
The easy way during the "first time ever" or "bootstrap time" is to
provide the sources like shown here :
[root@localhost src]# cd gcc-7.3.0
[root@localhost gcc-7.3.0]# ls -l gmp mpc mpfr isl libgloss newlib
lrwxrwxrwx 1 kai kai 12 28. marras 09:36 gmp -> ../gmp-6.1.0
lrwxrwxrwx 1 root root 11 27. helmi 11:01 isl -> ../isl-0.18
lrwxrwxrwx 1 root root 24 27. helmi 08:56 libgloss ->
../newlib-2.5.0/libgloss
lrwxrwxrwx 1 kai kai 12 28. marras 09:36 mpc -> ../mpc-1.0.3
lrwxrwxrwx 1 kai kai 13 28. marras 09:36 mpfr -> ../mpfr-3.1.4
lrwxrwxrwx 1 root root 22 27. helmi 08:56 newlib -> ../newlib-2.5.0/newlib
Also the sources for the $host libraries (gmp, mpc, mpfr, isl) can be
provided and be built during the
GCC build (for the $host system if it doesn't yet have them) instead of
building them separately earlier
and then pointing to them during the GCC configure...
> --enable-plugins \
> --disable-libstdcxx-pch \
> --disable-libstdcxx-verbose \
The current GCC "Install / Configure" docs (for gcc-7.3.0) don't know
these configure options...
> --disable-libmudflap \
The gcc-7.3.0 sources don't either include 'libmudflap' so disabling it
is vain...
> --with-sysroot=`realpath ../../${DIR_PREFIX}/${TARGET}` \
The sanity to use '--with-sysroot=' in this case could need some
explanation.
Why the default place isn't suitable for the installed newlib ?
> # If this is the top-level multilib, build all the other
> # multilibs.
> /home/R0b0t1/devel/toolgen/build/gcc-7.3.0/./gcc/xgcc
> -B/home/R0b0t1/devel/toolgen/build/gcc-7.3.0/./gcc
> -B/home/R0b0t1/devel/toolgen/prefix/arm-none-eabi/bin/
> -B/home/R0b0t1/devel/toolgen/prefix/arm-none-eabi/lib/
> -isystem /home/R0b0t1/devel/toolgen/prefix/arm-none-eabi/include
> -isystem /home/R0b0t1/devel/toolgen/prefix/arm-none-eabi/sys-include
The '-B' and '-isystem' options here will tell where the (pre-)installed
newlib
should/will be. In the default '$PREFIX/$target', in 'include' and
'lib' there...
> Sadly I have made no progress. My attempts to compare my commands to
> https://github.com/FreddieChopin/bleeding-edge-toolchain
> have not gotten anywhere.
The net is full of these scripts and "how-to-do" instructions. But they
could
be taken similarly with the words of a Savonian Finn : "When a Savonian
speaks,
responsibility goes to the listener" - "Behind this wisdom is probably
the idea
that a Savonian talks a lot and cunning without actually giving a real
answer to
the problem or question. The covert message of the speaker prevents it from
being held accountable later." :) I myself would trust more in the
original GCC
build instructions and would suggest one to ask if something wasn't
clearly told
in them....
Ok, just for a fun I built 2 different crosscompilers for 'arm*-eabi'.
One for the default case
but with somehow tailored config options :
[root@localhost gcc-7.3.0]# arm-eabi-gcc-7.3 -v
Using built-in specs.
COLLECT_GCC=arm-eabi-gcc-7.3
COLLECT_LTO_WRAPPER=/opt/cross/lib/gcc/arm-eabi/7.3.0/lto-wrapper
Target: arm-eabi
Configured with: ../configure --build=i686-linux-gnu
--host=i686-linux-gnu --target=arm-eabi --prefix=/opt/cross
--libdir=/opt/cross/lib --libexecdir=/opt/cross/lib --disable-nls
--disable-tls --disable-threads --disable-decimal-float
--enable-multilib --enable-interwork --disable-libffi --disable-libgomp
--disable-libquadmath --disable-libssp --enable-languages=c,c++
--with-newlib --with-gxx-include-dir=/opt/cross/include/c++/7.3.0
--enable-version-specific-runtime-libs --program-prefix=arm-eabi-
--program-suffix=-7.3
Thread model: single
gcc version 7.3.0 (GCC)
and another with Cortex optimisations :
[root@localhost gcc-7.3.0]# arm-cortex-eabi-gcc-7.3 -v
Using built-in specs.
COLLECT_GCC=arm-cortex-eabi-gcc-7.3
COLLECT_LTO_WRAPPER=/opt/cross/lib/gcc/arm-cortex-eabi/7.3.0/lto-wrapper
Target: arm-cortex-eabi
Configured with: ../configure --build=i686-linux-gnu
--host=i686-linux-gnu --target=arm-cortex-eabi --prefix=/opt/cross
--libdir=/opt/cross/lib --libexecdir=/opt/cross/lib --with-cpu=cortex-m4
--with-fpu=fpv4-sp-d16 --with-float=hard --with-mode=thumb
--enable-multilib --enable-interwork --enable-languages=c,c++
--with-newlib --disable-shared --disable-nls
--with-gxx-include-dir=/opt/cross/include/c++/7.3.0
--enable-version-specific-runtime-libs --program-prefix=arm-cortex-eabi-
--program-suffix=-7.3
Thread model: single
gcc version 7.3.0 (GCC)
Both builds produced the "C standard library and headers" (newlib-2.5.0)
for the target too. Surely the configure
options could be trimmed more but the aim was to prove that "basically
it will work". GNU binutils were built
separately...