LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2022, 02:36 AM   #1
fox_
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Rep: Reputation: 0
Question error: C++ preprocessor "/lib/cpp" fails sanity check


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
 
Old 06-14-2022, 07:01 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,015

Rep: Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340Reputation: 7340
for your RPi3 ?
In that case there is another problem:
Quote:
checking whether the /usr/bin/gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
x86_64 ??
 
Old 06-16-2022, 04:19 AM   #3
fox_
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Original Poster
Rep: Reputation: 0
so @pan64 is saying it's compiling it for an x86_64 and not an ARM architect.
let me check what I did wrong
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configure: error: C++ preprocessor "/lib/cpp" fails sanity check Mugatu Linux - Software 54 11-09-2017 07:34 AM
C++ preprocessor "/lib/cpp" fails sanity check C++ preprocessor "/lib/cpp" fails san mutetikasikali Linux - Software 3 01-25-2014 06:57 AM
GCC fails to compile - Chapter 6.14 - C preprocessor "/lib/cpp" fails sanity check jaydoc Linux From Scratch 1 01-28-2009 05:17 PM
Error msg: error: C++ preprocessor "/lib/cpp" fails sanity check wild_willy Linux - Newbie 4 01-04-2007 11:30 AM
ardour wont configure: configure: error: C preprocessor "/lib/cpp" fails sanity check disciple061 Linux - Software 4 01-22-2005 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration