All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: Michal Marek <mmarek@suse.cz>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] Makefile: Build with -Werror=date-time if the compiler supports it
Date: Mon, 23 Dec 2013 13:56:06 -0800	[thread overview]
Message-ID: <106ff2bbebe0c2c75bedf1c52a666d638b4dc20e.1387833347.git.josh@joshtriplett.org> (raw)
In-Reply-To: <cover.1387833347.git.josh@joshtriplett.org>

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>
---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index 14d592c..188eea7 100644
--- a/Makefile
+++ b/Makefile
@@ -668,6 +668,9 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=implicit-int)
 # require functions to have arguments in prototypes, not empty 'int foo()'
 KBUILD_CFLAGS   += $(call cc-option,-Werror=strict-prototypes)
 
+# Prohibit date/time macros, which would make the build non-deterministic
+KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)
+
 # use the deterministic mode of AR if available
 KBUILD_ARFLAGS := $(call ar-option,D)
 
-- 
1.8.5.2


  parent reply	other threads:[~2013-12-23 21:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 21:54 [PATCH 0/7] Eliminate uses of __DATE__ and __TIME__ Josh Triplett
2013-12-23 21:54 ` [PATCH 1/7] mtd: denali: Drop print of build date/time Josh Triplett
2013-12-26  8:24   ` Jingoo Han
2013-12-26  8:24     ` Jingoo Han
2014-01-09 16:55     ` Brian Norris
2014-01-09 16:55       ` Brian Norris
2013-12-23 21:55 ` [PATCH 2/7] net: wireless: brcm80211: Drop debug version with " Josh Triplett
2013-12-23 21:55 ` [PATCH 3/7] staging: rtl8188eu: Drop print of " Josh Triplett
2013-12-24  1:15   ` Larry Finger
2013-12-23 21:55 ` [PATCH 4/7] staging: rts5139: Drop print of build time Josh Triplett
2013-12-23 21:55 ` [PATCH 5/7] staging: wlags49_h2: Drop debug macro recording build date/time Josh Triplett
2013-12-23 21:55 ` [PATCH 6/7] x86: math-emu: Drop already-disabled print of build date Josh Triplett
2013-12-23 21:56 ` Josh Triplett [this message]
2014-01-03 16:40   ` [PATCH 7/7] Makefile: Build with -Werror=date-time if the compiler supports it Michal Marek
2014-01-03 20:29     ` Josh Triplett
2014-01-03 20:55       ` Michal Marek
2014-01-03 21:00         ` Josh Triplett
2014-01-14 20:56           ` Michal Marek
2014-01-14 21:40             ` Josh Triplett
2014-01-14 21:46               ` Greg KH
2014-01-27 22:57                 ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=106ff2bbebe0c2c75bedf1c52a666d638b4dc20e.1387833347.git.josh@joshtriplett.org \
    --to=josh@joshtriplett.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.