From 88e8852ccd94a60979971454f8b49cb1d06cd907 Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Tue, 23 Feb 2016 11:02:40 -0800 Subject: [PATCH 1/5] glibc: Clean out old glibc versions We now only support glibc >=2.18 This now enables us to clean up glibc support! Also, add a comment about glibc 2.20 as the point which glibc no longer supports not building with pthread. Signed-off-by: Bryan Hundven --- config/libc/glibc.in | 88 +------------------------------------------- 1 file changed, 2 insertions(+), 86 deletions(-) diff --git a/config/libc/glibc.in b/config/libc/glibc.in index c1a4192c..fc7c85b2 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -100,90 +100,19 @@ config LIBC_GLIBC_V_2_20 config LIBC_GLIBC_V_2_19 bool prompt "2.19" - select LIBC_GLIBC_2_17_or_later config LIBC_GLIBC_V_2_18 bool prompt "2.18" - select LIBC_GLIBC_2_17_or_later - -config LIBC_GLIBC_V_2_17 - bool - prompt "2.17" - select LIBC_GLIBC_2_17_or_later - -config LIBC_GLIBC_V_2_16_0 - bool - prompt "2.16.0" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_15 - bool - prompt "2.15" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_14_1 - bool - prompt "2.14.1" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_14 - bool - prompt "2.14" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_13 - bool - prompt "2.13" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_12_2 - bool - prompt "2.12.2" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_12_1 - bool - prompt "2.12.1" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_11_1 - bool - prompt "2.11.1" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_11 - bool - prompt "2.11" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_10_1 - bool - prompt "2.10.1" - select LIBC_GLIBC_PORTS_EXTERNAL - select LIBC_GLIBC_USE_PORTS - -config LIBC_GLIBC_V_2_9 - bool - prompt "2.9" - select LIBC_GLIBC_PORTS_EXTERNAL - -config LIBC_GLIBC_V_2_8 - bool - prompt "2.8" - select LIBC_GLIBC_PORTS_EXTERNAL endchoice endif # ! LIBC_GLIBC_CUSTOM +# 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 - -# DeMark no more ports -config LIBC_GLIBC_2_17_or_later - bool if ! LIBC_GLIBC_CUSTOM @@ -198,18 +127,5 @@ config LIBC_VERSION 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 - default "2.11.1" if LIBC_GLIBC_V_2_11_1 - default "2.11" if LIBC_GLIBC_V_2_11 - default "2.10.1" if LIBC_GLIBC_V_2_10_1 - default "2.9" if LIBC_GLIBC_V_2_9 - default "2.8" if LIBC_GLIBC_V_2_8 endif # ! LIBC_GLIBC_CUSTOM From cb87833b7b6e83a8375577d0219138d55052bc1c Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Tue, 23 Feb 2016 11:14:50 -0800 Subject: [PATCH 2/5] glibc: reformat glibc build script Move crosstool-ng hook functions to be in the normal locations. This commit has no functional changes. Signed-off-by: Bryan Hundven --- scripts/build/libc/glibc.sh | 130 ++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index d45248a7..b85c47a4 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -2,7 +2,62 @@ # Copyright 2007 Yann E. MORIN # Licensed under the GPL v2. See COPYING in the root of this package -# Extract the C library tarball(s) +do_libc_get() { + local date + local version + local -a addons_list + + addons_list=($(do_libc_add_ons_list " ")) + + # Main source + if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then + CT_GetCustom "glibc" "${CT_LIBC_GLIBC_CUSTOM_VERSION}" \ + "${CT_LIBC_GLIBC_CUSTOM_LOCATION}" + else + if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then + # Linaro glibc releases come from regular downloads... + YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'` + CT_GetFile "glibc-${CT_LIBC_VERSION}" \ + https://releases.linaro.org/${YYMM}/components/toolchain/glibc-linaro \ + http://cbuild.validation.linaro.org/snapshots + else + CT_GetFile "glibc-${CT_LIBC_VERSION}" \ + {http,ftp,https}://ftp.gnu.org/gnu/glibc \ + ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} + fi + fi + + # C library addons + for addon in "${addons_list[@]}"; do + # Never ever try to download these add-ons, + # they've always been internal + case "${addon}" in + nptl) continue;; + esac + + case "${addon}:${CT_LIBC_GLIBC_PORTS_EXTERNAL}" in + ports:y) ;; + ports:*) continue;; + esac + + if ! CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \ + http://mirrors.kernel.org/sourceware/glibc \ + {http,ftp,https}://ftp.gnu.org/gnu/glibc \ + ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} + then + # Some add-ons are bundled with glibc, others are + # bundled in their own tarball. Eg. NPTL is internal, + # while LinuxThreads was external. Also, for old + # versions of glibc, the libidn add-on was external, + # but with version >=2.10, it is internal. + CT_DoLog DEBUG "Addon '${addon}' could not be downloaded." + CT_DoLog DEBUG "We'll see later if we can find it in the source tree" + fi + done + + return 0 +} + do_libc_extract() { local addon @@ -57,6 +112,10 @@ do_libc_extract() { fi } +do_libc_check_config() { + : +} + # Build and install headers and start files do_libc_start_files() { # Start files and Headers should be configured the same way as the @@ -69,6 +128,10 @@ do_libc() { do_libc_backend libc_mode=final } +do_libc_post_cc() { + : +} + # This backend builds the C library once for each multilib # variant the compiler gives us # Usage: do_libc_backend param=value [...] @@ -539,68 +602,6 @@ do_libc_min_kernel_config() { esac } -# Download glibc -do_libc_get() { - local date - local version - local -a addons_list - - addons_list=($(do_libc_add_ons_list " ")) - - # Main source - if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then - CT_GetCustom "glibc" "${CT_LIBC_GLIBC_CUSTOM_VERSION}" \ - "${CT_LIBC_GLIBC_CUSTOM_LOCATION}" - else - if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then - # Linaro glibc releases come from regular downloads... - YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'` - CT_GetFile "glibc-${CT_LIBC_VERSION}" \ - https://releases.linaro.org/${YYMM}/components/toolchain/glibc-linaro \ - http://cbuild.validation.linaro.org/snapshots - else - CT_GetFile "glibc-${CT_LIBC_VERSION}" \ - {http,ftp,https}://ftp.gnu.org/gnu/glibc \ - ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} - fi - fi - - # C library addons - for addon in "${addons_list[@]}"; do - # Never ever try to download these add-ons, - # they've always been internal - case "${addon}" in - nptl) continue;; - esac - - case "${addon}:${CT_LIBC_GLIBC_PORTS_EXTERNAL}" in - ports:y) ;; - ports:*) continue;; - esac - - if ! CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \ - http://mirrors.kernel.org/sourceware/glibc \ - {http,ftp,https}://ftp.gnu.org/gnu/glibc \ - ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} - then - # Some add-ons are bundled with glibc, others are - # bundled in their own tarball. Eg. NPTL is internal, - # while LinuxThreads was external. Also, for old - # versions of glibc, the libidn add-on was external, - # but with version >=2.10, it is internal. - CT_DoLog DEBUG "Addon '${addon}' could not be downloaded." - CT_DoLog DEBUG "We'll see later if we can find it in the source tree" - fi - done - - return 0 -} - -# There is nothing to do for glibc check config -do_libc_check_config() { - : -} - # Extract the files required for the libc locales # Nothing to do do_libc_locales_extract() { @@ -676,6 +677,3 @@ do_libc_locales() { localedata/install-locales } -do_libc_post_cc() { - : -} From 39273e0843cc5f7f91d50651b299a0472f59f472 Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Tue, 23 Feb 2016 14:47:37 -0800 Subject: [PATCH 3/5] glibc: Remove support for downloading and extracting add-ons Since external add-ons were removed in 2.17, and we only support >= 2.18, this support is no longer needed. Signed-off-by: Bryan Hundven --- scripts/build/libc/glibc.sh | 67 ------------------------------------- 1 file changed, 67 deletions(-) diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index b85c47a4..8cf80796 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -5,9 +5,6 @@ do_libc_get() { local date local version - local -a addons_list - - addons_list=($(do_libc_add_ons_list " ")) # Main source if [ "${CT_LIBC_GLIBC_CUSTOM}" = "y" ]; then @@ -27,79 +24,15 @@ do_libc_get() { fi fi - # C library addons - for addon in "${addons_list[@]}"; do - # Never ever try to download these add-ons, - # they've always been internal - case "${addon}" in - nptl) continue;; - esac - - case "${addon}:${CT_LIBC_GLIBC_PORTS_EXTERNAL}" in - ports:y) ;; - ports:*) continue;; - esac - - if ! CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \ - http://mirrors.kernel.org/sourceware/glibc \ - {http,ftp,https}://ftp.gnu.org/gnu/glibc \ - ftp://{sourceware.org,gcc.gnu.org}/pub/glibc/{releases,snapshots} - then - # Some add-ons are bundled with glibc, others are - # bundled in their own tarball. Eg. NPTL is internal, - # while LinuxThreads was external. Also, for old - # versions of glibc, the libidn add-on was external, - # but with version >=2.10, it is internal. - CT_DoLog DEBUG "Addon '${addon}' could not be downloaded." - CT_DoLog DEBUG "We'll see later if we can find it in the source tree" - fi - done - return 0 } do_libc_extract() { - local addon - CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}" CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" # Attempt CT_PATCH only if NOT custom CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}" - # Extract the add-opns if => 2.17 - if [ "${CT_LIBC_GLIBC_2_17_or_later}" != "y" ]; then - for addon in $(do_libc_add_ons_list " "); do - # If the addon was bundled with the main archive, we do not - # need to extract it. Worse, if we were to try to extract - # it, we'd get an error. - if [ -d "${addon}" ]; then - CT_DoLog DEBUG "Add-on '${addon}' already present, skipping extraction" - continue - fi - - CT_Extract nochdir "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - - CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \ - -d "${addon}" -a -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - - # Some addons have the 'long' name, while others have the - # 'short' name, but patches are non-uniformly built with - # either the 'long' or 'short' name, whatever the addons name - # but we prefer the 'short' name and avoid duplicates. - if [ -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ]; then - CT_DoExecLog FILE mv "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" "${addon}" - fi - - CT_DoExecLog FILE ln -s "${addon}" "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - - CT_Patch nochdir "${CT_LIBC}" "${addon}-${CT_LIBC_VERSION}" - - # Remove the long name since it can confuse configure scripts to run - # the same source twice. - rm "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" - done - fi - # The configure files may be older than the configure.in files # if using a snapshot (or even some tarballs). Fake them being # up to date. From 21d15e0fd6a9c0ffdc5ea39527d54f106f4a4c38 Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Tue, 23 Feb 2016 23:28:22 -0800 Subject: [PATCH 4/5] glibc: remove do_libc_locales_extract; it's empty No point in calling an empty function. Must be left over from the glibc/eglibc split up... then re-merge. Signed-off-by: Bryan Hundven --- scripts/build/libc/glibc.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 8cf80796..93dbbf73 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -39,10 +39,6 @@ do_libc_extract() { find . -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL CT_Popd - - if [ "${CT_LIBC_LOCALES}" = "y" ]; then - do_libc_locales_extract - fi } do_libc_check_config() { @@ -535,12 +531,6 @@ do_libc_min_kernel_config() { esac } -# Extract the files required for the libc locales -# Nothing to do -do_libc_locales_extract() { - : -} - # Build and install the libc locales do_libc_locales() { local src_dir="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}" From ec9af46847376906f8add7d5c8f1137c832779dd Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Tue, 23 Feb 2016 23:34:38 -0800 Subject: [PATCH 5/5] glibc: Mirror extra_config flags from do_libc_backend_once In do_libc_backend_once: ``` # Also, if those two are missing, iconv build breaks extra_config+=( --disable-debug --disable-sanity-checks ) ``` But in do_libc_locales we only add ```--disable-debug```. This change adds ```--disable-sanity-checks``` to do_libc_locales to mirror this, as I've seen iconv break this way. Signed-off-by: Bryan Hundven --- scripts/build/libc/glibc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 93dbbf73..0a09cbd1 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -584,6 +584,7 @@ do_libc_locales() { --disable-profile \ --without-gd \ --disable-debug \ + --disable-sanity-checks \ "${extra_config[@]}" CT_DoLog EXTRA "Building C library localedef"