Commit Graph

1574 Commits

Author SHA1 Message Date
Chris Packham
584b25da7a glibc: Disable -Werror with GCC13 and glibc <2.37
GCC13 picks up some new errors on older glibc versions. Disable -Werror
automatically when these combinations are selected.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-05-14 10:35:14 +12:00
Chris Packham
5427dac45c libc/uclibc: Require GCC12 or older
Currently uclibc configurations fail to build with GCC13

 src/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc: In function 'std::from_chars_result std::from_chars(const char*, const char*, _Float128&, chars_format)':
 src/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:1281:10: error: 'from_chars_strtod' was not declared in this scope
     1281 |   return from_chars_strtod(first, last, value, fmt);
          |          ^~~~~~~~~~~~~~~~~
    make[6]: *** [Makefile:587: floating_from_chars.lo] Error 1
    make[6]: *** Waiting for unfinished jobs....

For now require GCC older than 13 when using uclibc.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-05-14 10:35:14 +12: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
James Knight
b42079e92a config/arch/x86: enable libsanitizer
GCC's libsanitizer module does provide a subset of support for x86
targets (e.g. libasan). GCC's `libsanitizer/configure.tgt` file only
outlines flags for optional sanitizers.

Signed-off-by: James Knight <james.d.knight@live.com>
2023-04-13 11:15:49 +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
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
287fccb8bc gcc: Don't set --enable-default-pie by default
This changes how existing crosstool-ng setups work, causing many of
the bare-metal ones to fail.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-02-27 16:31:18 +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
4b60bea2e9 gcc: Disable CC_GCC_ENABLE_DEFAULT_PIE on RISC-V bare metal builds
-pie is not supported on riscv*-elf-ld

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
2022-12-11 18:41:51 +13:00
Marc Poulhiès
20e33c9ec9 Correct casing for Ada lang
Ada is a name, not an acronym, so it doesn't need to be upcased.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-11-09 20:35:46 +13:00
Bryan Hundven
658f5e574f Update requirements: autoconf==2.71 and automake>=1.16
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2022-10-27 21:28:42 +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
Dimitar Dimitrov
411b052361 avr,pru: Disable CT_CC_GCC_ENABLE_DEFAULT_PIE
PIE is not supported by PRU and AVR backends for GCC.

This fixes LD errors when trying to link user programs with a
crosstool-NG toolchain:

  /home/dinux/x-tools/avr/lib/gcc/avr/12.2.0/../../../../avr/bin/ld: -pie not supported
  collect2: error: ld returned 1 exit status

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-09-26 10:47:31 +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
Like Ma
55d8c43333 Select KERNEL_SUPPORTS_SHARED_LIBS on Windows
Fix building MinGW only generating libstdc++.a

Signed-off-by: Like Ma <likemartinma@gmail.com>
2022-08-19 22:00:58 +12:00
Chris Packham
29b6e00368 binutils: Add binutils 2.39
https://sourceware.org/pipermail/binutils/2022-August/122246.html

Add binutils 2.39 and regenerate patches.
0008-binutils-2.38-vs.-ppc32-linux-kernel.patch is dropped as it has
been applied upstream. Add a milestone for 2.39 which will be handy for
Loongarch.

Binutils now requires bison >= 3.0.4 to build gprofng for x86/aarch64 so
we build our own bison when the host bison does not meet that
requirement (which appears to be the case on macOS).

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-08-14 10:15:17 +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
Chen Tao
75c8a08a3a newlib: fix conflicting configure options
Configuring the newlib with "--enable-newlib-nano-formatted-io" and
"--enable-newlib-io-pos-args" would cause built GCC cannot compile some
IO functions like "std::cout".

And I added additional notes at Nano Formatted I/O config.

Signed-off-by: Chen Tao <t.clydechen@gmail.com>
2022-06-28 20:54:26 +12:00
Chen Tao
c368525d5b kconfig: modify rules for multilibs configuration
fix conflict options when compiling multilibs on ARM based architecture.
"--with-arch", "--with-cpu", "--with-fpu", "--with-float", and
"--with-mode" should not be configured with "--with-multilib-list=list"
when configuring multilibs.

Signed-off-by: Chen Tao <t.clydechen@gmail.com>
2022-06-28 20:53:01 +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
Chris Packham
f6d3f498f0 gcc: Disable zstd for canadian builds
We don't currently bundle zstd so when performing a canadian build we
need to tell GCC not to enable zstd support for lto otherwise it might
decide to enable it based on the package being installed on the build
machine.

Fixes #1718
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-31 20:01:48 +12:00
Chris Packham
a321a0b892 glibc: rework GLIBC_ENABLE_WERROR
Use `depends on` conditions to enable/disable building glibc with
-Werror. Using `depends on` instead of `default if` means that when the
GCC/GLIBC selection changes GLIBC_ENABLE_WERROR will automatically
become n.

