From 862c35457d2cb95124d802d5dbeddb4815dc08c1 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 2 Mar 2019 15:45:37 -0800 Subject: [PATCH] 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 --- config/comp_tools/make.in | 7 ++++--- config/configure.in.in | 9 +++++++++ config/libc/glibc.in | 17 +++++++++++++++-- configure.ac | 22 ++++++++++++++++++++++ m4/ctng_version_check.m4 | 4 ++-- packages/glibc/package.desc | 2 +- packages/make/package.desc | 1 + paths.sh.in | 1 + scripts/build/companion_tools/050-make.sh | 6 ++++++ scripts/build/debug/300-gdb.sh | 15 ++++++--------- 10 files changed, 67 insertions(+), 17 deletions(-) diff --git a/config/comp_tools/make.in b/config/comp_tools/make.in index 8d0ac293..ca7996bf 100644 --- a/config/comp_tools/make.in +++ b/config/comp_tools/make.in @@ -3,6 +3,7 @@ ## default y if !CONFIGURE_has_make_3_81_or_newer config MAKE_GMAKE_SYMLINK - bool - prompt "Add gmake symlink to companion gnu/make" - depends on COMP_TOOLS_MAKE + bool "Create 'gmake' symlink" + +config MAKE_GNUMAKE_SYMLINK + bool "Create 'gnumake' symlink" diff --git a/config/configure.in.in b/config/configure.in.in index 49fdb2e5..c8df5a35 100644 --- a/config/configure.in.in +++ b/config/configure.in.in @@ -15,6 +15,9 @@ config CONFIGURE_has_curl config CONFIGURE_has_make_3_81_or_newer @KCONFIG_make_3_81_or_newer@ +config CONFIGURE_has_make_4_0_or_newer + @KCONFIG_make_4_0_or_newer@ + config CONFIGURE_has_libtool_2_4_or_newer @KCONFIG_libtool_2_4_or_newer@ @@ -33,6 +36,12 @@ config CONFIGURE_has_automake_1_15_or_newer config CONFIGURE_has_gnu_m4_1_4_12_or_newer @KCONFIG_gnu_m4_1_4_12_or_newer@ +config CONFIGURE_has_python_3_4_or_newer + @KCONFIG_python_3_4_or_newer@ + +config CONFIGURE_has_python + @KCONFIG_python@ + config CONFIGURE_has_dtc @KCONFIG_dtc@ diff --git a/config/libc/glibc.in b/config/libc/glibc.in index 6598c31f..e27a4f68 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -23,8 +23,8 @@ 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 + 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 @@ -35,6 +35,19 @@ config GLIBC_DEP_BINUTILS 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.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 + +config GLIBC_DEP_MAKE_4_0 + def_bool y + depends on GLIBC_2_29_or_later && !CONFIGURE_has_make_4_0_or_newer + select COMP_TOOLS_MAKE + select MAKE_REQUIRE_4_0_or_later + select MAKE_GNUMAKE_SYMLINK # Override old host make in .build/tools/bin + config GLIBC_DEP_GCC def_bool y select GCC_REQUIRE_4_9_or_later if GLIBC_2_26_or_later diff --git a/configure.ac b/configure.ac index dddbd27e..bea1817a 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,13 @@ CTNG_PROG_VERSION_REQ_ANY([MAKE], [^GNU Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)], [make_3_81_or_newer]) +CTNG_PROG_VERSION_REQ_ANY([MAKE], + [GNU make >= 4.0], + [make], + [gmake make], + [^GNU Make [4-9]\.], + [make_4_0_or_newer]) + # Check other companion tools that we may or may not build. CTNG_PROG_VERSION_REQ_ANY([LIBTOOL], [GNU libtool >= 2.4], @@ -225,6 +232,21 @@ CTNG_PROG_VERSION([M4], [\(GNU M4\) ([2-9]\.|1\.[5-9]|1\.[1-4][0-9]|1\.4\.[2-9][0-9]|1\.4\.1[2-9])], [gnu_m4_1_4_12_or_newer]) +CTNG_PROG_VERSION([PYTHON], + [Python], + [python], + [python37 python3.7 python36 python3.6 python35 python3.5 python34 python3.4 python33 python3.3 python32 python3.2 python31 python3.1 python3 python27 python2.7 python26 python2.6 python2 python], + [^Python [23]\.], + [python]) + +CTNG_PROG_VERSION([PYTHON], + [Python >= 3.4], + [python], + [python37 python3.7 python36 python3.6 python35 python3.5 python34 python3.4 python3 python], + [^Python 3\.([4-9]|[1-9][0-9]+)\.], + [python_3_4_or_newer]) + + AC_SUBST([kconfig_options]) AC_CHECK_PROGS([dtc], [dtc]) diff --git a/m4/ctng_version_check.m4 b/m4/ctng_version_check.m4 index fee522e2..fe80e732 100644 --- a/m4/ctng_version_check.m4 +++ b/m4/ctng_version_check.m4 @@ -18,7 +18,7 @@ AC_DEFUN([CTNG_PROG_VERSION], [ac_cv_path_$1="$$1" CTNG_PATH_ABSNAME([ac_cv_path_$1]) CTNG_MSG_LOG_ENVVAR([ac_cv_path_$1]) - ver=$(eval $ac_cv_path_$1 --version 2>/dev/null) + ver=$(eval $ac_cv_path_$1 --version 2>&1) CTNG_MSG_LOG([looking for '[$5]' regexp in]) CTNG_MSG_LOG_ENVVAR([ver], [version info for $ac_cv_path_$1]) ver=$(AS_ECHO(["$ver"]) | $EGREP '[$5]') @@ -26,7 +26,7 @@ AC_DEFUN([CTNG_PROG_VERSION], [AC_CACHE_CHECK([for $3], [ac_cv_path_$1], [AC_PATH_PROGS_FEATURE_CHECK([$1], [$4], [CTNG_MSG_LOG_ENVVAR([ac_path_$1], [checking $1 at]) - ver=$($ac_path_$1 --version 2>/dev/null) + ver=$($ac_path_$1 --version 2>&1) CTNG_MSG_LOG([looking for '[$5]' regexp in]) CTNG_MSG_LOG_ENVVAR([ver], [version info]) ver=$(AS_ECHO(["$ver"]) | $EGREP '[$5]') diff --git a/packages/glibc/package.desc b/packages/glibc/package.desc index 64e14096..bc49fe01 100644 --- a/packages/glibc/package.desc +++ b/packages/glibc/package.desc @@ -3,6 +3,6 @@ repository='git git://sourceware.org/git/glibc.git' mirrors='$(CT_Mirrors GNU glibc)' # Cannot use MAJOR.MINOR as the releant part because of 2.12: 2.12.2 was the most recent # bugfix release, but it didn't have glibc-ports released alongside it. -milestones='2.14 2.17 2.20 2.23 2.24 2.25 2.26 2.27' +milestones='2.14 2.17 2.20 2.23 2.24 2.25 2.26 2.27 2.29' archive_formats='.tar.xz .tar.bz2 .tar.gz' signature_format='packed/.sig' diff --git a/packages/make/package.desc b/packages/make/package.desc index b72af79b..086a84a3 100644 --- a/packages/make/package.desc +++ b/packages/make/package.desc @@ -4,3 +4,4 @@ mirrors='$(CT_Mirrors GNU make)' relevantpattern='*.*|.' archive_formats='.tar.bz2 .tar.gz' signature_format='packed/.sig' +milestones='4.0' diff --git a/paths.sh.in b/paths.sh.in index 7b57a8a4..ad3d6846 100644 --- a/paths.sh.in +++ b/paths.sh.in @@ -6,6 +6,7 @@ export grep="@GREP@" export gmake="@MAKE@" export gnumake="@MAKE@" export make="@MAKE@" +export python="@PYTHON@" export sed="@SED@" export libtool="@LIBTOOL@" export libtoolize="@LIBTOOLIZE@" diff --git a/scripts/build/companion_tools/050-make.sh b/scripts/build/companion_tools/050-make.sh index 4c6dc4c2..aecea1ab 100644 --- a/scripts/build/companion_tools/050-make.sh +++ b/scripts/build/companion_tools/050-make.sh @@ -23,6 +23,9 @@ do_companion_tools_make_for_build() if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gmake" fi + if [ "${CT_MAKE_GNUMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gnumake" + fi CT_EndStep } @@ -39,6 +42,9 @@ do_companion_tools_make_for_host() if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gmake" fi + if [ "${CT_MAKE_GNUMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gnumake" + fi CT_EndStep } diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 72d13df5..9901217d 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -64,15 +64,12 @@ do_debug_gdb_build() { if [ "${CT_GDB_CROSS_PYTHON}" = "y" ]; then if [ -z "${CT_GDB_CROSS_PYTHON_BINARY}" ]; then - for p in python python3 python2; do - _p=$( which "${p}" || true ) - if [ -n "${_p}" ]; then - cross_extra_config+=("--with-python=${_p}") - break - fi - done - if [ -z "${_p}" ]; then - CT_Abort "Python support requested in cross-gdb, but Python not found. Set CT_GDB_CROSS_PYTHON_BINARY in your config." + if [ "${CT_CANADIAN}" = "y" -o "${CT_CROSS_NATIVE}" = "y" ]; then + CT_Abort "For canadian build, Python wrapper runnable on the build machine must be provided. Set CT_GDB_CROSS_PYTHON_BINARY." + elif [ "${CT_CONFIGURE_has_python}" = "y" ]; then + cross_extra_config+=("--with-python=${python}") + else + CT_Abort "Python support requested in GDB, but Python not found. Set CT_GDB_CROSS_PYTHON_BINARY." fi else cross_extra_config+=("--with-python=${CT_GDB_CROSS_PYTHON_BINARY}")