Skip to content

Commit 9521880

Browse files
committed
Fix build of gcc7 targets with make >= 4.4
Signed-off-by: falkTX <falktx@falktx.com>
1 parent eff3724 commit 9521880

5 files changed

Lines changed: 181 additions & 6 deletions

File tree

bootstrap.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ if [ ! -f ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION}/configure ]; then
5555
"crosstool-ng-1.24.0")
5656
patch -d ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION} -p1 -i ${SOURCE_DIR}/patches/${CT_NG_VERSION}/001_linaro-2019.12.patch
5757
patch -d ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION} -p1 -i ${SOURCE_DIR}/patches/${CT_NG_VERSION}/002_linaro-gcc7-selects.patch
58+
patch -d ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION} -p1 -i ${SOURCE_DIR}/patches/${CT_NG_VERSION}/003_fix-make4.4-build.patch
5859

5960
cp ${SOURCE_DIR}/patches/${CT_NG_VERSION}/glibc-2.27/*.patch ${TOOLCHAIN_BUILD_DIR}/${CT_NG_VERSION}/packages/glibc/2.27/
6061
;;
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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 MAKE_REQUIRE_4_0_or_later
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_2
47+
+ def_bool y
48+
+ depends on GLIBC_older_than_2_29 && CONFIGURE_has_make_4_4_or_newer
49+
+ select COMP_TOOLS_MAKE
50+
+ select MAKE_GNUMAKE_SYMLINK
51+
+ select MAKE_V_4_2
52+
+
53+
config GLIBC_DEP_GCC
54+
def_bool y
55+
select GCC_REQUIRE_4_9_or_later if GLIBC_2_26_or_later
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.2.1/version.desc b/packages/make/4.2.1/version.desc
75+
index e69de29..e497b2f 100644
76+
--- a/packages/make/4.2.1/version.desc
77+
+++ b/packages/make/4.2.1/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+
@@ -4,4 +4,4 @@ mirrors='$(CT_Mirrors GNU make)'
85+
relevantpattern='*.*|.'
86+
archive_formats='.tar.bz2 .tar.gz'
87+
signature_format='packed/.sig'
88+
-milestones='4.0'
89+
+milestones='4.0 4.2.1'

toolchain/modduo-static.config

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CT_CONFIGURE_has_wget=y
88
CT_CONFIGURE_has_curl=y
99
CT_CONFIGURE_has_make_3_81_or_newer=y
1010
CT_CONFIGURE_has_make_4_0_or_newer=y
11+
CT_CONFIGURE_has_make_4_4_or_newer=y
1112
CT_CONFIGURE_has_libtool_2_4_or_newer=y
1213
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
1314
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
@@ -17,7 +18,6 @@ CT_CONFIGURE_has_gnu_m4_1_4_12_or_newer=y
1718
CT_CONFIGURE_has_python_3_4_or_newer=y
1819
CT_CONFIGURE_has_bison_2_7_or_newer=y
1920
CT_CONFIGURE_has_python=y
20-
CT_CONFIGURE_has_dtc=y
2121
CT_CONFIGURE_has_cvs=y
2222
CT_CONFIGURE_has_svn=y
2323
CT_CONFIGURE_has_git=y
@@ -499,6 +499,7 @@ CT_GLIBC_DEP_KERNEL_HEADERS_VERSION=y
499499
CT_GLIBC_DEP_BINUTILS=y
500500
CT_GLIBC_DEP_GCC=y
501501
CT_GLIBC_DEP_PYTHON=y
502+
CT_GLIBC_DEP_MAKE_4_2=y
502503
CT_GLIBC_HAS_LIBIDN_ADDON=y
503504
# CT_GLIBC_USE_LIBIDN_ADDON is not set
504505
CT_GLIBC_HAS_OBSOLETE_RPC=y
@@ -908,7 +909,35 @@ CT_ZLIB=y
908909
# CT_COMP_TOOLS_DTC is not set
909910
# CT_COMP_TOOLS_LIBTOOL is not set
910911
# CT_COMP_TOOLS_M4 is not set
911-
# CT_COMP_TOOLS_MAKE is not set
912+
CT_COMP_TOOLS_MAKE=y
913+
CT_COMP_TOOLS_MAKE_PKG_KSYM="MAKE"
914+
CT_MAKE_DIR_NAME="make"
915+
CT_MAKE_PKG_NAME="make"
916+
CT_MAKE_SRC_RELEASE=y
917+
# CT_MAKE_SRC_DEVEL is not set
918+
# CT_MAKE_SRC_CUSTOM is not set
919+
CT_MAKE_PATCH_GLOBAL=y
920+
# CT_MAKE_PATCH_BUNDLED is not set
921+
# CT_MAKE_PATCH_LOCAL is not set
922+
# CT_MAKE_PATCH_BUNDLED_LOCAL is not set
923+
# CT_MAKE_PATCH_LOCAL_BUNDLED is not set
924+
# CT_MAKE_PATCH_NONE is not set
925+
CT_MAKE_PATCH_ORDER="global"
926+
CT_MAKE_V_4_2=y
927+
# CT_MAKE_V_4_1 is not set
928+
# CT_MAKE_V_4_0 is not set
929+
# CT_MAKE_V_3_81 is not set
930+
# CT_MAKE_NO_VERSIONS is not set
931+
CT_MAKE_VERSION="4.2.1"
932+
CT_MAKE_MIRRORS="$(CT_Mirrors GNU make)"
933+
CT_MAKE_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
934+
CT_MAKE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
935+
CT_MAKE_ARCHIVE_FORMATS=".tar.bz2 .tar.gz"
936+
CT_MAKE_SIGNATURE_FORMAT="packed/.sig"
937+
CT_MAKE_later_than_4_0=y
938+
CT_MAKE_4_0_or_later=y
939+
# CT_MAKE_GMAKE_SYMLINK is not set
940+
CT_MAKE_GNUMAKE_SYMLINK=y
912941
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
913942

914943
#

toolchain/modduox-static.config

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CT_CONFIGURE_has_wget=y
88
CT_CONFIGURE_has_curl=y
99
CT_CONFIGURE_has_make_3_81_or_newer=y
1010
CT_CONFIGURE_has_make_4_0_or_newer=y
11+
CT_CONFIGURE_has_make_4_4_or_newer=y
1112
CT_CONFIGURE_has_libtool_2_4_or_newer=y
1213
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
1314
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
@@ -17,7 +18,6 @@ CT_CONFIGURE_has_gnu_m4_1_4_12_or_newer=y
1718
CT_CONFIGURE_has_python_3_4_or_newer=y
1819
CT_CONFIGURE_has_bison_2_7_or_newer=y
1920
CT_CONFIGURE_has_python=y
20-
CT_CONFIGURE_has_dtc=y
2121
CT_CONFIGURE_has_cvs=y
2222
CT_CONFIGURE_has_svn=y
2323
CT_CONFIGURE_has_git=y
@@ -468,6 +468,7 @@ CT_GLIBC_DEP_KERNEL_HEADERS_VERSION=y
468468
CT_GLIBC_DEP_BINUTILS=y
469469
CT_GLIBC_DEP_GCC=y
470470
CT_GLIBC_DEP_PYTHON=y
471+
CT_GLIBC_DEP_MAKE_4_2=y
471472
CT_GLIBC_HAS_LIBIDN_ADDON=y
472473
# CT_GLIBC_USE_LIBIDN_ADDON is not set
473474
CT_GLIBC_HAS_OBSOLETE_RPC=y
@@ -877,7 +878,35 @@ CT_ZLIB=y
877878
# CT_COMP_TOOLS_DTC is not set
878879
# CT_COMP_TOOLS_LIBTOOL is not set
879880
# CT_COMP_TOOLS_M4 is not set
880-
# CT_COMP_TOOLS_MAKE is not set
881+
CT_COMP_TOOLS_MAKE=y
882+
CT_COMP_TOOLS_MAKE_PKG_KSYM="MAKE"
883+
CT_MAKE_DIR_NAME="make"
884+
CT_MAKE_PKG_NAME="make"
885+
CT_MAKE_SRC_RELEASE=y
886+
# CT_MAKE_SRC_DEVEL is not set
887+
# CT_MAKE_SRC_CUSTOM is not set
888+
CT_MAKE_PATCH_GLOBAL=y
889+
# CT_MAKE_PATCH_BUNDLED is not set
890+
# CT_MAKE_PATCH_LOCAL is not set
891+
# CT_MAKE_PATCH_BUNDLED_LOCAL is not set
892+
# CT_MAKE_PATCH_LOCAL_BUNDLED is not set
893+
# CT_MAKE_PATCH_NONE is not set
894+
CT_MAKE_PATCH_ORDER="global"
895+
CT_MAKE_V_4_2=y
896+
# CT_MAKE_V_4_1 is not set
897+
# CT_MAKE_V_4_0 is not set
898+
# CT_MAKE_V_3_81 is not set
899+
# CT_MAKE_NO_VERSIONS is not set
900+
CT_MAKE_VERSION="4.2.1"
901+
CT_MAKE_MIRRORS="$(CT_Mirrors GNU make)"
902+
CT_MAKE_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
903+
CT_MAKE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
904+
CT_MAKE_ARCHIVE_FORMATS=".tar.bz2 .tar.gz"
905+
CT_MAKE_SIGNATURE_FORMAT="packed/.sig"
906+
CT_MAKE_later_than_4_0=y
907+
CT_MAKE_4_0_or_later=y
908+
# CT_MAKE_GMAKE_SYMLINK is not set
909+
CT_MAKE_GNUMAKE_SYMLINK=y
881910
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
882911

883912
#

toolchain/moddwarf.config

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ CT_CONFIGURE_has_wget=y
88
CT_CONFIGURE_has_curl=y
99
CT_CONFIGURE_has_make_3_81_or_newer=y
1010
CT_CONFIGURE_has_make_4_0_or_newer=y
11+
CT_CONFIGURE_has_make_4_4_or_newer=y
1112
CT_CONFIGURE_has_libtool_2_4_or_newer=y
1213
CT_CONFIGURE_has_libtoolize_2_4_or_newer=y
1314
CT_CONFIGURE_has_autoconf_2_65_or_newer=y
1415
CT_CONFIGURE_has_autoreconf_2_65_or_newer=y
16+
CT_CONFIGURE_has_automake_1_15_or_newer=y
1517
CT_CONFIGURE_has_gnu_m4_1_4_12_or_newer=y
1618
CT_CONFIGURE_has_python_3_4_or_newer=y
1719
CT_CONFIGURE_has_bison_2_7_or_newer=y
1820
CT_CONFIGURE_has_python=y
19-
CT_CONFIGURE_has_dtc=y
2021
CT_CONFIGURE_has_cvs=y
2122
CT_CONFIGURE_has_svn=y
2223
CT_CONFIGURE_has_git=y
@@ -442,6 +443,7 @@ CT_GLIBC_DEP_KERNEL_HEADERS_VERSION=y
442443
CT_GLIBC_DEP_BINUTILS=y
443444
CT_GLIBC_DEP_GCC=y
444445
CT_GLIBC_DEP_PYTHON=y
446+
CT_GLIBC_DEP_MAKE_4_2=y
445447
CT_GLIBC_BUILD_SSP=y
446448
CT_GLIBC_HAS_LIBIDN_ADDON=y
447449
# CT_GLIBC_USE_LIBIDN_ADDON is not set
@@ -849,7 +851,32 @@ CT_ZLIB=y
849851
# CT_COMP_TOOLS_DTC is not set
850852
# CT_COMP_TOOLS_LIBTOOL is not set
851853
# CT_COMP_TOOLS_M4 is not set
852-
# CT_COMP_TOOLS_MAKE is not set
854+
CT_COMP_TOOLS_MAKE=y
855+
CT_COMP_TOOLS_MAKE_PKG_KSYM="MAKE"
856+
CT_MAKE_DIR_NAME="make"
857+
CT_MAKE_PKG_NAME="make"
858+
CT_MAKE_SRC_RELEASE=y
859+
# CT_MAKE_SRC_DEVEL is not set
860+
# CT_MAKE_SRC_CUSTOM is not set
861+
CT_MAKE_PATCH_GLOBAL=y
862+
# CT_MAKE_PATCH_BUNDLED is not set
863+
# CT_MAKE_PATCH_LOCAL is not set
864+
# CT_MAKE_PATCH_BUNDLED_LOCAL is not set
865+
# CT_MAKE_PATCH_LOCAL_BUNDLED is not set
866+
# CT_MAKE_PATCH_NONE is not set
867+
CT_MAKE_PATCH_ORDER="global"
868+
CT_MAKE_V_4_2=y
869+
# CT_MAKE_NO_VERSIONS is not set
870+
CT_MAKE_VERSION="4.2.1"
871+
CT_MAKE_MIRRORS="$(CT_Mirrors GNU make)"
872+
CT_MAKE_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
873+
CT_MAKE_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
874+
CT_MAKE_ARCHIVE_FORMATS=".tar.bz2 .tar.gz"
875+
CT_MAKE_SIGNATURE_FORMAT="packed/.sig"
876+
CT_MAKE_later_than_4_0=y
877+
CT_MAKE_4_0_or_later=y
878+
# CT_MAKE_GMAKE_SYMLINK is not set
879+
CT_MAKE_GNUMAKE_SYMLINK=y
853880
CT_ALL_COMP_TOOLS_CHOICES="AUTOCONF AUTOMAKE BISON DTC LIBTOOL M4 MAKE"
854881

855882
#

0 commit comments

Comments
 (0)