toolchain/toolchain-wrapper: let recent GCC handle SOURCE_DATE_EPOCH
authorJohn Keeping <john@metanate.com>
Fri, 26 Jun 2020 15:49:27 +0000 (16:49 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 27 Jun 2020 15:19:53 +0000 (17:19 +0200)
commit408bc354a9c14b3940938cfb7a3e3eefa81641a5
tree47384257f63693a28687b114167bc26e56d88a50
parent8c393d2c6f766fc757329893997f48e5dc641474
toolchain/toolchain-wrapper: let recent GCC handle SOURCE_DATE_EPOCH

When using precompiled headers, changing any macros defined on the
command line will invalidate the precompiled header.  With
toolchain-wrapper adding __DATE__ and __TIME__, any commits to Buildroot
will invalidate incremental builds regardless of whether the precompiled
header actually uses those values (affecting _OVERRIDE_SRCDIR).

GCC-7 and later support SOURCE_DATE_EPOCH and use it to define __DATE__
and __TIME__ internally, avoiding any impact on precompiled headers.

Disable the custom handling in toolchain-wrapper if GCC is version 7 or
newer.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
toolchain/toolchain-wrapper.c
toolchain/toolchain-wrapper.mk