Hello Guix! This patch should obsolete the 'snippets' that mess with the __DATE__ and __TIME__ macros in GCC.
It is a backport of the following two commits: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e3e8c48c4a494d9da741c1c8ea6c4c0b7c4ff934 https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=dfa5c0d3f3e23e4fdb14857a42de376d9ff8601c ...with the ChangeLog entries omitted for easier maintenance. They *should* be functionally identical to Debians patches: https://anonscm.debian.org/viewvc/gcccvs/branches/sid/gcc-5/debian/patches/ ...but I have not verified this. Any takers? Tested with the following shell session: $ cat date.c #include <stdio.h> int main() { printf( "__DATE__ says: %s \n", __DATE__ ); printf( "__TIME__ says: %s \n", __TIME__ ); return 0; } $ ./pre-inst-env guix environment --ad-hoc gcc@5 binutils glibc [env]$ gcc date.c && ./a.out __DATE__ says: Jan 21 2017 __TIME__ says: 11:28:06 [env]$ SOURCE_DATE_EPOCH=42 gcc date.c && ./a.out __DATE__ says: Jan 1 1970 __TIME__ says: 00:00:42 Note: the patch is against 'master' but is intended for 'core-updates'. \o/ Marius Bakke (1): gnu: gcc@5: Respect SOURCE_DATE_EPOCH in __DATE__ and __TIME__ macros. gnu/local.mk | 2 + gnu/packages/gcc.scm | 4 +- .../patches/gcc-5-source-date-epoch-1.patch | 223 +++++++++++ .../patches/gcc-5-source-date-epoch-2.patch | 410 +++++++++++++++++++++ 4 files changed, 638 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/gcc-5-source-date-epoch-1.patch create mode 100644 gnu/packages/patches/gcc-5-source-date-epoch-2.patch -- 2.11.0