Commit Graph

1559 Commits

Author SHA1 Message Date
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
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
Chris Packham
f58583039f glibc: Re-enable Werror
Now that we have a 2-pass build it is no longer necessary to disable
-Werror in glibc.

This partially reverts commits 6ca5f91f ("Disable -Werror for GLIBC for
all ARCH for GCC11."), 215432d3 ("config/libc: Extend glibc 2.32
workaround to include sparc") and 645ee124 ("glibc: Don't build with
-Werror for powerpc64+glibc-2.32").

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-01-12 21:02:38 +13:00
Chris Packham
557b9d4f8d gcc: Build static libgcc in core_pass1
Per https://github.com/crosstool-ng/crosstool-ng/issues/808 build static
libgcc in the first pass which lets us skip the second one.  Building
mingw-w64 requires header files in order to build C++ support so mingw
builds core pass 2. This could probably be cleaned up by splitting
libc_start_files into a separate libc_header step. But for now having
core 2 for mingw-w64 and core 1 for the other libcs will have to do.

Anything that previously selected CC_CORE_PASSES_NEEDED now selects
CC_CORE_PASS_1_NEEDED. The same goes for CC_CORE_PASS_2_NEEDED with the
exception of mingw-w64.

Fixes #808
Fixes #217

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-01-12 21:02:38 +13:00
Chris Packham
5075e1f98e glibc: Add comment about python 3.4 dependency
Add a comment that is visible when the python3.4 prerequisite is not met
so that users can tell why they can't select a newer glibc version.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-11-30 19:56:44 +13:00
Chris Packham
f441a6bf0d linux: Add dependency on rsync for Linux >= 5.3
As of Linux v5.3 rsync is used as part of the build process. Add Linux
5.3 as a milestone, configure detection of rsync and a dependency on
rsync for Linux 5.3 and newer. Add a comment in so that users can tell
why they can't select a newer version.

Fixes #1628

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-11-30 19:56:44 +13:00
Alexey Brodkin
c46a6e809e ncurses: Use new v6 ABI by default
These days old v5 ABI is not that relevant as it used to be back in
2015 when ncurses 6.x was added to CT-NG.

And now we see say target "gdb" relying on "libncurses.so.5",
while up-to-date Buildroot provides "libncurses.so" & "libncurses.so.6":
--------------------------->8-------------------------
$ ldd /bin/gdb
        libncurses.so.5 => not found
        libstdc++.so.6 => /lib/libstdc++.so.6 (0x20022000)
        libm.so.6 => /lib/libm.so.6 (0x2017c000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x201ba000)
        libc.so.6 => /lib/libc.so.6 (0x201c8000)
        /lib/ld-linux-arc.so.2 (0x20000000)
--------------------------->8-------------------------

Switching to a default (v6 ABI) by default. And...
--------------------------->8-------------------------
$ ldd /bin/gdb
        libncurses.so.6 => /usr/lib/libncurses.so.6 (0x20022000)
        libstdc++.so.6 => /lib/libstdc++.so.6 (0x20054000)
        libm.so.6 => /lib/libm.so.6 (0x201ae000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x201ec000)
        libc.so.6 => /lib/libc.so.6 (0x201fa000)
        /lib/ld-linux-arc.so.2 (0x20000000)
--------------------------->8-------------------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-10-10 04:54:36 -07:00
Chris Packham
fa992b4191 binutils: Remove obsolete versions
The following versions were marked obsolete in crosstool-ng-1.24.0,
remove them.
- binutils-linaro-2.23.2-2013.10-4
- binutils-linaro-2.24.0-2014.11-2
- binutils-linaro-2.25.0-2015.01-2
- binutils-2.23.2
- binutils-2.24
- binutils-2.25.1

Adjust the milestones now that the old versions have been removed.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-21 21:24:31 +12:00
Chris Packham
9703e669d0 gdb: Remove old milestones
Now that the oldest supported version of gdb is 7.11.1 we can make some
parts of the build unconditional and remove the associated config vars.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-21 21:12:19 +12:00
Chris Packham
68088f65c6 gdb: Add gdb-11.1
Drop the uclibc-no-gettimeofday-clobber patch as it no longer applies.
The arc patches are all upstream.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-19 19:50:29 +12:00
Chris Packham
4b2b610b9a gmp: Support building for target
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>
2021-09-19 19:50:29 +12:00
Chris Packham
b346fa58b1 cc/gcc: Add options for zstd usage
GCC can support using zstd compression for LTO object files. By default
GCC's configure will enable this if libzstd is installed on the machine
building the toolchain. This may be undesirable if the toolchain is to
be used on a different machine. Add an option to control zstd usage and
set the default to the same as the current behaviour (i.e. auto).

Fixes #1579

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-08-29 21:27:29 +12:00
Alexey Brodkin
5463ab4bf6 gdb: Add gdb-10.2
In GDB 10.x gdbserver was promoted to the top-level folder,
see https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=919adfe8409211c726c1d05b47ca59890ee648f1
Which means it is no longer a subfolder in "gdb" and so we have to
build gdbserver now exactly in the same way as normal native GDB.

One interesting detail is gdbserver doesn't need to deal with target
description in .xml so it doesn't depend on libexpat on target,
thus we need to move libexpat explicit selection from do_gdb_backend()
to its callers when building native [full] gdb as well as cross-gdb
for the host.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
[cp: support old/new layout, regenerate patches]
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-08-25 10:12:56 +12:00
Raphael Catolino
c3b13ffdda Add EXTRA_CXXFLAGS_FOR_BUILD option
Signed-off-by: Raphael Catolino <raphael.catolino@gmail.com>
2021-07-06 16:19:17 +01:00
Nik Konyuchenko
aa98a2e2f3 Add fcommon flag help and remove extra empty lines
Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
2021-06-24 01:49:22 -07:00
Nik Konyuchenko
05c6758985 Fix build of older Glibc using GCC >=10
Issue #1535

GCC 10 changed the default to -fno-common, which leads to a linking error in GLibc older than 2.30.

This change adds -fcommon cflag for the target GLibc versions <=2.29 and GCC >=10.

This change also adds additional cflags for the target GLibc to disable
new GCC11 checks that lead to compilation errors.

Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
2021-06-24 00:58:32 -07:00
Chris Packham
96d8a0588f gcc: Make CC_GCC_TM_CLONE_REGISTRY tristate
Explicitly passing --disable-tm-clone-registry causes gcc to create a
crtbegin.o with a zero-sized .init_array/.fini_array. This in turn
causes ld to complain.

Make CC_GCC_TM_CLONE_REGISTRY a tristate so if it's not explicitly
enabled we can let ./configure decide.

Fixes #1531

Fixes: 1e21a302 ("gcc: Add CT_CC_GCC_TM_CLONE_REGISTRY config")
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-06-20 11:37:00 +12:00