--- a/makelib/config-linux-gnu.make Thu Sep 14 12:53:47 2017 +0100
+++ b/makelib/config-linux-gnu.make Tue Sep 19 11:09:57 2017 +0000
@@ -30,7 +30,23 @@
COMPRESSED_FILETYPE=targz
SETUP_RULE=setup_linux
-CC=gcc
+# We need to use at most GCC 6.x, some code may fail to compile
+# with GCC 7 due to -Werror (`send.c` for instance). We won't fix
+# that for Smalltalk/X 6.x.x, will be fixed only for Smalltalk/X 8.0.0
+ifeq (,$(shell which gcc-6))
+ifeq (,$(shell which gcc-5))
+ifeq (,$(shell which gcc-4))
+$(error Smalltalk/X requires GCC 4.x, GCC 5.x or GCC 6.x to compile, none found)
+else
+CC=gcc-4
+endif
+else
+CC=gcc-5
+endif
+else
+CC=gcc-6
+endif
+
#
# * `-fno-strict-aliasing` since it's almost impossible to write a memory