diff mbox

[7/7] Makefile: Build with -Werror=date-time if the compiler supports it

Message ID 106ff2bbebe0c2c75bedf1c52a666d638b4dc20e.1387833347.git.josh@joshtriplett.org (mailing list archive)
State New, archived
Headers show

Commit Message

Josh Triplett Dec. 23, 2013, 9:56 p.m. UTC
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(+)

Comments

Michal Marek Jan. 3, 2014, 4:40 p.m. UTC | #1
On 2013-12-23 22:56, Josh Triplett wrote:
> 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.

Nice, I didn't know about -Wdate-time. Do you want me to merge the
entire series, or do you want individual maintainers merge the patches?
In the latter case, I'd wait with applying 7/7 in order not to break the
build. At any rate, you can add

Acked-by: Michal Marek <mmarek@suse.cz>

Thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josh Triplett Jan. 3, 2014, 8:29 p.m. UTC | #2
On Fri, Jan 03, 2014 at 05:40:52PM +0100, Michal Marek wrote:
> On 2013-12-23 22:56, Josh Triplett wrote:
> > 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.
> 
> Nice, I didn't know about -Wdate-time. Do you want me to merge the
> entire series, or do you want individual maintainers merge the patches?
> In the latter case, I'd wait with applying 7/7 in order not to break the
> build. At any rate, you can add
> 
> Acked-by: Michal Marek <mmarek@suse.cz>

Please feel free to take the entire series through your tree; I received
some maintainer acks, but no indications that the patches are going
through their trees.

Patch 1 should have:
Reviewed-by: Jingoo Han <jg1.han@samsung.com>

and patch 3 should have:
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,
Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Jan. 3, 2014, 8:55 p.m. UTC | #3
On 3.1.2014 21:29, Josh Triplett wrote:
> Please feel free to take the entire series through your tree; I received
> some maintainer acks, but no indications that the patches are going
> through their trees.

OK. I will wait until mid next week and commit with any acks received.

Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josh Triplett Jan. 3, 2014, 9 p.m. UTC | #4
On Fri, Jan 03, 2014 at 09:55:16PM +0100, Michal Marek wrote:
> On 3.1.2014 21:29, Josh Triplett wrote:
> > Please feel free to take the entire series through your tree; I received
> > some maintainer acks, but no indications that the patches are going
> > through their trees.
> 
> OK. I will wait until mid next week and commit with any acks received.

Thanks!

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Jan. 14, 2014, 8:56 p.m. UTC | #5
Dne 3.1.2014 22:00, Josh Triplett napsal(a):
> On Fri, Jan 03, 2014 at 09:55:16PM +0100, Michal Marek wrote:
>> On 3.1.2014 21:29, Josh Triplett wrote:
>>> Please feel free to take the entire series through your tree; I received
>>> some maintainer acks, but no indications that the patches are going
>>> through their trees.
>>
>> OK. I will wait until mid next week and commit with any acks received.
> 
> Thanks!

I did not find time last week and Greg was faster and merged the driver
patches. But I'm reluctant to only merge the Makefile patch now, because
the kbuild branch would not build. I think I will send the patch to
Linus after 3.14-rc1.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josh Triplett Jan. 14, 2014, 9:40 p.m. UTC | #6
On Tue, Jan 14, 2014 at 09:56:53PM +0100, Michal Marek wrote:
> Dne 3.1.2014 22:00, Josh Triplett napsal(a):
> > On Fri, Jan 03, 2014 at 09:55:16PM +0100, Michal Marek wrote:
> >> On 3.1.2014 21:29, Josh Triplett wrote:
> >>> Please feel free to take the entire series through your tree; I received
> >>> some maintainer acks, but no indications that the patches are going
> >>> through their trees.
> >>
> >> OK. I will wait until mid next week and commit with any acks received.
> > 
> > Thanks!
> 
> I did not find time last week and Greg was faster and merged the driver
> patches. But I'm reluctant to only merge the Makefile patch now, because
> the kbuild branch would not build. I think I will send the patch to
> Linus after 3.14-rc1.

Greg, if you already have all the driver patches in your tree, perhaps
you could go ahead and take the Makefile patch through your tree as
well?  (Assuming that's OK with you, Michal?)

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Jan. 14, 2014, 9:46 p.m. UTC | #7
On Tue, Jan 14, 2014 at 01:40:15PM -0800, Josh Triplett wrote:
> On Tue, Jan 14, 2014 at 09:56:53PM +0100, Michal Marek wrote:
> > Dne 3.1.2014 22:00, Josh Triplett napsal(a):
> > > On Fri, Jan 03, 2014 at 09:55:16PM +0100, Michal Marek wrote:
> > >> On 3.1.2014 21:29, Josh Triplett wrote:
> > >>> Please feel free to take the entire series through your tree; I received
> > >>> some maintainer acks, but no indications that the patches are going
> > >>> through their trees.
> > >>
> > >> OK. I will wait until mid next week and commit with any acks received.
> > > 
> > > Thanks!
> > 
> > I did not find time last week and Greg was faster and merged the driver
> > patches. But I'm reluctant to only merge the Makefile patch now, because
> > the kbuild branch would not build. I think I will send the patch to
> > Linus after 3.14-rc1.
> 
> Greg, if you already have all the driver patches in your tree, perhaps
> you could go ahead and take the Makefile patch through your tree as
> well?  (Assuming that's OK with you, Michal?)

Did I really grab all of the other patches?  I don't remember how many
there were in this series for stuff I maintain.  If I have them all,
sure, I'll be glad to take it, otherwise I agree with Michal, it should
be sent to Linus after 3.14-rc1 is out to make sure everything is
properly synced up and you didn't miss any new drivers coming in that
missed getting converted.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Jan. 27, 2014, 10:57 p.m. UTC | #8
On 14.1.2014 22:46, Greg KH wrote:
> On Tue, Jan 14, 2014 at 01:40:15PM -0800, Josh Triplett wrote:
>> On Tue, Jan 14, 2014 at 09:56:53PM +0100, Michal Marek wrote:
>>> Dne 3.1.2014 22:00, Josh Triplett napsal(a):
>>>> On Fri, Jan 03, 2014 at 09:55:16PM +0100, Michal Marek wrote:
>>>>> On 3.1.2014 21:29, Josh Triplett wrote:
>>>>>> Please feel free to take the entire series through your tree; I received
>>>>>> some maintainer acks, but no indications that the patches are going
>>>>>> through their trees.
>>>>>
>>>>> OK. I will wait until mid next week and commit with any acks received.
>>>>
>>>> Thanks!
>>>
>>> I did not find time last week and Greg was faster and merged the driver
>>> patches. But I'm reluctant to only merge the Makefile patch now, because
>>> the kbuild branch would not build. I think I will send the patch to
>>> Linus after 3.14-rc1.
>>
>> Greg, if you already have all the driver patches in your tree, perhaps
>> you could go ahead and take the Makefile patch through your tree as
>> well?  (Assuming that's OK with you, Michal?)
> 
> Did I really grab all of the other patches?  I don't remember how many
> there were in this series for stuff I maintain.  If I have them all,
> sure, I'll be glad to take it, otherwise I agree with Michal, it should
> be sent to Linus after 3.14-rc1 is out to make sure everything is
> properly synced up and you didn't miss any new drivers coming in that
> missed getting converted.

FYI: The remaining patches are now in the kbuild.git#drop-time branch
and also in the for-next branch.

Thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)