summaryrefslogtreecommitdiff
path: root/scripts/build/cc
AgeCommit message (Collapse)AuthorFilesLines
2021-09-08Merge branch 'canadian-cross-build' of ↵Chris Packham1-13/+1
https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-07gcc: Don't mess with --with-host-libstdcxx if recent GCC (6+) is usedAlexey Brodkin1-8/+12
"--with-host-libstdcxx" option was removed in GCC 6.x, see [1] because of [2]. So it makes no sense to use it with later GCC versions. Frankly I don't like that implementation with yet another set of "if XXX", but since we still support GCC down to 4.8.5 what else we may do? Well, technically we may keep using things as they are now, because surprisingly GCC's configure script doesn't mind accepting meaningless options, but as a person who's looking at differences between various builds and drill-down to peculiarities of various config options, I'd prefer to not pollute configure with garbage. But for all the rest... well, it works now and maybe nodody else cares. [1] https://gcc.gnu.org/git/?p=gcc.git&a=commit;h=5dc85f7ec719a79ecfbcdd8563b07e5f0f365e65 [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67092 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-09-07gcc: Fix canadian cross building on older hostsAlexey Brodkin1-13/+1
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] https://github.com/crosstool-ng/crosstool-ng/commit/9c6c090d7b6f5a03213b8ac6bd33a5cb812ec4c4 [6] https://github.com/crosstool-ng/crosstool-ng/commit/08161250ed65a9b91d680a305d01acd8052f937f Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-08-29cc/gcc: Add options for zstd usageChris Packham1-0/+5
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>
2021-07-06Add EXTRA_CXXFLAGS_FOR_BUILD optionRaphael Catolino1-5/+8
Signed-off-by: Raphael Catolino <raphael.catolino@gmail.com>
2021-06-19gcc: Make CC_GCC_TM_CLONE_REGISTRY tristateChris Packham1-10/+10
Explicitly passing --disable-tm-clone-registry causes gcc to create a crtbegin.o with a zero-sized .init_array/.fini_array. This in turn causes ld to complain. Make CC_GCC_TM_CLONE_REGISTRY a tristate so if it's not explicitly enabled we can let ./configure decide. Fixes #1531 Fixes: 1e21a302 ("gcc: Add CT_CC_GCC_TM_CLONE_REGISTRY config") Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-06-09Merge pull request #1524 from ↵Chris Packham1-5/+36
stephanosio/gcc_custom_libstdcpp_cxx_flags_upstream Fix libstdc++ build options
2021-06-07gcc: Add CT_CC_GCC_TM_CLONE_REGISTRY configStephanos Ioannidis1-0/+12
This commit adds a new gcc config `CT_CC_GCC_TM_CLONE_REGISTRY` that enables the GCC transactional memory clone registry feature for libgcc. Note that the gcc option to control this feature is only available in gcc 10 and above. (see gcc commit 5a4602805eb3ebddbc935b102481e63bffc7c5e6) Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-07gcc: Allow setting custom target CXXFLAGSStephanos Ioannidis1-3/+26
This commit adds two additional arguments (`cxxflags_for_target` and `extra_cxxflags_for_target`) for the gcc backend build function that can be used to specify custom target CXXFLAGS. By default, the target CXXFLAGS is set to the target CFLAGS. When `cxxflags_for_target` is specified however, it overrides that behaviour and allows setting different target CXXFLAGS from the target CFLAGS. The `extra_cxxflags_for_target` argument can be used to specify the extra target CXXFLAGS to be appended to the target CXXFLAGS. This is useful when it is necessary to append CXX-specific flags to the existing CFLAGS to be used as the target CXXFLAGS. A useful application of this is building full and nano versions of libstdc++ with different target CXXFLAGS as necessitated by `nano.specs`. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-07gcc: Assume '-O2' by default for building gcc target librariesStephanos Ioannidis1-3/+11
The gcc target libraries (e.g. libstdc++) are currently built without any optimisation flag when `CT_CC_GCC_ENABLE_TARGET_OPTSPACE` is not enabled and default to `-O0` unless user explicitly specifies an optimisation flag. This commit updates the gcc build script to assume `-O2` for building target libraries unless user provides a different optimisation flag. Note also that this is the default behaviour for gcc when C[XX]FLAGS_FOR_TARGET is not overridden. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-03-17Extend CC_GCC_LIBSSP with manual stateIvan Kukhta1-10/+10
Signed-off-by: Ivan Kukhta <Ivan.Kukhta@acronis.com>
2021-01-13Merge branches 'elijahr-dtc-1.6.0', 'elijahr-readme-typo', ↵Chris Packham1-7/+77
'foss-for-synopsys-dwc-arc-processors-abrodkin-libgmp-for-mac' and 'keith-packard-picolibc-companion'
2021-01-12gcc: Add support for building libstdc++ with alternate libcKeith Packard1-7/+77
This adds another mode to do_gcc_core_backend that builds libstdc++ against an alternate libc implementation. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-12-23gcc: Make it aware of Newlib nano IO featureAlexey Brodkin1-0/+5
Even though GCC as a compiler has nothing to do with a C library being used it still makes sense to know about Newlib's compact implementation of IO functions: * For targets like MSP430 which require to have such a tuned Newlib if "-mtiny-printf" is passed to the GCC's command-line [1] * For correct compilation of the following GCC's own DejaGnu tests [2]: - gcc/testsuite/gcc.c-torture/execute/920501-8.c - gcc/testsuite/gcc.c-torture/execute/930513-1.c - gcc/testsuite/gcc.dg/torture/builtin-sprintf.c - gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=02afb6a9321fbfb435452636cedc2cd43f0c4fd2 [2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=571bbd0d48d5872eacbd0b681fce6e1ae754520b So we add that missing cross-dependency now. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-02-26Set --with-cpu-{32,64} for multilib buildsAlexey Neyman1-2/+2
GLIBC 2.31 needs --with-cpu=ultrasparc for both 32/64-bits now, and --with-cpu only sets the CPU model for the "primary" bitness. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-04-05Rename JOBSFLAGS -> CT_JOBSFLAGSAlexey Neyman1-15/+15
... so that it is saved/restored when restarting the build. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-02-20Duh! do not override ${cflags}Alexey Neyman1-2/+3
... in the backend function with ${CFLAGS_FOR_HOST}. The caller either supplies them already, or (in case of pass-1/2 of the canadian cross) passes ${CFLAGS_FOR_BUILD} there. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-02-18Use -idirafter instead of copying headers.Alexey Neyman1-13/+20
Signed-off-by: Alexey Neyman <stilor@att.net>
2019-02-13Implement an option to store downloads in subdirsAlexey Neyman1-2/+2
... following the buildroot model. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-01-15Canonicalize prefix dir and sysrootAlexey Neyman1-5/+14
... because GCC prints the sysroot with symlinks resolved. Fixes #892. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-12-11Add a symlink to LTO for binutilsAlexey Neyman1-0/+14
... so that ar can find the plugin even when invoked directly, not via the gcc-ar plugin. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-12-07Set ALL_TARGET_CFLAGS initially for !MULTILIBAlexey Neyman1-21/+23
Fixes #1107. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-11-03Merge pull request #985 from antmak/platform_headersAlexey Neyman1-6/+5
Use the platform headers in the pass-2 and canadian gcc stages
2018-10-22Supply "very old" and "very new" glibc versionsAlexey Neyman1-1/+5
... as 1.0 and 99.99, respectively, to gcc configure. Fixes #1031. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-06-12Use the platform headers in the pass-2 and canadian gcc stagesAnton Maklakov1-6/+5
2018-06-05Avoid adding arch/cpu/tune flags for target to GCC buildAlexey Neyman1-3/+9
... as it may need to override them for building runtime-selectable code. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-02-12cc/gcc: use correct sysroot arg for do_gcc_core_backendM1cha1-1/+2
This fixes gccs LIMITS_H_TEST detection for baremetal targets so limits.h will be installed correctly. Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
2017-09-28Add an ability to verify the digest/signatureAlexey Neyman1-1/+2
Fixes #611. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-03Workaround for static uClibc-ng issue with -lpthreadAlexey Neyman1-2/+9
Also, preserve .config when running test-package.sh. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-03Super-H multilib toolchain fixesAlexey Neyman1-1/+1
1. On SuperH, configuring GCC with explicit variant of the CPU (like "sh4") limits the default set of multilibs to just that CPU and requires --with-multilib-list to change. Allow for "unspecified" variant, so that we can defer to GCC to determine the list. 2. Support toolchains with both endiannesses at the same time. 3. Add a SuperH/newlib sample 4. Add more flags processing for uClibc Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-01config: Add package versioning flexibilityNathan Chancellor1-2/+2
Some users (like myself) may want to omit the crosstool-NG version from the binaries' versioning output, as it can be incredibly long and not too helpful. Add a config option to disable it. The possible combinations are as follows: - crosstool-NG version (default) - crosstool-NG version - custom toolchain ID - Custom toolchain ID - No crosstool-NG version OR custom toolchain ID Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-08-26Fix glibc-ports with the new frameworkAlexey Neyman1-1/+3
While here, also consider patched by anything other than "bundled patches" as per-target sources. Add scary warnings in case of a failure. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-08-22Fix PPC64LE by supplying --with-glibc-versionAlexey Neyman1-0/+10
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-08-21Save export status for environment varsAlexey Neyman1-2/+2
... and limit our modifications to our variables. Fixes #762. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-08-19Use per-package list of formats to determine downloadsAlexey Neyman1-1/+1
Fixes #789 Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-10Resolve a few more TBDsAlexey Neyman1-4/+5
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Some locations were missed while renaming kconfig symbolsAlexey Neyman1-7/+6
... because there the symbols were constructer part by part. Also, remove cc.sh and source $(CT_CC).sh directly - we only build a single compiler at a time. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Building packages using the new frameworkAlexey Neyman1-0/+1
(fails at building GMP off the VCS because it needs to run bootstrap scripts) Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Fix the references to old config variablesAlexey Neyman1-33/+11
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-06-16Honor CFLAGS_FOR_BUILDAlexey Neyman1-1/+1
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-05-25Retire CT_CC_GCC_TARGET_FINALAlexey Neyman1-8/+4
Make this behavior default in case the core gcc backend is used for final compiler (i.e., for baremetal configurations). Not setting this option breaks canadian baremetal configurations, and not setting it makes little sense at all in any baremetal configuration (since in baremetal we don't have any libc to begin with). Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-29Add symlinks from the libraries' original location to the new one.Alexey Neyman1-0/+3
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-27Fix up the sysroot issue for sh4 in a different wayAlexey Neyman1-52/+2
(see the comments in the code for details on the issue) Old workaround in 100-gcc.sh stopped working (probably, due to one of GCC version upgrades), so switch to the other approach originally described there: adjust the list of multilibs to not include the default target explicitly. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-23Do not create multilib symlinks if not using sysrootAlexey Neyman1-1/+1
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-17Add an option to "demultilib"Alexey Neyman1-20/+38
It turns out buildroot does not currently accept a toolchain where a dynamic linker does not reside in the multi-os-directory. Unfortunately this is how glibc installs itself on AArch64 without any extra tricks. So, provide an option to force everything into /lib or /usr/lib; patch to buildroot will be worked on separately. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-13Create ld.so.confAlexey Neyman1-1/+1
Also a fix for CT_IterateMultilibs: it didn't pass multi_os_dir_gcc, so it only worked if the caller did *not* declare it as a local variable. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-10When moving gcc libs, prefer the same directory as libcAlexey Neyman1-3/+12
If libc ended up in a directory other than /lib, place GCC's libs in that directory as well. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-07Only add clang-specific flags to clangAlexey Neyman1-4/+32
I.e., only to CFLAGS_FOR_BUILD if the build is canadian. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-27Revert "Determine whether -E/-r option selects extended regexp"Alexey Neyman1-1/+1
This reverts commit 7bcf18bfab84374d3305c7a088f95ac1219ddf93.
2017-02-21Added new gcc config option CC_GCC_CONFIG_TLSJasmin Jessich1-0/+12
Adding new tristate configuration for TLS (Thread Local Storage) to add "--enable-tls" (y), "--disable-tls" (n) or nothing (m). Signed-off-by: Jasmin Jessich <jasmin@anw.at>