Commit Graph

2116 Commits

Author SHA1 Message Date
c-grant
f11d4d9c1e Add gnatls & gnatlink
add gnatls and gnatlink to list of tools since it is needed to support Ada just like gnatmake and gnatbind

Update crosstool-NG.sh & TODO

Signed-off-by: c-grant <60671494+c-grant@users.noreply.github.com>
2023-11-02 20:48:03 +13:00
Quentin Boswank
cf6b1740a1 Add more caching to the CI
more specificaly to the tarballs download. The function CT_Fetch now
touches the already existing files to be comparable to the not used ones
that can araise when a package is updated.
This comparsion is needed because if it would not exist the tarball
would grow in size due to not used but still cached packages.
This would take time but is definitly something to worry about.

Signed-off-by: Quentin Boswank <qubos@outlook.de>
2023-10-04 16:12:23 +13:00
Chris Copeland
6146b5a640 use -all-static when building a static gdb
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>
2023-09-24 16:12:58 +13:00
Norbert Lange
dc82a2bfac Add a musl variable LIBC_MUSC_EXTRA_CFLAGS
Signed-off-by: Norbert Lange <nolange79@gmail.com>
2023-09-24 16:10:02 +13:00
Norbert Lange
c91133acc1 fix toolchain build with linker plugins
older binutils dont automatically pick up plugins,
but need to manually use wrappers like gcc-ar.
This fix allows to compile the host toolchain with -ftlo
on debian stretch.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
2023-09-24 16:08:25 +13:00
Chris Packham
9473e7a481 glibc: Add option for building libcrypt
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>
2023-08-25 18:13:06 +12:00
Kirill K. Smirnov
fab9efd8fa gdb: fix build with recent ncurses
For mingw host a special macro NCURSES_STATIC must be defined.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2023-08-15 16:26:10 +12:00
Quentin Boswank
fd04f43617 Add option to re-enable ˋlibstdc++ˋ on avr targets.
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>
2023-08-14 16:12:12 +12:00
Kirill K. Smirnov
ada71ff2a0 Properly build multilib bare-metal RISC-V
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>
2023-07-14 14:01:08 +12:00
Timo Rothenpieler
0160064f00 Add default msvcrt options for mingw-w64
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2023-06-04 10:03:32 +12:00
Maksim Morozov
e9cd702a9f gdb: Static cross GDB is linked statically with std c++ library
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>
2023-05-31 20:20:32 +12:00
Yuriy Kolerov
1f1107feff gdb: Use a relative includedir for native gdb and gdbserver
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>
2023-05-28 09:29:36 +12:00
Yuriy Kolerov
f283bb6b1a mpfr: Add support of building MPFR for target
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>
2023-05-19 15:54:16 +12:00
Yuriy Kolerov
65e5960a39 gdb: Fix extra config variable name for native GDB
Variable native_extra_config must be used for configuration
options instead for extra_config for native GDB.

Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2023-05-19 15:53:17 +12:00
Yuriy Kolerov
ce6467faa1 newlib: Add missing linker options for nano.specs
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>
2023-05-10 17:30:15 +04:00
Keith Packard
c33c2bf04e picolibc: Allow default memory layout values to be configured
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>
2023-04-19 15:13:55 +12:00
Keith Packard
06faf2002e picolibc: Don't disable libstdc++ wchar_t for 1.8.1 or newer
Picolibc 1.8.1 has wchar_t stdio support, so libstdc++ can include
it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-19 15:13:55 +12:00
Bryan Hundven
db942c3d0d Add option for experimental bundled patches
This adds 3 new options to patch order:
* bundled + bundled_exp
* bundled + bundled_exp + local
* local + bundled + bundled_exp

The path for bundled experimental patches is: ${CT_LIB_DIR}/packages/${pkg_dir}/experimental
and patches that are still being reviewed, but not yet applied upstream
may be toggled with ENABLE_EXPERIMENTAL_BUNDLED_PATCHES.

Also fix modelines for editors on bootstrap and scripts/functions, and
fix mix whitespace in scripts/functions.

