aboutsummaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* Optimize zstd we buildQuentin Boswank2024-06-171-13/+3
| | | | | | | - multithreading enabled - release mode Signed-off-by: Quentin Boswank <qubos@outlook.de>
* 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>
* 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>
* mpfr: Add support of building MPFR for targetYuriy Kolerov2023-05-191-3/+53
| | | | | | | | It's necessary for building native GDB 13+. It depends on MPFR but it hasn't presented in scripts yet for building for target. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
* newlib: Add missing linker options for nano.specsYuriy Kolerov2023-05-101-1/+1
| | | | | | | | Old options %(newlib_nano_link) for the linker must be passed otherwise linking may fail. E.g., in case of multilib configurations a correct emulation mode may be not passed. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
* picolibc: Allow default memory layout values to be configuredKeith Packard2023-04-191-0/+4
| | | | | | | | These values are used when constructing the default linker scripts used with picolibc. Setting reasonable defaults allows simple test applications to be compiled without additional configuration. Signed-off-by: Keith Packard <keithp@keithp.com>
* picolibc: Don't disable libstdc++ wchar_t for 1.8.1 or newerKeith Packard2023-04-191-1/+3
| | | | | | | Picolibc 1.8.1 has wchar_t stdio support, so libstdc++ can include it. Signed-off-by: Keith Packard <keithp@keithp.com>
* picolibc: Add configuration to select picolibc as the system libcJoakim Nohlgård2023-03-081-69/+83
| | | | | | | This moves the picolibc configuration values under C-library -> picolibc so that they will be more easily discovered. Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
* picolibc: Use ${CT_CC} for compilerJoakim Nohlgård2023-03-081-1/+1
| | | | Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
* Add zstd to the companion libsQuentin Boswank2023-02-081-0/+102
| | | | | | | | Add zstd to the companion libs witch allows to use lto zstd compression in a canadian or cross-native enviroment Signed-off-by: QBos07 <62326551+QBos07@users.noreply.github.com> Signed-off-by: Quentin Boswank <62326551+QBos07@users.noreply.github.com>
* Enable support for building libgccjitMarc Poulhiès2022-12-186-5/+39
| | | | | | | | | | | | | | | | | | | | | libgccjit is still under development and, despite its name, may also be used for ahead-of-time compilation. Documentation can be found on the gcc website: https://gcc.gnu.org/onlinedocs/jit/internals/index.html https://gcc.gnu.org/wiki/JIT With this change it's possible to enable the building of the libgccjit. It's enabled as a language (with --enable-languages=jit) even if not a language frontend at all. The main changes are related to the requirement of having everything host side built as Position Independent Code (PIC) with --enable-host-shared. GCC has the needed logic for building its dependencies (mpc, gmp, mpfr, ...) correctly when built "in-tree", which is not the case with crosstool-ng (see https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=05048fc29f0) Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
* gmp: Set CC_FOR_BUILD and CPP_FOR_BUILDChris Packham2022-05-311-2/+5
| | | | | | | | | When GMP is being "cross" compiled for the same architecture (i.e. build == host) it does not pick the right compiler. Set CC_FOR_BUILD and CPP_FOR_BUILD to override the default compiler. Fixes #1328 Signed-off-by: Chris Packham <judge.packham@gmail.com>
* newlib-nano: Fix include path for CT_NEWLIB_NANO_INSTALL_IN_TARGETStephanos Ioannidis2022-05-121-1/+1
| | | | | | | | | | | | | | | | | | When `CT_NEWLIB_NANO_INSTALL_IN_TARGET=y`, the `nano.specs` file emitted by the newlib-nano build script contains an invalid include path, resulting in the full `newlib.h` being included instead of the nano `newlib.h` by the application. `=/include/newlib-nano` is not a valid path (`=` does not mean anything and that string is taken as an include path as-is) and GCC ignores this include path, resulting in application including the `newlib.h` from `include/` which contains the newlib build configurations for the full newlib. This commit modifies the newlib-nano build script to emit a proper newlib-nano include path relative to the `GCC_EXEC_PREFIX`. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
* scripts/build/companion_libs: Fix missing directory with newlib-nanoDerald D. Woods2022-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With 'CT_NEWLIB_NANO_INSTALL_IN_TARGET=y', this build failure occurs: ---------------------------------------------------------------------- [...] [INFO ] Installing Newlib Nano library [EXTRA] Configuring Newlib Nano library [EXTRA] Building Newlib Nano C library [EXTRA] Installing Newlib Nano C library [INFO ] Installing Newlib Nano library: done in 110.66s (at 29:04) [INFO ] ================================================================= [INFO ] Installing libstdc++ newlib-nano [EXTRA] Configuring libstdc++ for newlib-nano [EXTRA] Building libstdc++ newlib-nano library [EXTRA] Installing libstdc++ newlib-nano library [EXTRA] Housekeeping for core gcc compiler [EXTRA] '' --> lib (gcc) lib (os) [EXTRA] ' -mthumb' --> lib/thumb (gcc) lib/thumb (os) [EXTRA] ' -marm -mfpu=auto -march=armv5te+fp -mfloat-abi=hard' --> lib/arm/autofp/v5te/fpu (gcc) lib/arm/autofp/v5te/fpu (os) [EXTRA] ' -mthumb -mfpu=auto -march=armv7+fp -mfloat-abi=hard' --> lib/thumb/autofp/v7/fpu (gcc) lib/thumb/autofp/v7/fpu (os) [INFO ] Installing libstdc++ newlib-nano: done in 457.12s (at 36:42) [ERROR] [ERROR] >> [ERROR] >> Build failed in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@376] [ERROR] >> called from: newlib_nano_copy_multilibs[scripts/build/companion_libs/350-newlib_nano.sh@270] [ERROR] >> called from: CT_IterateMultilibs[scripts/functions@1608] [ERROR] >> called from: do_newlib_nano_for_target[scripts/build/companion_libs/350-newlib_nano.sh@254] [ERROR] >> called from: do_companion_libs_for_target[scripts/build/companion_libs.sh@43] [ERROR] >> called from: main[scripts/crosstool-NG.sh@697] Current command: 'cp' '-f' '/build/toolchain/arm-none-eabi/newlib-nano/arm-none-eabi/lib/thumb/libc.a' '/build/toolchain/arm-none-eabi/arm-none-eabi/lib/thumb/libc_nano.a' exited with error code: 1 Please fix it up and finish by exiting the shell with one of these values: 1 fixed, continue with next build command 2 repeat this build command 3 abort build ---------------------------------------------------------------------- This commit calls 'mkdir -p' to create the destination path before copying. Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
* Convert tabs to spacesAlexey Neyman2022-02-112-21/+21
| | | | | | | Recent changes introduced a mixture of tabs/spaces that result in broken indentation in multiple places. Signed-off-by: Alexey Neyman <stilor@att.net>
* Restrict *-uclibc,* canadians to gettext 0.20Alexey Neyman2022-02-111-0/+22
| | | | | | | Newer gettext is incompatible with uClibc-NG in cross-compilation, see the comment in the code. Signed-off-by: Alexey Neyman <stilor@att.net>
* Retire obsoleted milestonesAlexey Neyman2022-02-112-15/+0
| | | | | | | | | | | | ... and the code dependent on them, after the latest wave of obsolete package removals. This concludes the glorious history of the original uClibc (non-NG) with lots of kludges removed. There was a choice here, whether to call the resulting libc "uClibc" or "uClibc-ng". I opted in favor of giving uClibc-ng the recognition it deserves, although it had some ripple effect in the ct-ng code. Signed-off-by: Alexey Neyman <stilor@att.net>
* gmp: Support building for targetChris Packham2021-09-191-2/+30
| | | | | | | Allow GMP to be build for the target. This will be needed by the up coming gdb-11. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* gnuprumcu: Bump to v0.6.0Dimitar Dimitrov2021-08-221-5/+4
| | | | | | | | | | | | 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>
* newlib-nano: Fix nano.spec based on CT_NEWLIB_NANO_INSTALL_IN_TARGETKumar Gala2021-07-301-1/+28
| | | | | | | | | 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>
* picolibc: Disable wchar_t use in libstdc++Keith Packard2021-07-131-0/+1
| | | | | | | Picolibc doesn't support wchar_t in stdio, so disable the use of these functions from libstdc++. Signed-off-by: Keith Packard <keithp@keithp.com>
* newlib: Add libstdc++ nano-specific CXXFLAGSStephanos Ioannidis2021-06-071-0/+3
| | | | | | | | | | | This commit adds a new config that can be used to specify the target CXXFLAGS specific to the libstdc++ newlib-nano variant. By default, this config is set to specify the `-fno-exceptions` option, which disables C++ exception handling support and greatly reduces the compiled binary size. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
* Merge branch 'abrodkin-newlib-nano-relocatable' of ↵Chris Packham2021-04-191-3/+3
|\ | | | | | | git://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng
| * newlib-nano: Use run-time calculated paths in top-level nano.specsAlexey Brodkin2021-04-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In currently generated top-level "nano.specs" we resolve paths during toolchain building and then use those pre-defined full paths once the toolchain got built. That's OK until the toolchain is used right were it was built, otherwise paths used in the top-level "nano.specs" become irrelevant and linker fails to find "nano" libs reverting to non-"nano" libs in the default location. See https://github.com/crosstool-ng/crosstool-ng/issues/1491. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* | newlib-nano: Add option to copy libs into targetKumar Gala2021-04-151-0/+25
| | | | | | | | | | | | | | | | | | | | | | Add an option that will install a copy of newlib-nano lib*.a file in the target dir but renamed with a nano.a suffix (eg: libc_nano.a) as some default nano.spec files from newlib expect this setup. Additionally the newlib-nano version of newlib.h will get copied to include/newlib-nano/newlib.h. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
* | newlib-nano: remove whitespace from nano.spec fileKumar Gala2021-04-151-1/+1
|/ | | | | | Remove trailing whitespace from generated nano.spec file. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
* newlib-nano: Create symlinks for nano-suffixed libsAlexey Brodkin2021-02-191-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If existing board's .specs are used for linking of a user's application, then instead of normally used libs like libc.a & libstdc++.a might be requested their "nano"-suffixed siblings: libc_nano.a, libstdc++_nano etc. That way: ----------------------------->8--------------------------- %rename link_gcc_c_sequence myboard_link_gcc_c_sequence *myboard_libc: %{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} *link_gcc_c_sequence: %(myboard_link_gcc_c_sequence) --start-group %G %(myboard_libc) --end-group ----------------------------->8--------------------------- Our companion newlib-nano libs are all built optimized for size, so we'd like to use them for linking. But given linker will see "-lc_nano -lstdc++_nano" on its command line non-suffixed libs will be ignored. To solve it we create those "_nano"-suffixed libraries as simple symlinks to existing libs.. Fixes https://github.com/crosstool-ng/crosstool-ng/issues/1458. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* Merge pull request #1448 from dinuxbg/masterChris Packham2021-01-251-0/+89
|\ | | | | Add PRU target configuration
| * Add package with PRU linker scripts and headersDimitar Dimitrov2021-01-191-0/+89
| | | | | | | | | | | | | | | | Include the gnuprumcu package in PRU cross toolchain. Toolchain is somewhat useless without device specs and linker scripts for the various SoCs. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
* | newlib-nano: Build libstdc++ against newlib-nano if requestedKeith Packard2021-01-141-0/+45
| | | | | | | | | | | | | | This uses the gcc support for building libstdc++ using alternate lib header files. Signed-off-by: Keith Packard <keithp@keithp.com>
* | Create nano.spec file that sits atop the existing nano buildKeith Packard2021-01-141-0/+16
| | | | | | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* | Add newlib-nano as companion libKeith Packard2021-01-141-0/+128
|/ | | | | | | This allows building newlib-nano in addition to newlib and picolibc, allowing users to select between C libraries within the same toolchain. Signed-off-by: Keith Packard <keithp@keithp.com>
*-. Merge branches 'elijahr-dtc-1.6.0', 'elijahr-readme-typo', ↵Chris Packham2021-01-132-0/+179
|\ \ | | | | | | | | | 'foss-for-synopsys-dwc-arc-processors-abrodkin-libgmp-for-mac' and 'keith-packard-picolibc-companion'
| | * picolibc: Build libstdc++ against picolibc if requestedKeith Packard2021-01-111-0/+46
| | | | | | | | | | | | | | | | | | | | | This uses the gcc support for building libstdc++ using alternate lib header files. Signed-off-by: Keith Packard <keithp@keithp.com>
| | * picolibc: Convert to companion libraryKeith Packard2021-01-081-0/+124
| |/ |/| | | | | | | | | | | This allows configurations to include picolibc without excluding another C library. Signed-off-by: Keith Packard <keithp@keithp.com>
| * libgmp: Fix cross-canadian build for macOSAlexey Brodkin2020-12-231-0/+9
|/ | | | | | | | | | | | | | | | | Currently when building cross-canadian toolchain for macOS the folowing error happens when GCC is configured: |ld: illegal text-relocation to '___gmp_binvert_limb_table' in |... /.build/... /buildtools/complibs-host/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in |... /.build/... /buildtools/complibs-host/lib/libgmp.a(dive_1.o) |collect2: error: ld returned 1 exit status Apparently this might be solved with GMP configured with "--with-pic", even though we're talking about static library here. That solution was found here: https://github.com/Homebrew/homebrew-core/pull/25470 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* Rename JOBSFLAGS -> CT_JOBSFLAGSAlexey Neyman2019-04-0410-15/+15
| | | | | | ... so that it is saved/restored when restarting the build. Signed-off-by: Alexey Neyman <stilor@att.net>
* Move GDB build into a common backend functionAlexey Neyman2019-03-091-1/+1
| | | | | | | ... needed to create a common runtime test for an incompatible change in glibc API. Signed-off-by: Alexey Neyman <stilor@att.net>
* expat: Build without docbookBernhard Walle2019-02-201-0/+1
| | | | | | | | | | | | | This fixes following build error on Debian 9: configure: error: Your local docbook2man was found to work with SGML rather than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point configure to command docbook2x-man of docbook2X. Or use DOCBOOK_TO_MAN="xmlto man --skip-validation" if you have xmlto around. You can also configure using --without-docbook if you can do without a man page for xmlwf. Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
* Config v2: select relevant parts of each package versionAlexey Neyman2019-01-301-5/+3
| | | | | | | Also, remove a couple of config options that dealt with package versions that have been since retired. Signed-off-by: Alexey Neyman <stilor@att.net>
* Avoid adding arch/cpu/tune flags for target to GCC buildAlexey Neyman2018-06-053-3/+3
| | | | | | ... as it may need to override them for building runtime-selectable code. Signed-off-by: Alexey Neyman <stilor@att.net>
* Ncurses fixes for 6.1Alexey Neyman2018-01-291-2/+7
| | | | | | | | | | | - Update to 20180129 - Throw in --disable-db-install if database is disabled; otherwise 'make install' tries to run tic which is not built. - Select appropriate strip utility for the host; otherwise non-x86 architectures fail to install (unless --disable-stripping is also added) Signed-off-by: Alexey Neyman <stilor@att.net>
* Add -D__GLIBC__ to target CFLAGSAlexey Neyman2017-09-303-0/+3
| | | | | | | | ... when using musl to compile strace. Also, honor CT_TARGET_CFLAGS in scripts compiling target libs/binaries. Signed-off-by: Alexey Neyman <stilor@att.net>
* expat 2.2.4 dropped INSTALL_ROOTAlexey Neyman2017-09-291-1/+1
| | | | | | ... in favor of its alias, DESTDIR. Before, it supported both. Signed-off-by: Alexey Neyman <stilor@att.net>
* Fix the references to old config variablesAlexey Neyman2017-07-0811-67/+35
| | | | Signed-off-by: Alexey Neyman <stilor@att.net>
* Switch comp.libs/tools and debug to new framework.Alexey Neyman2017-07-083-4/+6
| | | | Signed-off-by: Alexey Neyman <stilor@att.net>
* Fix debuild warnings/errorsAlexey Neyman2017-06-071-0/+0
| | | | | | | | | | | | | | | | | | | | - Update .gitignore, do not place .gitignore into directories installed in bulk - Remove executable permissions and shebangs from the scripts that are supposed to be invoked only via ct-ng frontent; prepend them with $(bash). Despite what showSamples.sh said, it already has some bashisms. - Remove --with autotools-dev and override dh_update_autotools_config to avoid having config.{sub,guess} clobbered with older versions - Install bash completion where Debian (now) expects it - Update man page to use .\" as the comment delimiter, instead of undefined macro (."); also, minor text edits. - Install kconfig.mk without execute permission. - Remove shell wrappers from 170-localedef-fix-trampoline.patch, we do not use that for applying patches - Revoke execute permissions on 210-expat.sh - Get flags from dpkg-buildflags if available Signed-off-by: Alexey Neyman <stilor@att.net>
* Handle ming32 as a hostAlexey Neyman2017-05-241-14/+35
| | | | | | | | | | | zlib refuses to run configure with mingw32 host and insists that win32/Makefile.gcc is used instead. This requires a change in this Makefile to support static-only builds. Fixes #694. Signed-off-by: Alexey Neyman <stilor@att.net>