Go to file
Yann E. MORIN bd39d11d2e core/infra: fix build on toolchain without C++
Autotools-based packages that do not need C++ but check for it, and use
libtool, will fail to configure on distros that lack /lib/cpp.

This is the case for example on Arch Linux, where expat fails to build
with:

    configure: error: in `/home/dkc/src/buildroot/build/build/expat-2.2.4':
    configure: error: C++ preprocessor "/lib/cpp" fails sanity check

This is because libtool uses AC_PROC_CXXCPP, which can not be avoided,
and does require a cpp that passes some "sanity" checks (does not choke
on valid input, but does choke on invalid input). So we can use neither
/bin/false nor /bin/true...

We instead need something that can digest some basic C++ preprocessor
input. We can't use the target preprocessor: that does not work, because
it obviously has no C++ cupport:

    arm-linux-cpp.br_real: error: conftest.cpp: C++ compiler not
    installed on this system

We can however consider that the host machine does have a C++ compiler,
so we use the host' cpp, which is gcc's compiler wrapper that ends up
calling the host's C++ preprocessor.

That would give us a valid C++ preprocessor when we don't have one, in
fact. But autotools will then correctly fail anyway, because there is
indeed no C++ compiler at all, as we can see in this excerpt of a
configure log from expat:

    checking whether we are using the GNU C++ compiler... no
    checking whether false accepts -g... no
    checking dependency style of false... none
    checking how to run the C++ preprocessor... cpp
    checking whether the false linker (/home/ymorin/dev/buildroot/O/host/bin/arm-linux-ld) supports shared libraries... yes
    libtool.m4: error: problem compiling CXX test program
    checking for false option to produce PIC...  -DPIC
    checking if false PIC flag  -DPIC works... no
    checking if false static flag  works... no
    checking if false supports -c -o file.o... no
    checking if false supports -c -o file.o... (cached) no
    checking whether the false linker (/home/ymorin/dev/buildroot/O/host/bin/arm-linux-ld) supports shared libraries... yes

So, using the host's C++ preprocessor (by way of gcc's wrapper) leads to
a working situation, where the end result is as expected.

Reported-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Damien Riegel <damien.riegel@savoirfairelinux.com>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2018-01-07 15:58:29 +01:00
arch arch: add Atom CPUs as Silvermont Architecture target 2018-01-01 13:05:16 +01:00
board configs: nitrogen*: bump u-boot version to 2017.07 2018-01-07 15:48:56 +01:00
boot boot/arm-trusted-firmware: build fiptool separately with dependency on host-openssl 2017-12-18 23:09:39 +01:00
configs configs/bananapro: bump Linux and U-Boot version 2018-01-07 15:56:22 +01:00
docs docs/website: update for 2017.02.9 2018-01-01 12:51:59 +01:00
fs fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
linux linux: bump default to version 4.14.12 2018-01-05 18:26:00 +01:00
package core/infra: fix build on toolchain without C++ 2018-01-07 15:58:29 +01:00
support support/scripts: sort pie charts 2018-01-02 22:40:09 +01:00
system skeleton: Rename skeleton-sysv to skeleton-init-sysv 2017-08-14 21:52:45 +02:00
toolchain toolchain: post-pone evaluation of TOOLCHAIN_EXTERNAL_BIN 2017-12-31 18:24:17 +01:00
utils utils/scanpypi: increase error message verbosity 2017-12-18 15:18:40 +01:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.flake8 .flake8: add config file for Python code style 2017-10-06 19:05:18 +02:00
.gitignore update gitignore 2013-05-04 12:41:55 +02:00
.gitlab-ci.yml core/tests: add test for compressed iso9660 2017-12-31 18:20:14 +01:00
.gitlab-ci.yml.in gitlab-ci: add .config to artefacts 2017-12-30 22:36:07 +01:00
CHANGES Update for 2017.02.9 2018-01-01 12:48:38 +01:00
Config.in google-breakpad: take into account host architecture dependencies 2017-11-27 21:33:37 +01:00
Config.in.legacy imx-gpu-viv: bump to version 6.2.2.p0 2018-01-07 15:28:40 +01:00
COPYING COPYING: add exception about patch licensing 2016-02-26 19:50:13 +01:00
DEVELOPERS DEVELOPERS: remove Will Newton from numactl 2018-01-07 15:24:56 +01:00
Makefile Merge branch 'next' 2017-12-01 21:56:44 +01:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README README: add reference to submitting-patches 2016-02-01 19:16:08 +01:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches