summaryrefslogtreecommitdiff
path: root/config/libc/glibc.in
diff options
context:
space:
mode:
Diffstat (limited to 'config/libc/glibc.in')
-rw-r--r--config/libc/glibc.in537
1 files changed, 371 insertions, 166 deletions
diff --git a/config/libc/glibc.in b/config/libc/glibc.in
index 9e4ff56..3da38bd 100644
--- a/config/libc/glibc.in
+++ b/config/libc/glibc.in
@@ -1,222 +1,427 @@
-# glibc options
+# This file contains the common configuration options
+# that apply to both glibc.
## depends on ! WINDOWS && ! BARE_METAL && ARCH_USE_MMU
-##
## select LIBC_SUPPORT_THREADS_NATIVE
-## select CC_CORE_PASSES_NEEDED
+## select CC_CORE_NEEDED
+# TBD: select GETTEXT for build only, not for host
## select GETTEXT_NEEDED
-##
+## select BINUTILS_FORCE_LD_BFD_DEFAULT
+
## help The de-facto standard for Linux distributions.
## help Feature-rich, but large... Most useful for desktop-like systems.
+# GLIBC and kernel are special when it comes to obsoletion. Users
+# of crosstool-ng depend on the ability to build new toolchains matching
+# the kernel/libc versions of a particular target system, and LTS releases
+# are still using quite ancient versions. Please do not retire versions
+# (including versions in between) until the EOL dates indicated in version.desc.
+
+if GLIBC_USE_PORTS_EXTERNAL
+source "config/versions/glibc-ports.in"
+endif
+
+# Glibc has some dependencies on the kernel headers:
+config GLIBC_DEP_KERNEL_HEADERS_VERSION
+ def_bool y
+ select LINUX_REQUIRE_3_2_or_later if GLIBC_2_24_or_later
+
+# Glibc 2.26 requires at least binutils 2.25.
+# Also, binutils 2.30 fail while compiling aarch64 glibc; fixed in 2.27
+# and backported to 2.26. For other versions, require binutils older than
+# 2.30 (if the patch is backported, binutils 2.23 will break).
+config GLIBC_DEP_BINUTILS
+ def_bool y
+ select BINUTILS_REQUIRE_2_25_or_later if GLIBC_2_26_or_later
+ select BINUTILS_REQUIRE_older_than_2_30 if GLIBC_older_than_2_26 && ARCH_ARM && ARCH_64
+
+# Glibc 2.26 requires GCC4.9 or newer
+# Glibc 2.29 requires GCC5+ or, for ppc64le, GCC6.2+. We only support the latest
+# release on GCC6 branch, so just assume it is newer than 6.2
+# Glibc 2.30 uncondtionally requires GCC 6.2+
+config GLIBC_DEP_GCC
+ def_bool y
+ select GCC_REQUIRE_4_9_or_later if GLIBC_2_26_or_later
+ select GCC_REQUIRE_5_or_later if GLIBC_2_29_or_later
+ select GCC_REQUIRE_6_or_later if GLIBC_2_29_or_later && ARCH_POWERPC && ARCH_64 && ARCH_LE
+ select GCC_REQUIRE_6_or_later if GLIBC_2_30_or_later
+
+# Glibc 2.29 requires bison 2.7 or later. All versions in ct-ng satisfy that
+# version requirement.
+config GLIBC_DEP_BISON
+ def_bool y
+ depends on GLIBC_2_29_or_later && !CONFIGURE_has_bison_2_7_or_newer
+ select COMP_TOOLS_BISON
+
+# Glibc 2.29 now requires Python 3.4 or later, and make 4.0 or later. Ensure
+# we build 'make' as a companion tool if host's make isn't new enough.
+config GLIBC_DEP_PYTHON
+ def_bool y
+ select GLIBC_REQUIRE_older_than_2_29 if !CONFIGURE_has_python_3_4_or_newer
+
+comment "glibc >=2.29 requires python >3.4"
+ depends on !CONFIGURE_has_python_3_4_or_newer
+
+config GLIBC_DEP_MAKE_4_0
+ def_bool y
+ depends on GLIBC_2_28_or_later && !CONFIGURE_has_make_4_0_or_newer
+ select COMP_TOOLS_MAKE
+ select MAKE_GNUMAKE_SYMLINK # Override old host make in .build/tools/bin
+
+# Glibc 2.31 removed support for pre-v8 SPARC in 32-bit mode (64-bit mode always
+# required UltraSPARC)
+config GLIBC_SPARC_ALLOW_V7
+ def_bool y
+ depends on GLIBC_2_30_or_older
+
config THREADS
default "nptl"
-config LIBC_GLIBC_CUSTOM
- bool
- prompt "Custom glibc"
- depends on EXPERIMENTAL
- select LIBC_CUSTOM
- select LIBC_GLIBC_2_20_or_later
+config GLIBC_BUILD_SSP
+ def_bool y
+ depends on GLIBC_2_25_or_later
+
+# Known add-ons and when they exist(ed)
+# crypt external in 2.1, no longer an add-on since 2.2
+# libidn external in 2.3.4 .. 2.10, still an add-on
+# linuxthreads external in 2.0.1 .. 2.5, no longer available since 2.6 [*]
+# localedata external in 2.0.1 .. 2.0.6, no longer an add-on since 2.1 [*]
+# ports external in 2.3.4 .. 2.16, no longer an add-on since 2.20
+# nptl never external, no longer an add-on since 2.20
+#
+# Given the list of currently supported glibc releases, we only need to worry about
+# 'libidn', 'ports' and 'nptl' add-ons. Of these, only 'ports' can be an external
+# tarball; and only 'libidn' is user-selectable ('ports' & 'nptl' are selected
+# by crosstool-NG, as dictated by the architecture and thread model).
+#
+# I had trouble locating the sources in the repository for some of the released
+# versions. E.g., there is a 2.5 version of linuxthreads, but the tag for 2.5 in Git
+# does not have the linuxthreads directory at all. Similarly, 2.0.6 tag did not have
+# localedata. Since these releases are no longer supported by crosstool-NG, this is
+# of pure historical interest now, however.
+
+config GLIBC_HAS_NPTL_ADDON
+ def_bool y
+ depends on !GLIBC_2_20_or_later
+
+config GLIBC_HAS_PORTS_ADDON
+ def_bool y
+ depends on !GLIBC_2_20_or_later
+ depends on !GLIBC_USE_ORACLE
+
+config GLIBC_HAS_PORTS_ADDON_EXTERNAL
+ def_bool y
+ depends on !GLIBC_2_17_or_later
+
+# In case it folds into main distribution in some future release, too
+config GLIBC_HAS_LIBIDN_ADDON
+ def_bool y
+
+# Some architectures require the ports addon. List them one by one here:
+# This list must be carefully in sync with the architectures names
+# we can find in config/arch/*
+config GLIBC_USE_PORTS_ADDON
+ def_bool y
+ depends on ARCH_ALPHA || ARCH_ARM || ARCH_M68K || ARCH_MIPS || ARCH_POWERPC
+ depends on GLIBC_HAS_PORTS_ADDON
+ depends on !GLIBC_USE_ORACLE
+
+config GLIBC_USE_PORTS_EXTERNAL
+ def_bool y
+ depends on GLIBC_USE_PORTS_ADDON && GLIBC_HAS_PORTS_ADDON_EXTERNAL
+
+config GLIBC_USE_NPTL_ADDON
+ def_bool y
+ depends on THREADS_NATIVE && GLIBC_HAS_NPTL_ADDON
+
+config GLIBC_USE_LIBIDN_ADDON
+ bool "Build libidn add-on"
help
- The choosen glibc version shall be not downloaded. Instead use
- a custom location to get the source.
-
-if LIBC_GLIBC_CUSTOM
-
-config LIBC_GLIBC_CUSTOM_LOCATION
+ Enables the libidn add-on in GNU libc.
+
+# SPARCv8 support retired in 2.23
+config GLIBC_NO_SPARC_V8
+ def_bool y
+ depends on GLIBC_2_23_or_later
+
+# 2.14 obsoleted Sun RPC code, making it unavailable *at all* for compiling/linking
+# (only remained as versioned symbols for previously linked binaries). They backpedaled
+# in 2.16, adding an option to enable that code. Crosstool-NG backports that code
+# to 2.14/2.15, but there is no harm in throwing this option even if that patch
+# is not applied.
+# The option and the code has finally been removed in 2.32
+config GLIBC_HAS_OBSOLETE_RPC
+ def_bool y
+ depends on GLIBC_2_14_or_later && !GLIBC_2_32_or_later
+
+config GLIBC_EXTRA_CONFIG_ARRAY
string
- prompt "Full path to custom glibc source"
+ prompt "extra config"
+ default ""
help
- Enter the path to the directory or tarball of your source for glibc.
+ Extra flags to pass onto ./configure when configuring.
- If the path is a tarball, it should extract to: <name>-<version>/
- where the name is this component, glibc, and the version is set
- below in the custom version string.
+ You can enter multiple arguments here, and arguments can contain spaces
+ if they are properly quoted (or escaped, but prefer quotes). Eg.:
+ --with-foo="1st arg with 4 spaces" --with-bar=2nd-arg-without-space
-config LIBC_GLIBC_CUSTOM_VERSION
+config GLIBC_CONFIGPARMS
string
- prompt "Custom GLIBC version"
+ prompt "Extra config params (READ HELP)"
+ default "" if ! ARCH_SH
+ default "no-z-defs=yes" if ARCH_SH
help
- Enter the version number for your custom glibc.
+ Some architectures need to set options in the file configparms.
+ This is the case for sh3/4, which really need to set configparms
+ to "no-z-defs=yes" as of gcc-3.4/glibc-2.3.2.
+
+ Unless you are building a toolchain for sh3/4, you should leave that empty.
+
+ Note: If you need to pass more than one value, separate them with
+ '\n'. Eg.: var1=val1\nvar2=val2
-config LIBC_VERSION
+config GLIBC_EXTRA_CFLAGS
string
- default LIBC_GLIBC_CUSTOM_VERSION
-
-endif # LIBC_GLIBC_CUSTOM
+ prompt "extra target CFLAGS"
+ default "-Wno-missing-attributes -Wno-array-bounds -Wno-array-parameter -Wno-stringop-overflow -Wno-maybe-uninitialized" if GLIBC_2_29_or_older && GCC_11_or_later
+ default ""
+ help
+ Extra target CFLAGS to use when building.
-if ! LIBC_GLIBC_CUSTOM
+config GLIBC_ENABLE_OBSOLETE_RPC
+ bool "Enable obsolete (Sun) RPC"
+ default y
+ depends on GLIBC_HAS_OBSOLETE_RPC
+ help
+ Allow building applications using obsolete (Sun) RPC.
-config CC_GLIBC_SHOW_LINARO
+config GLIBC_ENABLE_FORTIFIED_BUILD
bool
- prompt "Show Linaro versions"
+ prompt "Enable fortified build (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
help
- Linaro is maintaining some advanced/more stable/experimental versions
- of glibc, especially for the ARM architecture.
-
- Those versions have not been blessed by the glibc comunity (nor have they
- been cursed either!), but they look to be pretty much stable, and even
- more stable than the upstream versions. YMMV...
+ If you say 'y' here, then glibc will be using fortified versions
+ of functions with format arguments (eg. vsyslog, printf...), and
+ do a sanity check on the format at runtime, to avoid some of the
+ common format string attacks.
- If you do not know what this Linaro stuff is, then simply say 'n' here,
- and rest in peace. OTOH, if you know what you are doing, you will be
- able to use and enjoy :-) the Linaro versions by saying 'y' here.
+ This is currently not supported, and will most probably result in
+ a broken build, with an error message like:
+ ../misc/syslog.c: In function '__vsyslog_chk':
+ ../misc/syslog.c:123: sorry, unimplemented: inlining failed in
+ call to 'syslog': function body not available
- Linaro: http://www.linaro.org/
+ If you are brave enough and want to debug the issue, then say 'y'
+ here. Otherwise, be still and say 'n' (the default). ;-)
-# GLIBC and kernel are special when it comes to obsoletion. Users
-# of crosstool-ng depend on the ability to build new toolchains matching
-# the kernel/libc versions of a particular target system, and LTS releases
-# are still using quite ancient versions. Please do not retire versions
-# (including versions in between) until the EOL dates indicated below.
-choice
- bool
- prompt "glibc version"
-# Don't remove next line
-# CT_INSERT_VERSION_BELOW
-config LIBC_GLIBC_V_2_25
+config GLIBC_DISABLE_VERSIONING
bool
- prompt "2.25"
- select LIBC_GLIBC_2_23_or_later
+ prompt "Disable symbols versioning"
+ help
+ Do not include versioning information in the library objects.
-config LIBC_GLIBC_V_2_24
- bool
- prompt "2.24"
- select LIBC_GLIBC_2_23_or_later
+config GLIBC_OLDEST_ABI
+ string
+ prompt "Oldest supported ABI"
+ default ""
+ help
+ Set the oldest ABI supported by the C library.
+
+ Setting this option, for example, to 2.2 will provide ABI support
+ back to (e)glibc-2.2.
-# EOL 04/2021 [Ubuntu16.04]
-config LIBC_GLIBC_V_2_23
- bool
- prompt "2.23"
- select LIBC_GLIBC_2_23_or_later
+ If this option is not set, (e)glibc will choose for you.
-config LIBC_GLIBC_V_2_22
+config GLIBC_FORCE_UNWIND
bool
- prompt "2.22 (OBSOLETE)"
- select LIBC_GLIBC_2_20_or_later
- depends on OBSOLETE
+ prompt "Force unwind support (READ HELP!)"
+ default y
+ help
+ If your toolchain fails building while building the C library
+ start files, or the complete C library, with a message like:
+ configure: error: forced unwind support is required
+
+ then you may try changing this option. Otherwise, leave it to
+ the default 'y'.
+
+ The issue seems to be related to building NPTL on old versions
+ of glibc on some architectures
+ (seen on s390, s390x and x86_64).
-config LIBC_GLIBC_V_2_21
+config GLIBC_LOCALES
bool
- prompt "2.21 (OBSOLETE)"
- select LIBC_GLIBC_2_20_or_later
- depends on OBSOLETE
-
-config LIBC_GLIBC_LINARO_V_2_20
+ prompt "Build and install locales"
+ help
+ Whether to build and install the libc locale files for the target,
+ which is required in order to support internationalization.
+
+if LIBC_GLIBC && GLIBC_LOCALES
+comment "WARNING! "
+comment "| The built locales will be usable if and only if the build "
+comment "| machine and the target: "
+comment "| - have the same endianness, "
+comment "| - and have the same alignment requirements for uint32_t. "
+comment "| You will have to check by yourself (for now). "
+comment "WARNING! "
+comment "| Building GLIBC locales requires that GLIBC supports "
+comment "| the build machine as the target. "
+endif # LIBC_GLIBC && GLIBC_LOCALES
+
+if KERNEL_LINUX
+
+choice GLIBC_SUPPORTED_KERNEL
bool
- prompt "Linaro 2.20-2014.11 (OBSOLETE)"
- select LIBC_GLIBC_2_20_or_later
- depends on CC_GLIBC_SHOW_LINARO
- depends on OBSOLETE
+ prompt "Minimum supported kernel version"
+ default GLIBC_KERNEL_VERSION_AS_HEADERS
-config LIBC_GLIBC_V_2_20
+config GLIBC_KERNEL_VERSION_NONE
bool
- prompt "2.20 (OBSOLETE)"
- select LIBC_GLIBC_2_20_or_later
- depends on OBSOLETE
-
-# EOL 04/2019 [Ubuntu14.04]
-config LIBC_GLIBC_V_2_19
+ prompt "Let ./configure decide"
+ help
+ Let ./configure decide what minimum kernel version glibc will be
+ able to run against.
+
+ This will include legacy compatibility code for older kernels in
+ the C library, thus ensuring that it will run on a large number
+ of old kernels.
+
+ The minimum kernel version supported will be dependent upon the
+ target you build for. For example:
+ alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL
+ sh[34]-*-linux-gnu Requires Linux 2.6.11
+ powerpc* Requires Linux 2.4.19
+ arm*-*-linux-*gnueabi Requires Linux 2.6.16
+
+config GLIBC_KERNEL_VERSION_AS_HEADERS
bool
- prompt "2.19 (OBSOLETE)"
- depends on OBSOLETE
- select LIBC_GLIBC_2_17_or_later
+ prompt "Same as kernel headers (default)"
+ help
+ Normally, you'll want glibc to run against the same kernel
+ version as the one used for the headers.
+
+ This is the default.
+
+ If enabled, crosstool-ng will use the chosen version of kernel
+ headers for the glibc minimum kernel version supported, which is
+ what gets passed to "--enable-kernel=" when configuring glibc.
+
+ Enabling this will ensure that no legacy compatibility code for
+ older kernels is built into your C libraries, but it will
+ be unable to run on kernel versions older than whichever kernel
+ headers version you've built the toolchain for.
+
+ If you know for sure that your toolchain will never need to build
+ applications that will run under a kernel version older than your
+ chosen kernel headers version (CT_KERNEL_VERSION), you can choose
+ "y" here.
-config LIBC_GLIBC_V_2_18
+config GLIBC_KERNEL_VERSION_CHOSEN
bool
- prompt "2.18 (OBSOLETE)"
- depends on OBSOLETE
- select LIBC_GLIBC_2_17_or_later
+ prompt "Specific kernel version"
+ help
+ Specify the earliest Linux kernel version you want glibc to
+ include support for. This does not have to match the kernel
+ headers version used for your toolchain. This controls what is
+ passed to the "--enable-kernel=" option to the glibc configure
+ script.
-# EOL 06/2024 [CentOS7.x]
-config LIBC_GLIBC_V_2_17
- bool
- prompt "2.17 (OBSOLETE)"
- depends on OBSOLETE
- select LIBC_GLIBC_2_17_or_later
+ If you want to be able to statically link programs with your
+ toolchain's C library, make sure this kernel version is lower than
+ all kernels you wish to support to avoid "FATAL: kernel too old"
+ errors. The higher the version you specify, the less legacy code
+ will be built into libc.
-config LIBC_GLIBC_V_2_16_0
- bool
- prompt "2.16.0 (OBSOLETE)"
- depends on OBSOLETE
+ Most people can leave this at the default value of "2.6.9".
-# EOL 04/2017 [Ubuntu12.04]
-config LIBC_GLIBC_V_2_15
- bool
- prompt "2.15 (OBSOLETE)"
- depends on OBSOLETE
+if GLIBC_KERNEL_VERSION_CHOSEN
-config LIBC_GLIBC_V_2_14_1
- bool
- prompt "2.14.1 (OBSOLETE)"
- depends on OBSOLETE
+config GLIBC_MIN_KERNEL_VERSION
+ string
+ prompt "Minimum kernel version to support"
+ default "2.6.9"
+ help
+ Enter here the lowest kernel version glibc will be able to run against.
+
+ The minimum kernel version supported will be dependent upon the
+ target you build for. For example:
+ alpha*-*-linux-gnu Requires Linux 2.6.9 for NPTL
+ sh[34]-*-linux-gnu Requires Linux 2.6.11
+ powerpc* Requires Linux 2.4.19
+ arm*-*-linux-*gnueabi Requires Linux 2.6.16
+
+ Note that no sanity check is performed by crosstool-NG to ensure
+ that the value you enter here is appropriate for your target.
-config LIBC_GLIBC_V_2_14
- bool
- prompt "2.14 (OBSOLETE)"
- depends on OBSOLETE
+endif # GLIBC_KERNEL_VERSION_CHOSEN
-config LIBC_GLIBC_V_2_13
- bool
- prompt "2.13 (OBSOLETE)"
- depends on OBSOLETE
+endchoice
-# This version did not have glibc-ports addon released
-config LIBC_GLIBC_V_2_12_2
- bool
- prompt "2.12.2 (OBSOLETE)"
- depends on OBSOLETE
- depends on !LIBC_GLIBC_NEEDS_PORTS
+config GLIBC_MIN_KERNEL
+ string
+ default "" if GLIBC_KERNEL_VERSION_NONE
+ default LINUX_VERSION if GLIBC_KERNEL_VERSION_AS_HEADERS
+ default GLIBC_MIN_KERNEL_VERSION if GLIBC_KERNEL_VERSION_CHOSEN
-# EOL 11/2020 [CentOS6.x]
-config LIBC_GLIBC_V_2_12_1
- bool
- prompt "2.12.1 (OBSOLETE)"
- depends on OBSOLETE
+if GLIBC_BUILD_SSP
+choice
+ bool "Stack-smashing protection (SSP) in glibc"
+ default GLIBC_SSP_DEFAULT
-endchoice
+config GLIBC_SSP_DEFAULT
+ bool "default"
+ help
+ Glibc's configure script determines the stack protection level.
-endif # ! LIBC_GLIBC_CUSTOM
+config GLIBC_SSP_NO
+ bool "no"
+ help
+ Glibc functions are not protected against stack-smashing.
-# Checked by SPARC build: SPARCv8 is dropped in 2.23.
-config LIBC_GLIBC_2_23_or_later
- select LIBC_GLIBC_2_20_or_later
- bool
+config GLIBC_SSP_YES
+ bool "yes"
+ help
+ Glibc is compiled with -fstack-protector option.
-# DeMark 2.20 as no longer needs to set NPTL as an addon.
-# It is no longer possible to build glibc without pthread!
-config LIBC_GLIBC_2_20_or_later
- bool
- select LIBC_GLIBC_2_17_or_later
+config GLIBC_SSP_ALL
+ bool "all"
+ help
+ Glibc is compiled with -fstack-protector-all option.
-# DeMark no more ports
-config LIBC_GLIBC_2_17_or_later
- bool
+config GLIBC_SSP_STRONG
+ bool "strong"
+ help
+ Glibc is compiled with -fstack-protector-strong option.
-if ! LIBC_GLIBC_CUSTOM
+endchoice
-config LIBC_VERSION
+config GLIBC_SSP
string
-# Don't remove next line
-# CT_INSERT_VERSION_STRING_BELOW
- default "2.25" if LIBC_GLIBC_V_2_25
- default "2.24" if LIBC_GLIBC_V_2_24
- default "2.23" if LIBC_GLIBC_V_2_23
- default "2.22" if LIBC_GLIBC_V_2_22
- default "2.21" if LIBC_GLIBC_V_2_21
- default "linaro-2.20-2014.11" if LIBC_GLIBC_LINARO_V_2_20
- default "2.20" if LIBC_GLIBC_V_2_20
- default "2.19" if LIBC_GLIBC_V_2_19
- default "2.18" if LIBC_GLIBC_V_2_18
- default "2.17" if LIBC_GLIBC_V_2_17
- default "2.16.0" if LIBC_GLIBC_V_2_16_0
- default "2.15" if LIBC_GLIBC_V_2_15
- default "2.14.1" if LIBC_GLIBC_V_2_14_1
- default "2.14" if LIBC_GLIBC_V_2_14
- default "2.13" if LIBC_GLIBC_V_2_13
- default "2.12.2" if LIBC_GLIBC_V_2_12_2
- default "2.12.1" if LIBC_GLIBC_V_2_12_1
-
-endif # ! LIBC_GLIBC_CUSTOM
+ default "no" if GLIBC_SSP_NO
+ default "yes" if GLIBC_SSP_YES
+ default "all" if GLIBC_SSP_ALL
+ default "strong" if GLIBC_SSP_STRONG
+
+# All supported versions of glibc build cleanly with GCC7 and earlier.
+# GCC8-related fixes were only available in glibc 2.27.
+config GLIBC_ENABLE_WERROR
+ bool "Enable -Werror during the build"
+ default y if GCC_7_or_older
+ default y if GCC_8_or_later && GLIBC_2_27_or_later
+ help
+ By default, glibc enables strict warning checks during the build.
+ However, older version of glibc may not build with newer versions
+ of the compiler than there were available at the time of a glibc
+ release (because newer compilers typically have better diagnostics).
+
+endif
+
+config GLIBC_ENABLE_COMMON_FLAG
+ bool "Enable -fcommon flag for older version of glibc when using GCC >=10"
+ default y if GLIBC_2_29_or_older && GCC_10_or_later
+ default n if GLIBC_2_30_or_later || GCC_9_or_older
+ help
+ Starting from GCC 10, the default behavior is changed to -fno-common.
+ That leads to linking errors in GLibc versions older than 2.30.
+
+endif # KERNEL_LINUX