Skip to contentSkip to conversation

kbuild: partial revert of "remove cc-option test of -Werror=date-time"

PATCH New Paul Gortmaker 1 participant 1 message Jan 10, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: partial revert of "remove cc-option test of -Werror=date-time"

In commit 87de84c9140e1ccb221c68bb7e4939e880b3f2bb ("kbuild: remove cc-option test of -Werror=date-time") the check for support of the date-time option was removed.

However, by removing it from the top level Makefile, it breaks all the normal compiler version checks, because GCC fails at the command line parsing, and never gets to the CPP #error check in the headers.

So for gcc-4.8 (now unsupported) you get the confusing:

cc1: error: -Werror=date-time: no option -Wdate-time

instead of the previous and expected error message of:

   # error Sorry, your version of GCC is too old - please use 4.9 or newer.

Restore the check in the top level Makefile so the longstanding GCC arch independent version check works again for v4.8 and older.

Fixes 87de84c9140e ("kbuild: remove cc-option test of -Werror=date-time")
Cc Masahiro Yamada <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Will Deacon <[email protected]>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e30cf02da8b8..e2f9e6582a10 100644
@@ -937,7 +937,7 @@ KBUILD_CFLAGS  += -fno-stack-check
 KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
 
 # Prohibit date/time macros, which would make the build non-deterministic
-KBUILD_CFLAGS   += -Werror=date-time
+KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)
 
 # enforce correct pointer usage
 KBUILD_CFLAGS   += $(call cc-option,-Werror=incompatible-pointer-types)
Signature · 1 line
2.17.1