mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-19 12:57:53 +00:00
5c5b4df6d3
GCC 11+ requires compiler being used to support C++11 standard [1]. And while GCC starting from 6.x has C++11 support enabled by default [2], older versions need to be forced to implement it with "-std=gnu++11" and luckily GCC's build-system takes care of that: 1. For ${host} compiler - [1] 2. For ${build} compiler - [3, 4] In a nutshell the configure script tries a couple of options and the one which helps to build a test source gets appended to CXX (not CXXFLAGS!), so on say CentOS 7.x with GCC 4.8.5 during cross-compilation of GCC CXX="x86_64-build_pc-linux-gnu-g++ -std=gnu++11". And all is good. But in case of canadian cross due to [5] we for some reason* force set CXX_FOR_BUILD with just a compiler name, effectively overriding all the magic done by GCC's internals described above. This leads to a compilation failures like that: ------------------------------------->8---------------------------------- [ALL ] In file included from /usr/include/c++/4.8.2/type_traits:35:0, [ALL ] from .../HOST-x86_64-apple-darwin14/arc-gcc11-elf/src/gcc/gcc/system.h:244, [ALL ] from .../HOST-x86_64-apple-darwin14/arc-gcc11-elf/src/gcc/gcc/gengtype.c:26: [ERROR] /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. [ALL ] #error This file requires compiler and library support for the ^ ------------------------------------->8---------------------------------- * my guess that [5] was done because back in the day indeed we used to have "--build=${CT_BUILD} --host=${CT_HOST}" in do_cc_core(). But now after [6] this is no longer necessary as we use "--build=${CT_BUILD} --host=${CT_BUILD}" and all is safe and clean. So yet another old quirk goes away - hooray! [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5329b59a2e13dabbe2038af0fe2e3cf5fc7f98ed [2] https://gcc.gnu.org/gcc-6/changes.html [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96612 [4] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7ffcf5d61174dda1f39a623e15f7e5d6b98bbafc [5] |
||
---|---|---|
.. | ||
build | ||
override | ||
upgrade | ||
compile | ||
config.guess | ||
config.rpath | ||
config.sub | ||
crosstool-NG.sh | ||
depcomp | ||
functions | ||
install-sh | ||
ltmain.sh | ||
missing | ||
populate.in | ||
saveSample.sh | ||
scripts.mk | ||
show-config.sh | ||
show-tuple.sh | ||
toolchain-config.in | ||
version-check.sh | ||
xldd.in |