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] 9c6c090d7b
[6] 08161250ed
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
GCC can support using zstd compression for LTO object files. By default
GCC's configure will enable this if libzstd is installed on the machine
building the toolchain. This may be undesirable if the toolchain is to
be used on a different machine. Add an option to control zstd usage and
set the default to the same as the current behaviour (i.e. auto).
Fixes#1579
Signed-off-by: Chris Packham <judge.packham@gmail.com>
In GDB 10.x gdbserver was promoted to the top-level folder,
see https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=919adfe8409211c726c1d05b47ca59890ee648f1
Which means it is no longer a subfolder in "gdb" and so we have to
build gdbserver now exactly in the same way as normal native GDB.
One interesting detail is gdbserver doesn't need to deal with target
description in .xml so it doesn't depend on libexpat on target,
thus we need to move libexpat explicit selection from do_gdb_backend()
to its callers when building native [full] gdb as well as cross-gdb
for the host.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
[cp: support old/new layout, regenerate patches]
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Older ARC700 processors had atomic instructions (AKA llock/scond)
as an option and so quite some "atomic" operations were not possible
w/o OS support, which we implemented - see arc_usr_cmpxchg() in the
Linux kernel.
And in uClibc, which was the only Linux libc back in the day of ARC700
era, it is well supported. Well, uClibc could be configured to support it.
Which is done with CONFIG_ARC_HAS_ATOMICS Kconfig option.
But the problem is there's no check for ARC ISA version in uClibc when
this option gets enabled. That leads to a funny situation when even for
ARCv2 processors (ARC HS3x & HS4x) uClibc tries to utilize
arc_usr_cmpxchg() syscall which is not supported for this newer ISA since
ARCv2 processors have atomic instructions built-in all the time.
So what was happening here we didn't specify additional "-matomic"
CFLAG unless we were targeting exactly those ancient ARC770 processors
(ARC700 + MMUv3 + atomics) and so even for ARCv2 we forced uClibc
to not use built-in atomics.
And even though there're ways to add a smarter solution here to handle
that pretty rare by now case of ARC750 (ARC700 + MMUv2 - atomics),
I suggest we just remove this part completely, leaving a possibility
to add needed option in uClibc-ng's configuration
(I mean "packages/uClibc-ng/config").
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Various configurations end up using these companion tools (particularly
those with GNU libc). Ensure we download these tools at the start of the
build.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
The gcc-pru package in BeagleBoard Debian image has been using the
"pru-" prefix for a few years now. Let's not add unnecessary confusion
for users, and stick to "pru-" cross toolchain prefix.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Changes since v0.5.0:
* Add spec files for am64x SoCs.
* Require Binutils at least version 2.37.
* Require pru-gcc to be installed.
* Remove linker scripts. Instead set memory sizes from specs.
* Activate --gc-sections linker option by default.
* The "--host=pru" configure option must be used instead of "--target=pru.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
The spec file was missing replacing various libs like libc, libm, etc
with their nano equiv when CT_NEWLIB_NANO_INSTALL_IN_TARGET=y. Update
the nano.spec file that is generated to rename libc, libm, etc if
CT_NEWLIB_NANO_INSTALL_IN_TARGET=y
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
After commits 21095fab6 and acce58834, 'make dist-create-release' fails.
1. kconf_id.c is gone but it is still listed in EXTRA_DIST.
2. Only the files not listed in xxx_SOURCES need to be placed in
EXTRA_LIST. confdata.c, expr.c and others were previously not compiled
separately, they were #include'd from parser.y. Now they are listed in
xxx_SOURCES and should be removed from EXTRA_DIST. Note that menu.c is
still #include'd through parser.y, so it is kept.
3. parser.tab.c and lexer.lex.c should not be included in the
distribution tarball; they were previously omitted by virtue of not
being listed in xxx_SOURCES directly. Without it, `make distcheck`
fails.
Signed-off-by: Alexey Neyman <aneyman@lynx.com>
Since 1.6.2, picolibc has had two releases - 1.7 and 1.7.1. Here are
the release notes from those versions.
1. Add __cxa_atexit implementation to 'picoexit' path as required by
C++
2. Fix lack of 'hh' support in integer-only tinystdio printf path.
3. Fix tinystdio __file flag initialization for C++ apps
1. Merge libc and libm into a single library. Having them split
doesn't offer any advantages while requiring that applications add
'-lm' to link successfully. Having them merged allows use of libm
calls from libc code.
2. Add hex float format to *printf, *scanf and strto{d,f,ld}. This is
required for C99 support.
3. Unify strto{d,f,ld} and *scanf floating point parsing code. This
ensures that the library is consistent in how floats are parsed.
4. Make strto{d,f,ld} set errno to ERANGE on overflow/underflow,
including when the result is a subnormal number.
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit updates the patching process such that the local patches
can be applied in a version-independent manner, as with the patches
provided by the crosstool-ng packages.
This is done by reading the patch files from
`${CT_LOCAL_PATCH_DIR}/(package_name)` rather than from
`${CT_LOCAL_PATCH_DIR}/(package_name)/(version)`.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
cdn.kernel.org automatically redirects to a geographically close mirror.
Make use of this instead of www.kernel.org or mirrors.edge.kernel.org.
While were at it make sure we use https.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Issue #1535
GCC 10 changed the default to -fno-common, which leads to a linking error in GLibc older than 2.30.
This change adds -fcommon cflag for the target GLibc versions <=2.29 and GCC >=10.
This change also adds additional cflags for the target GLibc to disable
new GCC11 checks that lead to compilation errors.
Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>