Commit Graph

350 Commits

Author SHA1 Message Date
Chris Packham
8c1cdb94c1 glibc: Turn implicit-int back into warning
As of GCC14 implicit-int has been upgraded to an error. While this is
generally a good idea it trips up some older code (particularly in
autoconf generated configure scripts). Add -Wno-implicit-int to CFLAGS
for glibc when using an old GLIBC with a new GCC.

Fixes #2208
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2024-10-15 14:22:17 +13:00
Charles Baylis
efcfd1abb6 improve a workaround for a glibc and GNU make incompatibility
Versions of GNU make newer than 4.4 trigger a hang in versions of glibc
older than 2.31. In e63c40854c, this was
fixed when the host platform provided make >= 4.4. However, if the
host distro provides only an ancient version of make, crosstool-ng would
still build make 4.4 as a comp tool, which would fail to build glibc.

Extend the previous workaround to build make 4.3 when building old
glibc versions which require it.

See also: #1946

Signed-off-by: Charles Baylis <cbaylis@fishzet.co.uk>
2024-09-14 14:38:55 +12:00
Chris Packham
e58fd0a23e musl: Mark not EXPERIMENTAL
Musl was marked experimental in commit 08d91d41 ("musl: config is broken
for !EXPERIMENTAL"). Most of the reasoning for that change no longer
applies and as it's been about 8 years it's time to let musl loose on
the world. Drop the `depends on EXPERIMENTAL` and update the sample
configs for aarch64 and x86_64.

For powerpc64 the ABI needs to be elfv2. Enforce this via the powerpc
config.  Add a sample configuration for powerpc-unknown-linux-musl.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2024-05-24 10:14:13 +12:00
Chris Packham
2d9e263d1f glibc: Disable -Werror for GCC14
Current glibc versions don't compile without warnings with GCC14.
Disable -Werror for glibc when using GCC14.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2024-05-18 15:45:55 +12:00
John David Anglin
5f3a1ef166 Add support for 32 and 64-bit PA-RISC linux build targets.
Note: The 64-bit target lacks a glibc port and doesn't build. Also,
there is no uclibc support.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
2023-11-25 15:41:47 +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
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
Chris Packham
cd8a5b72b5 Revert "libc/uclibc: Require GCC12 or older"
This reverts commit 5427dac45c. The issues
that were causing this have been resolved with some updates so allow the
uclibc+gcc13 combination again.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-08-13 11:15:29 +12:00
Chris Packham
e63c40854c provide a workaround for a glibc and GNU make incompatibility
Versions of GNU make newer than 4.4 trigger a hang in versions of glibc
older than 2.31. As distros update to the newer GNU make version we'll
start seeing more and more reports of this hang. Fortunately we already
carry GNU make as a comp tool so all we need to do is select the right
version when needed.

Fixes #1946, #1932, #1975
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-07-21 16:47:34 +12:00
Chris Packham
227d99d7f3 newlib: add 4.3.0.20230120
Add the 4.3.0.20230120 and update the required patches. As of this
release the newlib-global-atexit is mandatory so set this to default y.
Included is an upstream patch to support older GCC versions.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-06-04 10:04:33 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
cc8c64a8dc glibc: --enable-obsolete-rpc has been removed as of 2.32
Make --enable-obsolete-rpc conditional on !GLIBC_2_32_or_later as
it's been removed from that version on.

Fixes: #1505
Fixes: commit 1ee44ab5 ("glibc: --enable-obsolete-rpc has been removed as of 2.32")
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-05-11 21:02:29 +12:00
spaun2002
6ca5f91fb5 Disable -Werror for GLIBC for all ARCH for GCC11.
This change replicates what GLIBC 2.23 has in the string/rawmemchr.c:

// #if __GNUC_PREREQ (11, 0)
//  /* Likewise GCC 11, with a different warning option.  */
//  DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
// #endif

With -Werror multiple platforms failing on the string/rawmemchr.c:40 line.

Signed-off-by: Nik Konyuchenko <spaun2002mobile@gmail.com>
2021-05-05 01:26:34 -07:00
Keith Packard
7e457684ea picolibc: Convert to companion library
This allows configurations to include picolibc without excluding
another C library.

Signed-off-by: Keith Packard <keithp@keithp.com>
2021-01-08 17:48:33 -08:00
Jose E. Marchesi
470ce219af Add Oracle products to crosstool-ng
This commit adds support for the following Oracle products, in order
to target Oracle Linux 7.9:

Binutils 2.27-44.base.0.400
GCC      4.8.5-44.0.5
glibc    2.17-317.0.3
UEK5/u4  4.14.35-2025.400.8

Sample configuration files are provides for the following triplets:

arm-ol7u9-linux-gnueabi
arm-ol7u9-linux-gnueabihf

Signed-off-by: Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
2020-11-23 19:54:22 +13:00
Chris Packham
215432d380 config/libc: Extend glibc 2.32 workaround to include sparc
Sparc seems to be affected by the same issues as powerpc64. Disable
glibc warnings for sparc.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2020-09-14 20:55:49 +12:00
Chris Packham
1ee44ab516 glibc: --enable-obsolete-rpc has been removed as of 2.32
Make --enable-obsolete-rpc conditional on !CT_GLIBC_2_32_or_later as
it's been removed from that version on.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2020-09-07 20:25:19 +12:00
Chris Packham
fb08fb616f Merge branch 'picolibc' of git://github.com/keith-packard/crosstool-ng into keith-packard-picolibc 2020-09-06 21:40:41 +12:00
Chris Packham
645ee12492 glibc: Don't build with -Werror for powerpc64+glibc-2.32
When building powerpc64+glibc-2.32 we see the following error:

[ALL  ]      In file included from ../sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c:26,
[ALL  ]                       from ../sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c:18:
[ALL  ]      ../string/wordcopy.c: In function '_wordcopy_fwd_aligned':
[ERROR]      ../string/wordcopy.c:98:26: error: 'a1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[ALL  ]         98 |       ((op_t *) dstp)[0] = a1;
[ALL  ]            |       ~~~~~~~~~~~~~~~~~~~^~~~
[ALL  ]      In file included from ../sysdeps/powerpc/powerpc64/power4/../../powerpc32/power4/memcopy.h:38,
[ALL  ]                       from ../sysdeps/powerpc/powerpc64/power4/memcopy.h:1,
[ALL  ]                       from ../string/wordcopy.c:23,
[ALL  ]                       from ../sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c:26,
[ALL  ]                       from ../sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c:18:
[ALL  ]      ../string/wordcopy.c: In function '_wordcopy_fwd_dest_aligned':
[ERROR]      ../sysdeps/generic/memcopy.h:72:61: error: 'a3' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[ALL  ]         72 | #define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
[ALL  ]            |                                                             ^~

This seems to only trigger for powerpc64. Other architectures build
cleanly. For now avoid specifying -Werror for powerpc64+glibc-2.32.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2020-09-03 22:47:02 +12:00
Keith Packard
c15de32ec6 Add picolibc support [v2]
This adds support for using picolibc instead of newlib on embedded
systems.

Signed-off-by: Keith Packard <keithp@keithp.com>

v2:
	Add check for meson and ninja
	Sync option default values with current picolibc defaults
	Remove xtensa sys header file install as those aren't in picolibc
2020-09-01 09:42:53 -07:00
Alexey Neyman
8606251585 Add --with-cpu= on 32-bit SPARC
... if building for GLIBC 2.31+.

Signed-off-by: Alexey Neyman <stilor@att.net>
2020-03-03 16:40:33 -08:00
Stephanos Ioannidis
bb1d687e1d Add newlib retargetable locking configuration
This commit adds support for the newlib configuration option
'--enable-newlib-retargetable-locking'.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-20 11:18:46 +09:00
Alexey Neyman
715591306f
Merge pull request #1231 from cpackham/glibc-2.28-make-4.0
libc: glibc 2.28 needs make 4.0
2019-10-01 21:17:06 -07:00
Chris Packham
7b362e6dae Add glibc 2.30
Add the GNU C Library version 2.30. Bring forward the
typedef-caddr.patch. Skip the ARC patch for now.

https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2019-09-05 11:32:23 +12:00
Chris Packham
af2f3ac9c5 libc: glibc 2.28 needs make 4.0
Fixes: #1210

Per the release notes for the GNU C library 2.28[1] make 4.0 or newer is
required. Previously the logic was applied to glibc 2.29 or newer.

[1] - https://www.sourceware.org/ml/libc-alpha/2018-08/msg00003.html

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2019-09-04 20:28:33 +12:00
Konstantin Vasin
c4bc4f686a uClibc: fix selection of debug level 2019-04-05 18:25:52 +03:00
Alexey Neyman
b3cce054ef Meet our new companion tool, bison
Which is here courtesy of CentOS6, which only has bison 2.4 - while new
glibc requires 2.7.

Signed-off-by: Alexey Neyman <stilor@att.net>
2019-03-04 00:22:02 -08:00
Alexey Neyman
862c35457d Fix build of glibc 2.29 on systems with obsolete host programs
- Force building make as a companion tool if host make is older than
4.0 (CentOS 7 currently has 3.82)
- Disable 2.29 as a choice if host python is older than 3.4
(CentOS 7 has 2.6 unless python from EPEL is installed)
- Python2 emits its version information to STDERR. Ugh.

While there, also use the detected host Python for GDB configuration.

Signed-off-by: Alexey Neyman <stilor@att.net>
2019-03-02 15:45:37 -08:00
Andrzej Perczak
7d1b10b5e8
Add new Android API levels 2018-12-21 21:07:44 +01:00
Alexey Neyman
b0d954f0ec Allow short "moxiebox" alias
... while making use of the new tunables.

Also, unmark the moxie-elf as broken: the ld scripts installed by newlib
can be found by the compiler and can link the binaries. Why the default
script is broken is not ct-ng's problem...

Signed-off-by: Alexey Neyman <stilor@att.net>
2018-12-10 01:11:18 -08:00