Hi all,
I'm trying to build a rootfs for my RPI 3 using
Buildroot, and I get this "configure: error: C++ preprocessor "/lib/cpp" fails sanity check" error message.
I searched online for solutions but nothing worked out..
when I use make:
Code:
alon@alon-HP-PC:~/projects/buildroot$ make all
/usr/bin/make -j1 O=/home/alon/projects/buildroot/output HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
>>> host-util-linux 2.38 Configuring
(cd /home/alon/projects/buildroot/output/build/host-util-linux-2.38/ && rm -rf config.cache; PATH="/home/alon/projects/buildroot/output/host/bin:/home/alon/projects/buildroot/output/host/sbin:/home/alon/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" PKG_CONFIG="/home/alon/projects/buildroot/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/alon/projects/buildroot/output/host/lib/pkgconfig:/home/alon/projects/buildroot/output/host/share/pkgconfig" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/alon/projects/buildroot/output/host/include" CFLAGS="-O2 -I/home/alon/projects/buildroot/output/host/include" CXXFLAGS="-O2 -I/home/alon/projects/buildroot/output/host/include" LDFLAGS="-L/home/alon/projects/buildroot/output/host/lib -Wl,-rpath,/home/alon/projects/buildroot/output/host/lib" INTLTOOL_PERL=/usr/bin/perl CFLAGS="-O2 -I/home/alon/projects/buildroot/output/host/include" LDFLAGS="-L/home/alon/projects/buildroot/output/host/lib -Wl,-rpath,/home/alon/projects/buildroot/output/host/lib" CONFIG_SITE=/dev/null ./configure --prefix="/home/alon/projects/buildroot/output/host" --sysconfdir="/home/alon/projects/buildroot/output/host/etc" --localstatedir="/home/alon/projects/buildroot/output/host/var" --enable-shared --disable-static --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --disable-debug --with-xmlto=no --with-fop=no --disable-nls --disable-dependency-tracking --without-systemd --with-systemdsystemunitdir=no --without-python --enable-libblkid --enable-libmount --enable-libuuid --without-libmagic --without-ncurses --without-ncursesw --without-tinfo --disable-raw --disable-makeinstall-chown --disable-agetty --disable-chfn-chsh --disable-chmem --disable-ipcmk --disable-login --disable-lsfd --disable-lslogins --disable-mesg --disable-more --disable-newgrp --disable-nologin --disable-nsenter --disable-pg --disable-rfkill --disable-runuser --disable-schedutils --disable-setpriv --disable-setterm --disable-su --disable-sulogin --disable-tunelp --disable-ul --disable-unshare --disable-uuidd --disable-vipw --disable-wall --disable-wdctl --disable-write --disable-zramctl )
configure: WARNING: unrecognized options: --disable-gtk-doc-html, --disable-doc, --disable-docs, --disable-documentation, --disable-debug, --with-xmlto, --with-fop
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking how to run the C preprocessor... /usr/bin/cpp
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking dependency style of /usr/bin/gcc... none
checking whether make supports nested variables... (cached) yes
checking the archiver (/usr/bin/ar) interface... ar
checking for gcc... (cached) /usr/bin/gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /usr/bin/gcc accepts -g... (cached) yes
checking for /usr/bin/gcc option to accept ISO C89... (cached) none needed
checking whether /usr/bin/gcc understands -c and -o together... (cached) yes
checking for bison... bison -y
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for an ANSI C-conforming const... yes
checking for working volatile... yes
checking whether byte ordering is bigendian... no
checking whether compiler handles -fno-common... yes
checking whether compiler handles -Wall... yes
checking whether compiler handles -Wextra... yes
checking whether compiler handles -Waddress-of-packed-member... yes
checking whether compiler handles -Wdiscarded-qualifiers... yes
checking whether compiler handles -Wembedded-directive... no
checking whether compiler handles -Wextra-semi... no
checking whether compiler handles -Wformat-security... yes
checking whether compiler handles -Wimplicit-function-declaration... yes
checking whether compiler handles -Wmissing-declarations... yes
checking whether compiler handles -Wmissing-parameter-type... yes
checking whether compiler handles -Wmissing-prototypes... yes
checking whether compiler handles -Wnested-externs... yes
checking whether compiler handles -Wno-missing-field-initializers... yes
checking whether compiler handles -Wpointer-arith... yes
checking whether compiler handles -Wredundant-decls... yes
checking whether compiler handles -Wsign-compare... yes
checking whether compiler handles -Wstrict-prototypes... yes
checking whether compiler handles -Wtype-limits... yes
checking whether compiler handles -Wuninitialized... yes
checking whether compiler handles -Wunused-but-set-parameter... yes
checking whether compiler handles -Wunused-but-set-variable... yes
checking whether compiler handles -Wunused-parameter... yes
checking whether compiler handles -Wunused-result... yes
checking whether compiler handles -Wunused-variable... yes
checking whether compiler handles -Werror=sequence-point... yes
checking whether compiler handles -Wno-clobbered... yes
checking whether compiler handles -Wno-cast-function-type... yes
checking whether compiler handles -Wno-unused-parameter... yes
checking whether we are using the GNU C++ compiler... no
checking whether /usr/bin/g++ accepts -g... no
checking dependency style of /usr/bin/g++... none
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by /usr/bin/gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... /usr/bin/ranlib
checking command to parse /usr/bin/nm output from /usr/bin/gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc option to produce PIC... -fPIC -DPIC
checking if /usr/bin/gcc PIC flag -fPIC -DPIC works... yes
checking if /usr/bin/gcc static flag -static works... yes
checking if /usr/bin/gcc supports -c -o file.o... yes
checking if /usr/bin/gcc supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/home/alon/projects/buildroot/output/build/host-util-linux-2.38':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make[1]: *** [package/pkg-generic.mk:283: /home/alon/projects/buildroot/output/build/host-util-linux-2.38/.stamp_configured] Error 1
make: *** [Makefile:84: _all] Error 2
in the config.log it complains about "cpp: fatal error: cannot execute 'cc1plus': execvp: No such file or directory"
I also have these installed compliers
Code:
dpkg --list | grep compiler
ii device-tree-compiler 1.5.1-1 amd64 Device Tree Compiler for Flat Device Trees
ii g++ 4:9.3.0-1ubuntu2 amd64 GNU C++ compiler
ii g++-8 8.4.0-3ubuntu2 amd64 GNU C++ compiler
ii g++-9 9.4.0-1ubuntu1~20.04.1 amd64 GNU C++ compiler
ii g++-9-aarch64-linux-gnu 9.4.0-1ubuntu1~20.04.1cross2 amd64 GNU C++ compiler (cross compiler for arm64 architecture)
ii g++-9-arm-linux-gnueabihf 9.4.0-1ubuntu1~20.04.1cross2 amd64 GNU C++ compiler (cross compiler for armhf architecture)
ii g++-9-multilib 9.4.0-1ubuntu1~20.04.1 amd64 GNU C++ compiler (multilib support)
ii g++-aarch64-linux-gnu 4:9.3.0-1ubuntu2 amd64 GNU C++ compiler for the arm64 architecture
ii g++-arm-linux-gnueabihf 4:9.3.0-1ubuntu2 amd64 GNU C++ compiler for the armhf architecture
ii gcc 4:9.3.0-1ubuntu2 amd64 GNU C compiler
ii gcc-7 7.5.0-6ubuntu2 amd64 GNU C compiler
ii gcc-8 8.4.0-3ubuntu2 amd64 GNU C compiler
ii gcc-9 9.4.0-1ubuntu1~20.04.1 amd64 GNU C compiler
ii gcc-9-aarch64-linux-gnu 9.4.0-1ubuntu1~20.04.1cross2 amd64 GNU C compiler (cross compiler for arm64 architecture)
ii gcc-9-arm-linux-gnueabihf 9.4.0-1ubuntu1~20.04.1cross2 amd64 GNU C compiler (cross compiler for armhf architecture)
ii gcc-9-multilib 9.4.0-1ubuntu1~20.04.1 amd64 GNU C compiler (multilib support)
ii gcc-aarch64-linux-gnu 4:9.3.0-1ubuntu2 amd64 GNU C compiler for the arm64 architecture
ii gcc-arm-linux-gnueabihf 4:9.3.0-1ubuntu2 amd64 GNU C compiler for the armhf architecture
ii gcc-arm-none-eabi 15:9-2019-q4-0ubuntu1 amd64 GCC cross compiler for ARM Cortex-R/M processors
ii gcc-arm-none-eabi-source 15:9-2019-q4-0ubuntu1 all GCC cross compiler for ARM Cortex-R/M processors (source)
ii libllvm10:amd64 1:10.0.0-4ubuntu1 amd64 Modular compiler and toolchain technologies, runtime library
ii libllvm12:amd64 1:12.0.0-3ubuntu1~20.04.5 amd64 Modular compiler and toolchain technologies, runtime library
ii libllvm9:amd64 1:9.0.1-12 amd64 Modular compiler and toolchain technologies, runtime library
ii libxkbcommon-dev:amd64 0.10.0-1 amd64 library interface to the XKB compiler - development files
ii libxkbcommon0:amd64 0.10.0-1 amd64 library interface to the XKB compiler - shared library