Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to Compile "Stage 4" GCC for arm-none-eabi, No stdint
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 264

PostPosted: Fri Feb 23, 2018 3:33 am    Post subject: Unable to Compile "Stage 4" GCC for arm-none-eabi, Reply with quote

GCC 7.3.0. Generating only a C compiler seemed to work, but now libgcc will not build, and this causes the build system to stop in the middle. I'm not sure what else to include. Searching for "include_next <stdint.h>" will turn up some other results where people were not able to generate a cross compiler. Unfortunately, the solution is to typically installa pregenerated toolchain.

This was asked on the GCC mailing list, but they are not very active. I am also not sure anyone fully understands the build system. There is a method I still need to try that involves combining all of the dependencies into GCC's source tree (or something close) and having it manage the whole build. I'd like to stay away from this, but it is the last option I have to try.

In the script I am using as a reference the freshly generated target libc seems to not be necessary for this step, so I am not sure if there is configuration that I have missed.

Code:
   ../../source/${dname}/configure \
      --target=${TARGET} \
      --prefix=`realpath ../../${DIR_PREFIX}` \
      --docdir=`realpath ../../${DIR_PREFIX}/share/doc` \
      --libexecdir=`realpath ../../${DIR_PREFIX}/lib` \
      --enable-languages=c,c++ \
      --with-headers=yes \
      --enable-plugins \
      --disable-libstdcxx-verbose \
      --disable-decimal-float \
      --disable-libffi \
      --disable-libgomp \
      --disable-libmudflap \
      --disable-libquadmath \
      --disable-libssp \
      --disable-libstdcxx-pch \
      --disable-nls \
      --disable-shared \
      --disable-threads \
      --disable-tls \
      --with-newlib \
      --with-sysroot=`realpath ../../${DIR_PREFIX}/${TARGET}` \
      --with-system-zlib \
      --with-gmp=`realpath ../../${DIR_PREFIX}/host/${gmp_dname}` \
      --with-mpfr=`realpath ../../${DIR_PREFIX}/host/${mpfr_dname}` \
      --with-mpc=`realpath ../../${DIR_PREFIX}/host/${mpc_dname}` \
      --with-isl=`realpath ../../${DIR_PREFIX}/host/${isl_dname}` \
      --with-pkgversion=${VERSION} \
      --with-multilib-list=rmprofile

   make -j"${NCPU}" -l"${NCPU}"
   make install

Code:
/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    -g -O2 -mthumb -march=armv8-m.base -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fstack-check=no -Dinhibit_libc  -fno-inline -I. -I. -I../../../.././gcc -I../../../../../../source/gcc-7.3.0/libgcc -I../../../../../../source/gcc-7.3.0/libgcc/. -I../../../../../../source/gcc-7.3.0/libgcc/../gcc -I../../../../../../source/gcc-7.3.0/libgcc/../include    -o cmse.o -MT cmse.o -MD -MP -MF cmse.dep -c -mcmse ../../../../../../source/gcc-7.3.0/libgcc/config/arm/cmse.c
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.
Back to top
View user's profile Send private message
imran207
n00b
n00b


Joined: 14 Dec 2023
Posts: 1

PostPosted: Thu Dec 14, 2023 9:23 pm    Post subject: a workaround Reply with quote

I came across this problem when trying to build a QMK firmware to flash on my keyboard. The setup script for the QMK firmware requires version 8 of cross-arm-none-eabi/gcc . This version (or any version below 9) triggers the problem with include_next <stdint.h>. My workaround is to first install version 9 of gcc, install newlib, and then downgrade to version 8 of gcc:

Code:

# edit /etc/portage/package.accept_keywords/cross-arm-none-eabi to include "<cross-arm-none-eabi/gcc-10 * ~* **"  (without the quotes)
emerge -1av cross-arm-none-eabi/gcc
emerge -1av cross-arm-none-eabi/newlib
# edit /etc/portage/package.accept_keywords/cross-arm-none-eabi and change the same line to "<cross-arm-none-eabi/gcc-9 * ~* **"
emerge -1av cross-arm-none-eabi/gcc
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum