Commit Graph

5465 Commits

Author SHA1 Message Date
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
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
a3e3d734a7 configure.ac: bison is required for kconf
Make the requirement for bison harder (but not strict). The system bison
will be used to build kconf. If the system bison is not GNU bison 2.7 or
later crosstool-ng will build GNU bison as a companion tool if necessary
(for glibc 2.29 or newer).

Fixes #1621
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-06-13 20:52:43 +12:00
Chris Packham
2f0d1f334f gcc: Add gcc 9.5.0
Add GCC 9.5.0 and regenerate the patches as necessary.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-06-08 19:38:05 +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
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
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
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
Guillermo E. Martinez
2d6d22d96d Add Oracle ol8u6 product to crosstool-ng
This commit adds support for the following Oracle products, in order
to target Oracle Linux 8.6:

Binutils 2.30-113.0.1
GCC      8.5.0-10.0.2
glibc    2.28-189.1.0.1
UEK5/u4  4.14.35-2025.400.8

Sample configuration files are provides for the following triplets:

aarch64-ol8u6-linux-gnu
x86_64-ol8u6-linux-gnu
i686-ol8u6-linux-gnu

Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
2022-05-31 19:59:32 +12:00
Chris Packham
b88d338516 glibc: backport fix for vfork on mips
glibc-2.23 fails to build for mips with

  nptl/libpthread.so:(*IND*+0x0): multiple definition of `vfork@GLIBC_2.0';

This was fixed in glibc-2.24. Backport the fix for glibc-2.23.

Fixes #1744
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-26 12:51:48 +12:00
Chris Packham
23580a86aa gcc: drop libsanitizer patch for GCC12
For some reason GCC 12 ends up hitting the _MIPS_SIM_NABI32 case for
Linux's arch/mips/include/uapi/asm/stat.h when building libsanitizer.
This is basically the opposite of the problem from
commit 1b6ad7cd ("gcc: Bring in fix for libsanitizer on mips64").
Dropping the patch resolves the issue for GCC 12.

Fixes #1741
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-23 20:51:45 +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
1b6ad7cd48 gcc: Bring in fix for libsanitizer on mips64
The kernel's struct stat is 104 bytes when compiling for
_MIPS_SIM_ABI64. Set struct_kernel_stat_sz to match.

Fixes #1733

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-18 20:17:01 +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
5937024455 gdb: Add 12.1
Add gdb 12.1 release.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-16 19:23:47 +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
020507e7e5 duma: Add checksums for 2_5_21
These were unintentionally omitted when the new version was added.

Fixes: 2804d686 ("duma: Add version 2.5.21")
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-16 19:23:16 +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
Chris Packham
318d6b1aec testing/docker: Document policy
Some useful suggestions were made in commit 5411e69b ("Update the docker
containers"). This captures them in a more visible place.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-15 11:19:49 +12:00
Chris Packham
8825cfc2ab testing/docker: Add ubuntu:22.04
Add ubuntu:22.04 remove ubuntu:21.10.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-15 11:19:49 +12:00
Hans-Christian Noren Egtvedt
1dd4a4fd28 Create unified diff when refreshing patch files in manage-packages.sh
The unified diff patch format will contain slightly more information,
which is helpful when rebasing patches to new releases.

Signed-off-by: Hans-Christian Noren Egtvedt <hegtvedt@cisco.com>
2022-05-15 11:19:11 +12:00
Keith Packard
4ad0620fcd Add sample arm-none-eabi
This is the triplet used by the Arm Embedded Toolkit as well as
Debian.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-05-12 20:58:57 +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
Derald D. Woods
396f23d3de scripts/build/companion_libs: Fix missing directory with newlib-nano
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>
2022-05-12 20:58:03 +12:00
Joel Holdsworth
fd694dde63 cc/gcc: Create liblto_plugin symbolic link with correct extension
Previously, cc/gcc.sh assumed that liblto_plugin would always be
installed with the ".so" file extension. However, this assumption is
incorrect when the host machine is Windows (".dll") or MacOS (".dylib").

This patch corrects this issue by probing the file extension in similar
fashion to the way adjacent code determines the file extension of
executable binaries.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2022-05-11 20:25:42 +12:00
Joel Holdsworth
d10a4318ac cc/gcc: Ensure value of ext is always set
The "ext" variable is set with the file extension of executable binaries
for a given platform. To improve tidiness, this patch ensures the
variable is always set even when there is no file path.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2022-05-11 20:25:42 +12:00
Joel Holdsworth
d824983203 cc/gcc: Declare "file" and "ext" variables local
In do_gcc_core_backend and do_gcc_backend, variables "file" and "ext"
are used to store intermediate values. Previously, these were not
declared local. This patch corrects this issue.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2022-05-11 20:25:42 +12:00
Joel Holdsworth
da1ffd0412 cc/gcc: Remove -lstdc++ and -lm from gcc LDFLAGS
In Bryan Hundven's patch 1ad439907 from 2010, the author added -lstdc++
and -lm to the host gcc build's LDFLAGS, because at the time the linker
did not correctly include these libraries causing the build to fail.

In modern builds, this causes a problem for canadian gcc builds where
the host machine is mingw32-w64 Windows.

Within the gcc build there is the liblto_plugin module. On Windows this
must be built as the "liblto_plugin.dll" dynamic library. However,
libtool cannot produce a dynamic library unless every library dependency
is also a dynamic library, and falls back to producing a libstdc++.a
static library. liblto_plugin does not require libstdc++ - it
does not contain any C++ code, and the dependency would usually be
elided by the linker.

Unfortunately, in this case, crosstool-ng will never build a
libstdc++.dll dynamic library - only a libstdc++.a static library.
Therefore, there will never be a dynamic library version of stdc++ for
libtool to load and then discard.

This patch corrects the issue by removing "-lstdc++" from LDFLAGS,
because modern versions of gcc are able to correctly include libstdc++
where necessary. It also remove "-lm" for similar reasons.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2022-05-11 20:25:42 +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
c693d62b12 strace: drop obsolete versions
strace aims to be backwards compatible with older kernels so we don't
actually need to have every strace version. The 4.15-4.26 versions were
technically in a ct-ng release so they were obsoleted. Now that the
1.25.0 release is out we can remove these versions.

Going forward we will obsolete the version that is in the latest ct-ng
release and simply remove intervening strace versions as they are
released.

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
e8c4d97683 avr-libc: Update vcs URL
The avr-libc project has moved to github and is now using git. Update
the repository field accordingly.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-08 13:37:41 +12:00
Chris Packham
fcea8e33ac mpfr: Update vcs URL
The mpfr project is now using git. Update the repository field
accordingly.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-08 13:37:41 +12:00
Chris Packham
aa46366fc3 gcc: Update vcs URL
The GCC project has been using git for a while now. Update the
repository field accordingly.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-05-08 13:37:41 +12:00
Dima Krasner
31cc2e56d5 musl: add 1.2.3
Signed-off-by: Dima Krasner <dima@dimakrasner.com>
2022-05-08 13:37:03 +12:00
Hans-Christian Noren Egtvedt
3c94c6c678 gcc: bump GCC 11 to latest release 11.3.0
Remove patches applied upstream we no longer need to maintain here.

Signed-off-by: Hans-Christian Noren Egtvedt <hegtvedt@cisco.com>
2022-05-08 13:29:34 +12:00
Johan Levin
8fa98eeeff populate: Include dependencies of PIE executables
Modern versions of the 'file' utility give different output for position
dependent and position independent executables. The populate tool should
consider both types.

Signed-off-by: Johan Levin <johan13@gmail.com>
2022-05-08 09:48:44 +12:00
Dima Krasner
b6887d346f scripts/functions: collect license files named COPYRIGHT*
Signed-off-by: Dima Krasner <dima@dimakrasner.com>
2022-05-03 20:53:36 +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
Chris Packham
dd4d19fce2 zlib: Update to zlib-1.2.12
Bring in the following changes

- Fix a deflate bug when using the Z_FIXED strategy that can result in
  out-of-bound accesses.
- Fix a deflate bug when the window is full in deflate_stored().
- Speed up CRC-32 computations by a factor of 1.5 to 3.
- Use the hardware CRC-32 instruction on ARMv8 processors.
- Speed up crc32_combine() with powers of x tables.
- Add crc32_combine_gen() and crc32_combine_op() for fast combines.

Drop two patches that have been applied upstream and regenerate the
remaining two.

Fixes #1708

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-04-22 10:15:41 +12:00
Elliot Saba
7f84b9ab92 [scripts/functions]: Fix quoting issue in comparison
On my Ubuntu machine (with `dash` version `0.5.10` and `bash` version `5.0.17`),
I would get errors such as the following:

```
crosstool-ng/scripts/functions: line 730: [: !=: unary operator expected
```

This is generally because a variable is not set, and expands to an empty string
causing the test operator to mis-parse the expression.  To fix this, I have
added quotes around the variable.

Signed-off-by: Elliot Saba <staticfloat@gmail.com>
2022-04-22 10:15:04 +12:00
Chris Packham
429e6d8e88 testing/docker: Add meson and ninja to containers
meson and ninja are needed to build picolibc.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-04-21 15:12:31 +12:00
Keith Packard
6ddf9e8dbf Update picolibc to 1.7.6
* Fixes 1.7.4 issue with recent meson versions which error on
  'descrption' typo.

* Positional parameters (%$1d) in printf/scanf

* Lots (and lots) of math library exception/errno fixes; now tested against
  glibc test suite.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-02 13:31:28 +13:00
Anton Maklakov
06120b97ff xtensa: Remove obsoleted CT_ARCH_XTENSA_CUSTOM_NAME 2022-04-02 13:31:07 +13:00
Chris Packham
a8d2c2e1fa Enable posix threads in i686-w64-mingw32
Posix threads are enabled in the x86_64-w64-mingw32 sample having them
enabled in i686-w64-mingw32 makes things consistent for these targets.

Fixes #1696

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-04-02 13:30:46 +13:00
Anton Maklakov
6cd16639b9 gcc: add fixes for GCC 11.2. Anon and aggregated struct access 2022-03-28 21:01:58 +13:00
Anton Maklakov
bfda65e00e gcc: rename patches to order 2022-03-28 21:01:58 +13:00
Chris Packham
1e47ca1e70 gcc: powerpc: Fix asm machine directive for some CPUs
Bring in upstream fix for gcc outputting an incorrect .machine
directive.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-02-28 20:59:33 +13:00