aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2013-12-23 16:56:06 -0500
committerMichal Marek <mmarek@suse.cz>2014-01-27 17:14:13 -0500
commitfe7c36c7bde12190341722af69358e42171162f3 (patch)
treedc6d1f645aeee8a5b1e8799242262f2fdc935ab5
parentf9d7f7778c5206d9de34fa500f854f25edb56e4b (diff)
Makefile: Build with -Werror=date-time if the compiler supports it
GCC 4.9 and newer have a new warning -Wdate-time, which warns on any use of __DATE__, __TIME__, or __TIMESTAMP__, which would make the build non-deterministic. Now that the kernel does not use any of those macros, turn on -Werror=date-time if available, to keep it that way. The kernel already (optionally) records this information at build time in a single place; other kernel code should not duplicate that. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 455fd484b20e..731e3ce5b9ab 100644
--- a/Makefile
+++ b/Makefile
@@ -682,6 +682,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int)
682# require functions to have arguments in prototypes, not empty 'int foo()' 682# require functions to have arguments in prototypes, not empty 'int foo()'
683KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes) 683KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
684 684
685# Prohibit date/time macros, which would make the build non-deterministic
686KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
687
685# use the deterministic mode of AR if available 688# use the deterministic mode of AR if available
686KBUILD_ARFLAGS := $(call ar-option,D) 689KBUILD_ARFLAGS := $(call ar-option,D)
687 690