[OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

Petr Štetiar ynezz at true.cz
Tue Nov 12 03:16:25 EST 2019


Currently minimal GNU supported GCC version is 7 (from May 2, 2017), buildbots
are using default GCC version 6 on Debian 9 (old stable), current Debian
stable 10 has GCC version 8.

Signed-off-by: Petr Štetiar <ynezz at true.cz>
---

While adding CI support in C based projects, I've started adding -Wextra as
well, which seems to work just fine for gcc6+, but it's apparently causing
issues with older GCCs like for example gcc 4.8.5[1] on CentOS 7.

Although it's certainly possible to fix those issues and make gcc 4 usable, I
think, that it's not worth the additional effort and resources anymore.

1. https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b

 README                  |  2 +-
 include/prereq-build.mk | 18 ++++--------------
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/README b/README
index c867c1fa4da8..6d11dd1188ff 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ To build your own firmware you need a Linux, BSD or MacOSX system (case
 sensitive filesystem required). Cygwin is unsupported because of the lack
 of a case sensitive file system.
 
-You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff,
+You need gcc6+, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff,
 unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
 
 1. Run "./scripts/feeds update -a" to obtain all the latest package definitions
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 4c5991005634..58cbc0678fa1 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -27,12 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \
 	umask | grep -xE 0?0[012][012]))
 
 $(eval $(call SetupHostCommand,gcc, \
-	Please install the GNU C Compiler (gcc) 4.8 or later, \
-	$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-	gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-	gcc48 --version | grep gcc, \
-	gcc49 --version | grep gcc, \
-	gcc5 --version | grep gcc, \
+	Please install the GNU C Compiler (gcc) 6 or later, \
 	gcc6 --version | grep gcc, \
 	gcc7 --version | grep gcc, \
 	gcc8 --version | grep gcc, \
@@ -40,18 +35,13 @@ $(eval $(call SetupHostCommand,gcc, \
 	gcc --version | grep -E 'Apple.(LLVM|clang)' ))
 
 $(eval $(call TestHostCommand,working-gcc, \
-	\nPlease reinstall the GNU C Compiler (4.8 or later) - \
+	\nPlease reinstall the GNU C Compiler (6 or later) - \
 	it appears to be broken, \
 	echo 'int main(int argc, char **argv) { return 0; }' | \
 		gcc -x c -o $(TMP_DIR)/a.out -))
 
 $(eval $(call SetupHostCommand,g++, \
-	Please install the GNU C++ Compiler (g++) 4.8 or later, \
-	$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-	g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-	g++48 --version | grep g++, \
-	g++49 --version | grep g++, \
-	g++5 --version | grep g++, \
+	Please install the GNU C++ Compiler (g++) 6 or later, \
 	g++6 --version | grep g++, \
 	g++7 --version | grep g++, \
 	g++8 --version | grep g++, \
@@ -59,7 +49,7 @@ $(eval $(call SetupHostCommand,g++, \
 	g++ --version | grep -E 'Apple.(LLVM|clang)' ))
 
 $(eval $(call TestHostCommand,working-g++, \
-	\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
+	\nPlease reinstall the GNU C++ Compiler (6 or later) - \
 	it appears to be broken, \
 	echo 'int main(int argc, char **argv) { return 0; }' | \
 		g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list