Skip to content

Commit ad76af4

Browse files
committed
Fix build of *-new toolchain targets with make >= 4.4
Signed-off-by: falkTX <falktx@falktx.com>
1 parent 035e913 commit ad76af4

5 files changed

Lines changed: 180 additions & 4 deletions

File tree

bootstrap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ if [ ! -f ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION}/configure ]; then
6060
;;
6161

6262
"crosstool-ng-1.25.0")
63+
patch -d ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION} -p1 -i ${SOURCE_DIR}/patches/${CT_NG_VERSION}/001_fix-make4.4-build.patch
64+
6365
cp ${SOURCE_DIR}/patches/${CT_NG_VERSION}/gcc-9.4.0/*.patch ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION}/packages/gcc/9.4.0/
6466
cp ${SOURCE_DIR}/patches/${CT_NG_VERSION}/glibc-2.27/*.patch ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION}/packages/glibc/2.27/
6567
cp ${SOURCE_DIR}/patches/${CT_NG_VERSION}/glibc-2.34/*.patch ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION}/packages/glibc/2.34/
@@ -91,7 +93,7 @@ if [ ! -f .config ]; then
9193
fi
9294

9395
if [ ! -f .stamp_configured ]; then
94-
./configure --enable-local
96+
./configure --enable-local ACLOCAL=aclocal AUTOMAKE=automake
9597
touch .stamp_configured
9698
fi
9799

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
From a7835a0251e5acdb38d7cbf301457058266bcbca Mon Sep 17 00:00:00 2001
2+
From: Chris Packham <judge.packham@gmail.com>
3+
Date: Sat, 15 Jul 2023 19:21:23 +1200
4+
Subject: [PATCH] provide a workaround for a glibc and GNU make incompatibility
5+
6+
Versions of GNU make newer than 4.4 trigger a hang in versions of glibc
7+
older than 2.31. As distros update to the newer GNU make version we'll
8+
start seeing more and more reports of this hang. Fortunately we already
9+
carry GNU make as a comp tool so all we need to do is select the right
10+
version when needed.
11+
12+
Fixes #1946, #1932, #1975
13+
Signed-off-by: Chris Packham <judge.packham@gmail.com>
14+
---
15+
config/configure.in.in | 3 +++
16+
config/libc/glibc.in | 9 +++++++++
17+
configure.ac | 7 +++++++
18+
packages/make/4.3/version.desc | 2 +-
19+
packages/make/package.desc | 1 +
20+
5 files changed, 21 insertions(+), 1 deletion(-)
21+
22+
diff --git a/config/configure.in.in b/config/configure.in.in
23+
index 91093c2d70..459852a6bf 100644
24+
--- a/config/configure.in.in
25+
+++ b/config/configure.in.in
26+
@@ -30,6 +30,9 @@ config CONFIGURE_has_make_3_81_or_newer
27+
config CONFIGURE_has_make_4_0_or_newer
28+
@KCONFIG_make_4_0_or_newer@
29+
30+
+config CONFIGURE_has_make_4_4_or_newer
31+
+ @KCONFIG_make_4_4_or_newer@
32+
+
33+
config CONFIGURE_has_libtool_2_4_or_newer
34+
@KCONFIG_libtool_2_4_or_newer@
35+
36+
diff --git a/config/libc/glibc.in b/config/libc/glibc.in
37+
index c5de44ceb6..81261cdc46 100644
38+
--- a/config/libc/glibc.in
39+
+++ b/config/libc/glibc.in
40+
@@ -64,6 +64,15 @@ config GLIBC_DEP_MAKE_4_0
41+
select COMP_TOOLS_MAKE
42+
select MAKE_GNUMAKE_SYMLINK # Override old host make in .build/tools/bin
43+
44+
+# Glibc versions older than 2.31 have a bug that triggers with GNU make 4.4 or newer
45+
+# where the build process hangs indefinitely
46+
+config GLIBC_DEP_MAKE_4_3
47+
+ def_bool y
48+
+ depends on GLIBC_older_than_2_32 && CONFIGURE_has_make_4_4_or_newer
49+
+ select COMP_TOOLS_MAKE
50+
+ select MAKE_GNUMAKE_SYMLINK
51+
+ select MAKE_REQUIRE_older_than_4_4
52+
+
53+
# Glibc 2.31 removed support for pre-v8 SPARC in 32-bit mode (64-bit mode always
54+
# required UltraSPARC)
55+
config GLIBC_SPARC_ALLOW_V7
56+
diff --git a/configure.ac b/configure.ac
57+
index 4a33c9ac01..82021b4f05 100644
58+
--- a/configure.ac
59+
+++ b/configure.ac
60+
@@ -210,6 +210,13 @@ CTNG_PROG_VERSION_REQ_ANY([MAKE],
61+
[^GNU Make [4-9]\.],
62+
[make_4_0_or_newer])
63+
64+
+CTNG_PROG_VERSION_REQ_ANY([MAKE],
65+
+ [GNU make >= 4.4],
66+
+ [make],
67+
+ [gmake make],
68+
+ [^GNU Make (4\.[4-9]|[5-9]\.)],
69+
+ [make_4_4_or_newer])
70+
+
71+
# Check other companion tools that we may or may not build.
72+
CTNG_PROG_VERSION_REQ_ANY([LIBTOOL],
73+
[GNU libtool >= 2.4],
74+
diff --git a/packages/make/4.3/version.desc b/packages/make/4.3/version.desc
75+
index e69de29..e497b2f 100644
76+
--- a/packages/make/4.3/version.desc
77+
+++ b/packages/make/4.3/version.desc
78+
@@ -0,0 +1 @@
79+
+# Not obsolete. Needed for a workaround for older glibc versions
80+
diff --git a/packages/make/package.desc b/packages/make/package.desc
81+
index bd789ade95..657a674ae0 100644
82+
--- a/packages/make/package.desc
83+
+++ b/packages/make/package.desc
84+
@@ -2,5 +2,6 @@ repository='git https://git.savannah.gnu.org/git/make.git'
85+
bootstrap='autoreconf -i'
86+
mirrors='$(CT_Mirrors GNU make)'
87+
relevantpattern='*.*|.'
88+
+milestones='4.3 4.4'
89+
archive_formats='.tar.lz .tar.gz'
90+
signature_format='packed/.sig'

toolchain/modduo-new.config

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
#
55
CT_CONFIGURE_has_static_link=y
66
CT_CONFIGURE_has_cxx11=y
7+
CT_CONFIGURE_has_lzip=y
78
CT_CONFIGURE_has_wget=y
89
CT_CONFIGURE_has_curl=y
10+
CT_CONFIGURE_has_meson=y
11+
CT_CONFIGURE_has_ninja=y
912
CT_CONFIGURE_has_rsync=y
1013
CT_CONFIGURE_has_make_3_81_or_newer=y
1114
CT_CONFIGURE_has_make_4_0_or_newer=y
15+
CT_CONFIGURE_has_make_4_4_or_newer=y
1216
CT_CONFIGURE_has_libtool_2_4_or_newer=y
1317
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
1418
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
@@ -509,6 +513,7 @@ CT_GLIBC_DEP_KERNEL_HEADERS_VERSION=y
509513
CT_GLIBC_DEP_BINUTILS=y
510514
CT_GLIBC_DEP_GCC=y
511515
CT_GLIBC_DEP_PYTHON=y
516+
CT_GLIBC_DEP_MAKE_4_3=y
512517
CT_GLIBC_SPARC_ALLOW_V7=y
513518
CT_GLIBC_BUILD_SSP=y
514519
CT_GLIBC_HAS_LIBIDN_ADDON=y
@@ -919,7 +924,30 @@ CT_ZLIB=y
919924
# CT_COMP_TOOLS_DTC is not set
920925
# CT_COMP_TOOLS_LIBTOOL is not set
921926
# CT_COMP_TOOLS_M4 is not set
922-
# CT_COMP_TOOLS_MAKE is not set
927+
CT_COMP_TOOLS_MAKE=y
928+
CT_COMP_TOOLS_MAKE_PKG_KSYM="MAKE"
929+
CT_MAKE_DIR_NAME="make"
930+
CT_MAKE_PKG_NAME="make"
931+
CT_MAKE_SRC_RELEASE=y
932+
# CT_MAKE_SRC_DEVEL is not set
933+
# CT_MAKE_SRC_CUSTOM is not set
934+
CT_MAKE_PATCH_GLOBAL=y
935+
# CT_MAKE_PATCH_BUNDLED is not set
936+
# CT_MAKE_PATCH_LOCAL is not set
937+
# CT_MAKE_PATCH_BUNDLED_LOCAL is not set
938+
# CT_MAKE_PATCH_LOCAL_BUNDLED is not set
939+
# CT_MAKE_PATCH_NONE is not set
940+
CT_MAKE_PATCH_ORDER="global"
941+
CT_MAKE_V_4_3=y
942+
# CT_MAKE_V_4_2 is not set
943+
CT_MAKE_VERSION="4.3"
944+
CT_MAKE_MIRRORS="$(CT_Mirrors GNU make)"
945+
CT_MAKE_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
946+
CT_MAKE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
947+
CT_MAKE_ARCHIVE_FORMATS=".tar.lz .tar.gz"
948+
CT_MAKE_SIGNATURE_FORMAT="packed/.sig"
949+
# CT_MAKE_GMAKE_SYMLINK is not set
950+
CT_MAKE_GNUMAKE_SYMLINK=y
923951
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
924952
# end of Companion tools
925953

toolchain/modduox-new.config

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
#
55
CT_CONFIGURE_has_static_link=y
66
CT_CONFIGURE_has_cxx11=y
7+
CT_CONFIGURE_has_lzip=y
78
CT_CONFIGURE_has_wget=y
89
CT_CONFIGURE_has_curl=y
10+
CT_CONFIGURE_has_meson=y
11+
CT_CONFIGURE_has_ninja=y
912
CT_CONFIGURE_has_rsync=y
1013
CT_CONFIGURE_has_make_3_81_or_newer=y
1114
CT_CONFIGURE_has_make_4_0_or_newer=y
15+
CT_CONFIGURE_has_make_4_4_or_newer=y
1216
CT_CONFIGURE_has_libtool_2_4_or_newer=y
1317
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
1418
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
@@ -492,6 +496,7 @@ CT_GLIBC_DEP_KERNEL_HEADERS_VERSION=y
492496
CT_GLIBC_DEP_BINUTILS=y
493497
CT_GLIBC_DEP_GCC=y
494498
CT_GLIBC_DEP_PYTHON=y
499+
CT_GLIBC_DEP_MAKE_4_3=y
495500
CT_GLIBC_SPARC_ALLOW_V7=y
496501
CT_GLIBC_BUILD_SSP=y
497502
CT_GLIBC_HAS_LIBIDN_ADDON=y
@@ -902,7 +907,30 @@ CT_ZLIB=y
902907
# CT_COMP_TOOLS_DTC is not set
903908
# CT_COMP_TOOLS_LIBTOOL is not set
904909
# CT_COMP_TOOLS_M4 is not set
905-
# CT_COMP_TOOLS_MAKE is not set
910+
CT_COMP_TOOLS_MAKE=y
911+
CT_COMP_TOOLS_MAKE_PKG_KSYM="MAKE"
912+
CT_MAKE_DIR_NAME="make"
913+
CT_MAKE_PKG_NAME="make"
914+
CT_MAKE_SRC_RELEASE=y
915+
# CT_MAKE_SRC_DEVEL is not set
916+
# CT_MAKE_SRC_CUSTOM is not set
917+
CT_MAKE_PATCH_GLOBAL=y
918+
# CT_MAKE_PATCH_BUNDLED is not set
919+
# CT_MAKE_PATCH_LOCAL is not set
920+
# CT_MAKE_PATCH_BUNDLED_LOCAL is not set
921+
# CT_MAKE_PATCH_LOCAL_BUNDLED is not set
922+
# CT_MAKE_PATCH_NONE is not set
923+
CT_MAKE_PATCH_ORDER="global"
924+
CT_MAKE_V_4_3=y
925+
# CT_MAKE_V_4_2 is not set
926+
CT_MAKE_VERSION="4.3"
927+
CT_MAKE_MIRRORS="$(CT_Mirrors GNU make)"
928+
CT_MAKE_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
929+
CT_MAKE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
930+
CT_MAKE_ARCHIVE_FORMATS=".tar.lz .tar.gz"
931+
CT_MAKE_SIGNATURE_FORMAT="packed/.sig"
932+
# CT_MAKE_GMAKE_SYMLINK is not set
933+
CT_MAKE_GNUMAKE_SYMLINK=y
906934
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
907935
# end of Companion tools
908936

toolchain/moddwarf-new.config

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
#
55
CT_CONFIGURE_has_static_link=y
66
CT_CONFIGURE_has_cxx11=y
7+
CT_CONFIGURE_has_lzip=y
78
CT_CONFIGURE_has_wget=y
89
CT_CONFIGURE_has_curl=y
10+
CT_CONFIGURE_has_meson=y
11+
CT_CONFIGURE_has_ninja=y
912
CT_CONFIGURE_has_rsync=y
1013
CT_CONFIGURE_has_make_3_81_or_newer=y
1114
CT_CONFIGURE_has_make_4_0_or_newer=y
15+
CT_CONFIGURE_has_make_4_4_or_newer=y
1216
CT_CONFIGURE_has_libtool_2_4_or_newer=y
1317
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
1418
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
@@ -492,6 +496,7 @@ CT_GLIBC_DEP_KERNEL_HEADERS_VERSION=y
492496
CT_GLIBC_DEP_BINUTILS=y
493497
CT_GLIBC_DEP_GCC=y
494498
CT_GLIBC_DEP_PYTHON=y
499+
CT_GLIBC_DEP_MAKE_4_3=y
495500
CT_GLIBC_SPARC_ALLOW_V7=y
496501
CT_GLIBC_BUILD_SSP=y
497502
CT_GLIBC_HAS_LIBIDN_ADDON=y
@@ -902,7 +907,30 @@ CT_ZLIB=y
902907
# CT_COMP_TOOLS_DTC is not set
903908
# CT_COMP_TOOLS_LIBTOOL is not set
904909
# CT_COMP_TOOLS_M4 is not set
905-
# CT_COMP_TOOLS_MAKE is not set
910+
CT_COMP_TOOLS_MAKE=y
911+
CT_COMP_TOOLS_MAKE_PKG_KSYM="MAKE"
912+
CT_MAKE_DIR_NAME="make"
913+
CT_MAKE_PKG_NAME="make"
914+
CT_MAKE_SRC_RELEASE=y
915+
# CT_MAKE_SRC_DEVEL is not set
916+
# CT_MAKE_SRC_CUSTOM is not set
917+
CT_MAKE_PATCH_GLOBAL=y
918+
# CT_MAKE_PATCH_BUNDLED is not set
919+
# CT_MAKE_PATCH_LOCAL is not set
920+
# CT_MAKE_PATCH_BUNDLED_LOCAL is not set
921+
# CT_MAKE_PATCH_LOCAL_BUNDLED is not set
922+
# CT_MAKE_PATCH_NONE is not set
923+
CT_MAKE_PATCH_ORDER="global"
924+
CT_MAKE_V_4_3=y
925+
# CT_MAKE_V_4_2 is not set
926+
CT_MAKE_VERSION="4.3"
927+
CT_MAKE_MIRRORS="$(CT_Mirrors GNU make)"
928+
CT_MAKE_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
929+
CT_MAKE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
930+
CT_MAKE_ARCHIVE_FORMATS=".tar.lz .tar.gz"
931+
CT_MAKE_SIGNATURE_FORMAT="packed/.sig"
932+
# CT_MAKE_GMAKE_SYMLINK is not set
933+
CT_MAKE_GNUMAKE_SYMLINK=y
906934
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
907935
# end of Companion tools
908936

0 commit comments

Comments
 (0)