aboutsummaryrefslogtreecommitdiff
path: root/scripts/build
Commit message (Collapse)AuthorAgeFilesLines
* HALF WORK!HEADmasterYuqian Yang21 hours1-0/+71
|
* Use -std=c17 for companion libs, which won't build with C23 standard, ↵Michał Zagórski2025-06-132-0/+4
| | | | | | default for gcc15 Signed-off-by: Michał Zagórski <zagura6+github@gmail.com>
* libc/glibc: Add workaround for makeinfo build issueChris Packham2025-06-041-0/+4
| | | | | | | | | Newer versions of makeinfo fail to build the older versions of the glibc manual triggering build failures. Add a workaround for this my disabling makeinfo for the glibc build where needed. Fixes #2358 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gcc: Add default pie support to do_gcc_backendChris Packham2025-05-301-0/+4
| | | | | | | | | This was added to do_gcc_core_backend but not do_gcc_backend so the final compiler didn't have the configuration. Fix this so that the setting affects bot the core and final compilers. Fixes #2362 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* Add the FPU options for SuperHQBos072025-05-071-24/+14
| | | | | | A lot of the old code didn't even work Signed-off-by: QBos07 <qubos@outlook.de>
* companion_libs: Make picolibc build compatible with 1.8.10Keith Packard2025-04-261-6/+18
| | | | | | | | | | | | | | | | | | | | | Picolibc 1.8.10 reworked the configuration option for single/multi thread support and removed some unused options for exit handler support. Map LIBC_PICOLIBC_MULTITHREAD to the new single-thread option or the old newlib-retargetable-locking+newlib-multithread options depending on whether the picolibc version knows about the single-thread option. Remove support for newlib-register-fini, newlib-atexit-dynamic-alloc, newlib-global-atexit and lite-exit options as all of those relate to the legacy exit handler code. There hasn't ever been any way to enable this using crosstool-ng, so none of these options have ever done anything. The help strings for each of of the unused configuration variables have been updated. Signed-off-by: Keith Packard <keithp@keithp.com>
* picolibc: Add LIBC_PICOLIBC_GCC_LIBSTDCXX_TARGET_CXXFLAGSKeith Packard2025-04-261-0/+3
| | | | | | | This provides additional flags used when building libstdc++ for picolibc. Signed-off-by: Keith Packard <keithp@keithp.com>
* gcc: Add CC_GCC_LIBSTDCXX_TARGET_CXXFLAGSKeith Packard2025-04-261-0/+1
| | | | | | | | | This parallels the newlib-nano setting, NEWLIB_NANO_GCC_LIBSTDCXX_TARGET_CXXFLAGS, and provides a place to specify options that control how libstdc++ is build, such as -fno-exceptions. Signed-off-by: Keith Packard <keithp@keithp.com>
* Fix missing $ for variableQuentin Boswank2025-04-161-1/+1
| | | | | | | Fixes https://github.com/crosstool-ng/crosstool-ng/issues/2321 Credit to @jimbomorrison for spotting it. Signed-off-by: Quentin Boswank <qubos@outlook.de>
* arch: Add support for RX gcc buildDuy Nguyen2025-04-041-0/+5
| | | | Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
* Fix disabled libstdc++-v3Quentin Boswank2025-03-101-2/+2
| | | | | the config var is unset and not just `n`. Signed-off-by: Quentin Boswank <qubos@outlook.de>
* contrib/gcc-test-suite: Add configuration options including qemu setupKeith Packard2025-03-011-2/+11
| | | | | | | | | | This makes the options necessary to run the gcc test suite configurable in the crosstool-ng config file. That includes the ability to run the test suite using qemu instead of on a remote host. Signed-off-by: Keith Packard <keithp@keithp.com>
* ncurses: Pass --disable-widec to configureChris Packham2025-02-241-0/+2
| | | | | | | | | The default for wide char support has changed in ncurses-6.5. This causes build failures for gdb. Pass --disable-widec to prevent the build errors. Fixes #2292, #2294 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* lm32: Initial LatticeMicro32 supportJiaxun Yang2025-01-071-0/+6
| | | | | | | | This target is in GCC/binutils for a while. It's baremetal only without upstream Linux support. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
* openrisc: Initial OpenRISC 1000 supportJiaxun Yang2025-01-071-0/+6
| | | | | | | | This target is in GCC/binutils/Linux/Glibc/musl for a while. Baremetal/glibc/musl toolchains are all build tested. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
* picolibc: Avoid build system headersChris Packham2025-01-051-0/+1
| | | | | | | | | | When building picolibc as a companion library the configure step can end up picking up certain headers from the build system which causes build failures. Pass an appropriate --with-headers= to the GCC back end when building picolibc as a companion library so that the correct headers are detected by ./configure. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gcc: Support plugins in core gcc compilerChris Packham2025-01-051-0/+6
| | | | | | | | | When building for bare metal only do_gcc_core_backend() is used. In order to support GCC plugins the --enable-plugin needs to be passed to GCC's configure. Fixes #2244 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* Cleanup old avr-libstdcxx code and make it usable on other targetsQBos072024-12-232-21/+39
| | | | | | | | | | Should not cause major unwanted behavior changes - C++ is now selected by default in many configs. Signed-off-by: QBos07 <qubos@outlook.de> [cp: depend on CC_LANG_CXX instead of select] Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gdb/gdbserver: use -static --static for static buildMichał Zagórski2024-12-161-1/+3
| | | | | | | With gdb15.2 gdb uses libtool for linking, but gdbserver is not. Should not break #2230 or #2053 Signed-off-by: Michał Zagórski <zagura6+github@gmail.com>
* gdb: build native gdb with static libexpatMichał Zagórski2024-12-161-1/+7
| | | | | | | Use --with-libexpat-type=static to search for static libexpat in gdb native. This should fix #2230. Signed-off-by: Michał Zagórski <zagura6+github@gmail.com>
* mold: tell cmake which compilers to useMike Lundy2024-11-171-0/+2
| | | | | | | The mold build was using gcc in the PATH, instead of the shiny gcc we just built (the way the other companion libs/tools do) Signed-off-by: Mike Lundy <mlundy@splunk.com>
* initial support to build tricore gccjferreir2024-11-101-0/+9
| | | | | | | | | | Add support for Tricore architecture. TriCore architecture is optimized for real-time embedded systems. More information can be found at AURIX™ TC3xx Architecture vol 1 https://www.infineon.com/dgdl/Infineon-AURIX_TC3xx_Architecture_vol1-UserManual-v01_00-EN.pdf?fileId=5546d46276fb756a01771bc4c2e33bdd Signed-off-by: jferreir <jesus.ferreira@gmail.com>
* gdb: fix GDB_CC_LD_LIBTOOL referencedemin.han2024-10-161-1/+1
| | | | | | | GDB_CC_LD_LIBTOOL doesn't exist and so else branch always taken. We should use CT_GDB_CC_LD_LIBTOOL. Signed-off-by: demin.han <demin.han@starfivetech.com>
* gcc: Specify '--with-headers' when building final gccStephanos Ioannidis2024-10-061-0/+1
| | | | | | | | | | | | | | The final gcc build process was relying on `CT_CC_SYSROOT_ARG` to provide the `--with-headers` argument pointing to the libc header directory. Since `CT_CC_SYSROOT_ARG` no longer provides `--with-headers`, this adds one directly to the final gcc build invocation. Without this, gcc build system will not copy all the required libc headers into the `sys-include` directory. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
* companion_libs: zstd: Build nomt configurationChris Packham2024-09-091-1/+1
| | | | | | | | | | | | | We have been building the multi threaded zstd target. This requires that anything that links with lzstd also links with lpthread. On more recent systems this is fine because lpthread is part of GNU libc so the -pthread option is a no-op but on other systems this will cause GCC to either fail to build or to silently disable zstd compression. By building the libzstd.a-nomt-release we can be compatible with older GCC versions and ensure that support for zstd is not silently dropped. Fixes: #2198 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* binutils: Allow gold to be statically linkedChris Packham2024-07-291-0/+17
| | | | | | | | | | | gold uses g++ to link which doesn't recognise -all-static. It appears as if -static should work for both libtool and g++ but for some reason it doesn't. Remove the restriction that gold can't be included in a static toolchain. When a static toolchain is requested pass --with-gold-ldflags=--static to configure. Finally build gold separately so it does not get the extra_make_flags which may contain -all-static. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* Optimize zstd we buildQuentin Boswank2024-06-171-13/+3
| | | | | | | - multithreading enabled - release mode Signed-off-by: Quentin Boswank <qubos@outlook.de>
* Add mold linker buildArnaud Vrac2024-06-052-0/+76
| | | | | | | | | | | | | | | Allows building the #mold linker, which can then be used in the cross-toolchain by passing the -fuse-ld=mold to the gcc flags. It is much faster than ld or gold. This requires a C++20 compiler and cmake. Initially implemented by Arnaud, and HC added configure check for cmake. Outstanding task to validate compiler is C++20 compatible. Signed-off-by: Arnaud Vrac <avrac@freebox.fr> Signed-off-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
* Allow for Runtime-less build of GDC and GNATMarc Poulhiès2024-06-051-1/+25
| | | | | | | | | | | | Both D and GNAT have their own runtimes (resp. libphotos and libada). It is still possible to build the compiler proper without any runtime, and have an external runtime installed later. This is most commonly found in embedded systems. An example for D is: https://github.com/KitsunebiGames/tinyd-rt An example for Ada: https://github.com/Fabien-Chouteau/bare_runtime Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
* Disable implicit-function-declaration error for newlibNik Konyuchenko2024-05-181-0/+3
| | | | | | | | | GCC14 will treat implicit-function-declaration as an error by default. See https://gcc.gnu.org/gcc-14/porting_to.html for details. Some libc function like __trap34 are defined in assembly and break this GCC diagnostic. Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
* mingw-w64: enable wildcardMateusz Mikuła2024-04-241-0/+1
| | | | | | Wildcard is an opt-in (disabled by the default) feature that is used by many GNU tools like Binutils. Signed-off-by: Mateusz Mikuła <mati865@gmail.com>
* gdb: Use correct libexpat for native buildChris Packham2024-03-131-10/+1
| | | | | | | | | | The native gdb needs the version of libexpat built for the target. On some systems gdb's configure will find the one from the build machine. Use --with-expat= to point at the correct one for the target. Fixes: 2092 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gnuprumcu: Pass host sysroot to build toolchainDimitar Dimitrov2024-03-111-1/+18
| | | | | | | | | | | | | | | | | | | | | | In canadian builds, the target toolchain running on the build machine is not compiling and installing target Newlib. Thus it cannot by itself link target executables. This results in errors for gnuprumcu package when its configure script attempts to test the compiler: .../ld: cannot find crt0.o: No such file or directory configure:3738: error: C compiler cannot create executables Fix by passing the host toolchains's sysroot in target CFLAGS. While at it, also add a missing passing of target LDFLAGS. Successfully tested the following canadian builds: x86_64-unknown-linux-gnu,pru x86_64-w64-mingw32,pru arm-unknown-linux-gnueabihf,pru Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
* glibc: fix the broken build for glibc 2.19 with gcc 13.Hao Li2024-03-011-2/+2
| | | | | | macos silicon SDK does not contain stat64 (and other LFS extension), and glibc 2.19 makes use of it. Signed-off-by: Hao Li <hayatelee@gmail.com>
* gdb: Fix extra config variable name for cross GDBChris Packham2024-03-011-2/+2
| | | | | | | | | Similar to commit 65e5960a ("gdb: Fix extra config variable name for native GDB") we need to use cross_extra_config for the options we're passing to the gdb build when cross compiling. Fixes: 5463ab4b ("gdb: Add gdb-10.2") Signed-off-by: Chris Packham <judge.packham@gmail.com>
* Revert "binutils: Disable glob for better portability"Chris Packham2024-03-011-4/+0
| | | | | | | | | | | | | | This reverts commit 57f59092852dff18fbda68fdbf23f850ad182c40. This was originally added so that a toolchain could be built on a newer system but run on an older one. With the benefit of hindsight that is probably the wrong approach. The best way of achieving that goal would be to use docker/podman container to provide an environment that is the same as the oldest supported system and build inside that. The resulting toolchain should be compatible with the old system and the new one. Closes #2094 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gdb: Explicitly point to target's libgmp for native buildAlexey Brodkin2024-01-301-0/+8
| | | | | | | | | | | | | | | Starting from GDB 11.x, gmp is needed as a dependency to build full gdb. And by default build system of native GDB will try to link with libgmp of the build host. And to make sure that doesn't happen we need to specify location of the target's sysroot so that library search starts from there. Which we do in that change. Fixes [1] & [1]. [1] https://github.com/crosstool-ng/crosstool-ng/issues/2084 [2] https://github.com/crosstool-ng/crosstool-ng/issues/1656 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* Fix zlib build on win32 near enviromentsQuentin Boswank2023-12-181-2/+0
| | | | | | | We set some variables for linking zlib to '' which we shouldn't do. Let the Makefile sort these things out. Signed-off-by: Quentin Boswank <qubos@outlook.de>
* scripts/build/binutils: Update path for libbfdChris Packham2023-12-081-1/+1
| | | | | | | | | As of binutils 2.41 libbfd.a is not placed directly in the output directory. Fortunately the libtool .libs location seems to have been in place for some time so we can update the path without worrying about backwards compatibility. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* Add support for 32 and 64-bit PA-RISC linux build targets.John David Anglin2023-11-251-0/+14
| | | | | | | Note: The 64-bit target lacks a glibc port and doesn't build. Also, there is no uclibc support. Signed-off-by: John David Anglin <dave.anglin@bell.net>
* gdb: Use correct arguments for static linkingChris Packham2023-11-021-1/+5
| | | | | | | | | | | | As of version 13.x GDB uses libtool for linking instead of g++ these take different arguments for static linking. Commit 6146b5a6 ("use -all-static when building a static gdb") attempted to deal with this but had the effect of causing older GDB versions to fail to build statically. Add a new internal flag GDB_CC_LD_LIBTOOL and use this to decide whether to pass `-static` or `-all-static`. Fixes #2053 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* use -all-static when building a static gdbChris Copeland2023-09-241-2/+8
| | | | | | | | | | | gdb is linked with libtool, which has a different meaning for -static, and -all-static must be used to get a static executable. The binutils build script already uses this option for static builds. Also remove unnecessary -static from cflags for the gdb build. Signed-off-by: Chris Copeland <chris@chrisnc.net>
* Add a musl variable LIBC_MUSC_EXTRA_CFLAGSNorbert Lange2023-09-241-2/+5
| | | | Signed-off-by: Norbert Lange <nolange79@gmail.com>
* glibc: Add option for building libcryptChris Packham2023-08-251-0/+4
| | | | | | | As of glibc-2.38 libcrypt is not built by default. Add an option to allow building libcrypt support into glibc. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gdb: fix build with recent ncursesKirill K. Smirnov2023-08-151-1/+8
| | | | | | For mingw host a special macro NCURSES_STATIC must be defined. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
* Add option to re-enable ˋlibstdc++ˋ on avr targets.Quentin Boswank2023-08-142-18/+52
| | | | | | | | | | | Due to the small flash space on AVR devices the library containing the standard types in C++ (ˋlibstdc++ˋ) does not get built normally when enabling the C++ language support. This option is an easy way to go back to the PC-way where ˋlibstdc++ˋ is built. Signed-off-by: Quentin Boswank <qubos@outlook.de>
* Properly build multilib bare-metal RISC-VKirill K. Smirnov2023-07-141-0/+6
| | | | | | | | | To build multilib RISC-V toolchain one should use --with-multilib-generator option instead of --with-multilib-list. Add corresponding example configuration file. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
* Add default msvcrt options for mingw-w64Timo Rothenpieler2023-06-041-1/+19
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* gdb: Static cross GDB is linked statically with std c++ libraryMaksim Morozov2023-05-311-1/+2
| | | | | | | | | | If static cross GDB configuration is selected, cross GDB will be linked statically with std c++ library, because there is no separate option for static std c++ library for cross GDB. The use of not existing variable CT_GDB_NATIVE_STATIC_LIBSTDC has been replaced with CT_GDB_NATIVE_STATIC_LIBSTDCXX. Signed-off-by: Maksim Morozov <maxim.morozov.a@gmail.com>
* gdb: Use a relative includedir for native gdb and gdbserverYuriy Kolerov2023-05-281-2/+13
| | | | | | | | | | Use a relative path for include directory if gdb or gdbserver is being built and installed for a target. Otherwise headers are installed in ${destdir}${CT_HEADERS_DIR} - a concatenation of ${destdir} and an absolute path to sysroot's include directory. As a result debug-root may contain wrong paths for includes. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>