summaryrefslogtreecommitdiff
path: root/scripts/build/cc/gcc.sh
AgeCommit message (Collapse)AuthorFilesLines
2022-02-23gcc: add gcc libstdcxx-verbose optionNorbert Lange1-0/+10
Rather important option for arm cortex toolchains supporting c++, avoids pulling in all printf/iostream code by default. Signed-off-by: Norbert Lange <nolange79@gmail.com>
2022-02-11Unify core passesAlexey Neyman1-70/+15
With libc_headers step before pass-1, there is no need to distinguish pass-1 and pass-2; they are configured identically (note that with the current configuration, core pass-2 is only used for win32 - hence, uses build_libgcc=yes and mode=static). Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11Convert tabs to spacesAlexey Neyman1-20/+20
Recent changes introduced a mixture of tabs/spaces that result in broken indentation in multiple places. Signed-off-by: Alexey Neyman <stilor@att.net>
2022-01-12gcc: Build static libgcc in core_pass1Chris Packham1-0/+2
Per https://github.com/crosstool-ng/crosstool-ng/issues/808 build static libgcc in the first pass which lets us skip the second one. Building mingw-w64 requires header files in order to build C++ support so mingw builds core pass 2. This could probably be cleaned up by splitting libc_start_files into a separate libc_header step. But for now having core 2 for mingw-w64 and core 1 for the other libcs will have to do. Anything that previously selected CC_CORE_PASSES_NEEDED now selects CC_CORE_PASS_1_NEEDED. The same goes for CC_CORE_PASS_2_NEEDED with the exception of mingw-w64. Fixes #808 Fixes #217 Signed-off-by: Chris Packham <judge.packham@gmail.com>
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-0/+1156
Signed-off-by: Alexey Neyman <stilor@att.net>
2015-05-29multi_cc: Prepare ct-ng for multiple compilersRay Donnelly1-911/+0
This commit moves gcc.sh to 100-gcc.sh to accomodate for other cross-compilers that crosstool-ng might be able to build. The first, to come soon, is llvm/clang. Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Reviewed-by: Bryan Hundven <bryanhundven@gmail.com> Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
2015-04-07Only create ${CT_TARGET}-cc${ext} symlink if ${CT_TARGET}-gcc existsJohannes Pfau1-2/+6
Without this canadion cross builds create invalid symlinks: When the code in do_cc_core_backend is called there is no ${CT_TARGET}-gcc in the install directory. Therefore ext is empty and we create a link to ${CT_TARGET}-gcc. The final compiler step then installs ${CT_TARGET}-gcc.exe and creates a working ${CT_TARGET}-cc.exe symlink but we still keep the invalid link as well. Signed-off-by: Johannes Pfau <johannespfau@gmail.com>
2015-02-02scripts/*/*.sh: prioritize http downloadsBryan Hundven1-3/+5
Prirotize http downloads before ftp downloads. By having http download first, those using proxy will work with the current download mechnism. This tells me that that mechnism needs to be updated. (proxy support and/or kconfig toggles) closes #3 Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-01-16gcc: Add Linaro GCC 4.9-2015.01 and GCC 4.8-2014.11Cristoforo Cataldo1-12/+13
This commit allows to choose, download and build latest Linaro GCC: - gcc-linaro-4.9-2015.01 - gcc-linaro-4.8-2014.11 Signed-off-by: Cristoforo Cataldo <cristoforo.cataldo@gmail.com>
2015-01-01cc/gcc: Remove copyheaders toggle in do_cc_core_backend, make defaultDavid Holsgrove1-8/+2
Canadian Cross compile for baremetal fails with error; checking for the value of EOF... configure: error: computing EOF failed which is due to libstdc++ configure not being able to find stdio.h Having all modes of the core compiler copyheaders from CT_HEADERS_DIR (in combination with previous patch for newlib to add a do_libc_start_files function to copy into the CT_HEADERS_DIR) resolves this. Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-12-09gcc and gdb: fix fetching linaro builds (part three)Bryan Hundven1-1/+2
Yes, I missed the backslash which messed up the linaro stuff. The more I look at this code, I feel it needs to be refactored a bit. So I'll come back to this in the future and clean it up. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2014-12-09gcc and gdb: fix fetching linaro builds (part two)Bryan Hundven1-1/+1
It's not my day. linaro_version is a filter. If it is not a linaro toolchain, it will just be CT_{CC,GDB}_VERSION. If it is a linaro toolchain, CT_{CC,GDB}_VERSION will be prefixed with 'linaro-' and will not match linaro_version, as linaro_version will just have the part after 'linaro-'. This *really* fixes the issue :sigh: Thanks again to @elsonwei for being right the first time! Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>