Closes: #1916

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2023-03-16 16:54:22 +13:00
Chris Packham
711e7bc114 binutils: Add binutils 2.40
https://sourceware.org/pipermail/binutils/2023-January/125671.html

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-03-08 16:54:34 +13:00
Joakim Nohlgård
1a362b5607 picolibc: Add configuration to select picolibc as the system libc
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>
2023-03-08 16:54:12 +13:00
Keith Packard
9e13e83068 gcc: Add --disable-wchar_t and --enable-stdio=pure for picolibc
Picolibc needs two additional gcc build options so that libstdc++
works correctly. When building picolibc as a companion library, those
are added in do_cc_libstdcxx_picolibc, but when built with picolibc as
the main C libary, those need to be added in the main GCC build.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-03-08 16:54:12 +13:00
Joakim Nohlgård
8a9d371d06 picolibc: Use ${CT_CC} for compiler
Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
2023-03-08 16:54:12 +13:00
Chris Packham
ee5a4026c3 gdb: Add gdb 13.1
https://sourceware.org/pipermail/gdb-announce/2023/000134.html
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-13.1-release

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-02-25 14:22:02 +13:00
Quentin Boswank
4cba299460 Add zstd to the companion libs
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>
2023-02-08 17:13:42 +13:00
Bryan Hundven
aa6cc4d7f1
Merge pull request #1763 from cpackham/tarball
Add option to build toolchain tarball
2023-01-16 11:11:52 -08:00
Marc Poulhiès
cdae8d0559 Enable support for building libgccjit
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>
2022-12-18 21:20:50 +13:00
Cupertino Miranda
db4b7179ed Add BPF architecture target support
BPF is a virtual machine and associated ISA that resides in the Linux
kernel.  Initially intended for user-level packet capture and filtering,
BPF is nowadays generalized to serve as a general-purpose infrastructure
also for non-networking purposes.

Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
2022-12-14 17:11:02 +13:00
Joakim Nohlgård
16f6112327 scripts/gcc: Add extra include dir with -idirafter
Fixes Canadian cross builds failing with missing include file 'stdio.h'
when building libstdc++ for a companion libc with system libc set to
LIBC_NONE.

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
2022-12-11 19:52:26 +13:00
Joakim Nohlgård
e04351d666 scripts/gcc: align test conditionals with rest of repo
Most scripts in crosstool-ng use [ -z "${string}" ] to check for empty
variables.

Deleted one duplicate declaration of the local exec_prefix

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
2022-12-11 19:52:26 +13:00
Joakim Nohlgård
4f5c57fdb3 Detect if a package src_dir is missing
If a user deletes the package directory under .build/src/ but fails to
remove the hidden stamp files the CT_DoExtractPatch function will detect
this, delete the stamps and perform the full extract-and-patch step.

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
2022-12-04 16:02:37 +13:00
Bryan Hundven
7008dd5591 Update config.{guess,sub}
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2022-10-27 21:28:42 +13:00
Chris Packham
76849bafe9 linux: Add 6.0.2 bump LTS
Add 6.0.2
Bump 5.19.2 ->  5.19.16
Bump 5.15.58 -> 5.15.74
Bump 5.10.134 -> 5.10.148
Bump 5.4.208 -> 5.4.218
Bump 4.9.325 -> 4.9.330
Bump 4.19.254 -> 4.19.261
Bump 4.14.290 -> 4.14.295

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-10-18 17:28:34 +13:00
Marc Poulhiès
d7e9f7453f Add the gdc compiler to the list of tools checked/linked
Add gdc to the tool list but leave it optionnal.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-10-16 13:12:33 +13:00
Dries Deschout
61c4ccac5c binutils: add option to build libopcodes for target
It provides functionality to disassemble executable binaries.

Signed-off-by: Dries Deschout <dries.deschout@dodeco.eu>
2022-10-02 13:07:42 +13:00
Chris Packham
1b47500875 cc/gcc: Use canon_prefix when dealing with moved libraries
${CT_PREFIX_DIR} may contain relative paths (e.g.
"${CT_TOP_DIR}/../x-tools/${CT_TARGET}"). Code added in commit d83a0036
("Add symlinks from the libraries' original location to the new one.")
didn't cope well with this. As we're already calculating
${cannon_prefix} make use of it when adding the symlinks. This avoids
any issues with ${CT_PREFIX_DIR}.

Fixes #1807
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-09-26 10:46:28 +13:00
Like Ma
a9f77be56f Add CC_GCC_ENABLE_DEFAULT_PIE
Enable Position Independent Executable as default

Pass --enable-default-pie to crossgcc's configure

Signed-off-by: Like Ma <likemartinma@gmail.com>
2022-08-19 22:02:11 +12:00
Jiajie Chen
e840986fa4 loongarch64: add initial loongarch support
This commit adds architecture support for LoongArch.

The toolchain currently only supports the 64-bit target
loongarch64-unknown-linux-gnu.

It has been tested to build with GCC 12.1, GDB 12.1, Glibc 2.36, Linux
5.19 and Binutils 2.39 as of Aug 2022.

Signed-off-by: Jiajie Chen <c@jia.je>
2022-08-19 22:01:34 +12:00
Norbert Lange
ee635cdf9a Fixes for libstdcxx-verbose option tristate
Make it proper "tristate" by not specifying the
option.

The config GCC_4_8_or_later was removed with
cc6b7fad46, so dont use it.
2022-07-11 19:50:29 +12:00
Chris Packham
f5e0d33ab4 Allow libsanitizer on architectures that support it
libsanitizer is only supported on selected architectures. Add
ARCH_SUPPORTS_LIBSANITIZER and have architectures select this option
based on the list of supported configurations from GCC's
libsanitizer/configure.tgt. Support for mips64 was added in GCC12 so
this is an additional condition for the mips architecture.