Fixes #1729, fixes #1712
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-31 20:00:38 +12:00
Chris Packham
dec3d3a421 gcc: Update fix for sh-unknown-elf
Extend the fix from commit 6b465e15 ("Remove m1 from multilibs for GCC11
on SH arch.") to cover GCC 12 and future releases.

Remove the patch that was added to solve the same problem.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-31 20:00:00 +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
86b6448891 linux: Add 5.17.5, bump LTS
Add 5.17.5
Bump 5.16.9 -> 5.16.20
Bump 5.15.23 -> 5.15.37
Bump 5.10.100 -> 5.10.113
Bump 4.19.229 -> 4.19.241
Bump 4.14.266 -> 4.14.277
Bump 4.9.301 -> 4.9.312

Linux 5.5 made `make headers_check` a no-op and as of 5.17 it has been
removed so add a milestone and use it as a dependency for
KERNEL_LINUX_INSTALL_CHECK.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-16 19:23:47 +12:00
Chris Packham
3ac6f1791a gdb: drop obsolete versions
Drop gdb 7.11.1, 7.12.1, 8.0.1, 8.1.1 and 8.2.1. Cleanup milestones
related to these older versions.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-10 19:46:53 +12:00
Chris Packham
6d5227b63b Remove obsolete glibc 2.12.1
glibc 2.12.1 was marked as obsolete. Now that the 1.25.0 release is out
this version can be removed completely. As glibc 2.12.1 was the last
remaining version supported by glibc-ports support for glibc-ports is
also removed.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-10 19:46:53 +12:00
Chris Packham
53bbdc7425 Remove obsolete bionic/android support
The bionic libc support was out of date and relied on downloading
binaries from the internet. It was already marked as obsolete. Now that
the 1.25.0 release is out it can be completely removed.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-10 19:46:53 +12:00
Chris Packham
7e21141973 glibc: Enable -Werror for more combinations of GCC/GLIBC
Newer GCC versions trigger warnings on older GLIBC versions. GLIBC 2.29
is warning free with GCC9. GLIBC 2.31 is warning free with GCC10. GLIBC
2.34 is warning free with GCC11.

Add milestones for 2.31 and 2.34 and use those to set the default value
for GLIBC_ENABLE_WERROR based on the GCC version.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-01 12:02:54 +12:00
Anton Maklakov
06120b97ff xtensa: Remove obsoleted CT_ARCH_XTENSA_CUSTOM_NAME 2022-04-02 13:31:07 +13:00
Norbert Lange
ad3996a483 gcc: add gcc libstdcxx-verbose option
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-23 20:21:16 +13:00
Chris Packham
20044c0bf7 bionic: mark bionic/android-ndk as obsolete
Support for bionic was dropped by GCC some time ago. There are patches
for older GCC versions but those are difficult to maintain and the
version of the android-ndk they support is of little use. Mark all of
the existing bionic support as obsolete so it can be removed after the
next release.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-02-23 20:19:46 +13:00
Alexey Neyman
681aaef1f1
Merge pull request #1674 from stilor/master
Updates to make `ct-ng build-all` pass
2022-02-14 00:11:42 -08:00
Chris Packham
c5565f175a powerpc: Allow GCC 8.5 for SPE ABI
Support for the SPE ABI was removed in GCC 9. Update the select to
GCC_REQUIRE_older_than_9 so that GCC 8.5 can be selected.

Fixes #1349, fixes #1666

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-02-13 20:46:27 +13:00
Alexey Neyman
5a0be8b4ec Unify core passes
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-11 00:47:51 -08:00
Alexey Neyman
7b97bdd825 Convert tabs to spaces
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-02-11 00:47:51 -08:00
Alexey Neyman
c6ff1eca5b Restrict *-uclibc,* canadians to gettext 0.20
Newer gettext is incompatible with uClibc-NG in cross-compilation, see
the comment in the code.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
58da27c965 Restrict bionic's GCC/GDB selections
Refer to the comments in the code for the reason.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
4c0d78bb64 gdb: use single-number versions/milestones for 9+
Starting with GDB9, the release number is only two numbers (with the
last being patchlevel). Therefore, keep two numbers for releases 8 and
below, but just a single number for 9 and up.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
586c2d0156 sparc-leon: restrict to GDB9
Starting with GDB10, it requires support for std::future<> in the
compiler. Such support has not been available on some architectures
until GCC9 (see PR 64735). I haven't determined the exact list of
affected architectures, so decided to make it a broad dependency: for
GDB10+, you need GCC9+.

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
b4191b23a8 Update tic6x sample
Restrict kernel to 5.11 and below (support for this arch has been
dropped in 5.12); rename the sample to match its name as printed by
`ct-ng show-tuple` (otherwise, `make saveconfig` does not update the
sample's configuration).

Signed-off-by: Alexey Neyman <stilor@att.net>
2022-02-11 00:47:51 -08:00
Alexey Neyman
cc6b7fad46 Retire obsoleted milestones
... 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>
2022-02-11 00:47:50 -08:00
Norbert Lange
392955a293 Fix deterministic binutils option
Versions before 2.26 got removed in fa992b41, together with
CT_BINUTILS_2_23_or_later.
Remove reference to this variable

Signed-off-by: Norbert Lange <nolange79@gmail.com>
2022-01-30 21:08:25 +13:00