Fixes #1733

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-07-11 19:49:23 +12:00
Justin Chen
c97a785485 Switch CT_CC_{CORE_}SYSROOT_ARG to arrays
CT_CC_{CORE_}SYSROOT_ARG is being used both as an array and string. Switch everything
to be used as an array for consistency.

Signed-off-by: Justin Chen <justinpopo6@gmail.com>
2022-07-01 16:33:37 +12:00
Bryan Hundven
b9ee00e3cb Update config.sub and config.guess
./ct-ng updatetools

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2022-06-28 20:53:39 +12:00
Guillermo E. Martinez
8a1ef66776 glibc: configure adding debug symbols in glibc build
After building the cross toolchain and compile a simple C program,
objdump reports debug information even though -g modifier was not
used. These debug segments are in glibc library and CRT files. So
a new config entry: CT_GLIBC_ENABLE_DEBUG was added to control when
we want to add debug information to glibc, by default is enabled.

Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
2022-06-21 20:33:34 +12:00
Chris Packham
376a289777 Add option to build toolchain tarball
Add TARBALL_RESULT option that will produce a tarball of the final
toolchain to make it easier to deploy the toolchain to other machines.

The implementation uses `find | sort` instead of `tar --sort` because
this was introduced in GNU Tar v1.28, which is not available in some LTS
Linux distributions. This is  a variation of the command recommended
here: https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs

Closes #1262

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-06-15 21:51:58 +12:00
Marc Poulhiès
618affc789 Enable D language support
Enable D support as an experimental feature.
GDC becomes a build dependency when enabled.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-06-14 20:54:54 +12:00
Guillermo E. Martinez
3d706748b4 gcc: Fix compilation error in core C gcc compiler older than v5
When core gcc older than v5 is compiled it shows the error message:

Build failed in step 'Installing core C gcc compiler'
      called in step '(top-level)'

Error happened in: CT_DoExecLog[scripts/functions@376]
      called from: do_gcc_core_backend[scripts/build/cc/gcc.sh@627]
      called from: do_cc_core[scripts/build/cc/gcc.sh@210]
      called from: main[scripts/crosstool-NG.sh@697]

configure: error: in
`.../build/build-cc-gcc-core/fixincludes':
configure: error: C compiler cannot create executables

This patch disable `all-build-libcpp' target when core gcc
older than v5 is configured.

Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
2022-06-01 14:50:43 +12:00
Chris Packham
b510e062c4 gmp: Set CC_FOR_BUILD and CPP_FOR_BUILD
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>
2022-05-31 20:01:17 +12:00
Chris Packham
db6f703f52 gcc: Add 12.1
Add GCC 12.1 https://gcc.gnu.org/gcc-12/

The following patches from GCC 11.3.0 are no longer needed:
- 0005-arc-Update-ZOL-pattern.patch
- 0006-arc-Update-u-maddhisi4-patterns.patch
- 0007-arc-Fix-maddhisi-patterns.patch
- 0008-Darwin-aarch64-Initial-support-for-the-self-host-dri.patch
- 0009-libstdc-Check-for-TLS-support-on-mingw-cross-compile.patch

One new patch is needed to avoid issues building sh-unknown-elf:
- 0006-sh-Avoid-mb-m1-multilib-combination.patch

It is also necessary to build all-build-libcpp. This target exists as
far back as GCC 6 so has been done unconditionally.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-19 14:24:46 +12:00
Chris Packham
b17792c52c glibc: Reinstate support for the bundled ports
Commit 6d5227b6 ("Remove obsolete glibc 2.12.1") removed supports for
the separate glibc-ports but also removed GLIBC_USE_PORTS_ADDON. Glibc
versions up to 2.20 bundled support from some architectures in the ports
directory so GLIBC_USE_PORTS_ADDON is required to support these older
glibc versions.

Fixes #1736
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-18 10:38:11 +12:00
Chris Packham
2804d686bf duma: Add version 2.5.21
Add duma 2.5.21 and mark 2.5.15 as obsolete. While we're at it use the
versions hosted on github which requres new checksums for the 2.5.15
version because the generated tarballs are different.

It appears we don't need any of the patches we've been carrying for the
older version but we do need to pass CC_FOR_BUILD in addition to HOSTCC.
When 2.5.15 is removed we can drop HOSTCC (and DUMA_CPP, DUMA_SO).

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-15 11:21:22 +12:00
Stephanos Ioannidis
1da7698b7c newlib-nano: Fix include path for CT_NEWLIB_NANO_INSTALL_IN_TARGET
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>
2022-05-12 20:58:29 +12:00