Hi Marius! Marius Bakke <mba...@fastmail.com> skribis:
> This patch should obsolete the 'snippets' that mess with the __DATE__ > and __TIME__ macros in GCC. Woohoo! \o/ > 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? The ‘guix environment’ session you show is exactly how I would have tested it, so I don’t think there’s more to be tested, is there? > * gnu/packages/patches/gcc-5-source-date-epoch-1.patch, > gnu/packages/patches/gcc-5-source-date-epoch-2.patch: New files. > * gnu/local.mk (dist_patch_DATA): Register them. > * gnu/packages/gcc.scm (gcc-5)[source]: Use them. [...] > +++ b/gnu/packages/patches/gcc-5-source-date-epoch-1.patch > @@ -0,0 +1,223 @@ > +Make GCC respect SOURCE_DATE_EPOCH in __DATE__ and __TIME__ macros. > + > +Patch adapted from upstream source repository: > + > +https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e3e8c48c4a494d9da741c1c8ea6c4c0b7c4ff934 > + > +From e3e8c48c4a494d9da741c1c8ea6c4c0b7c4ff934 Mon Sep 17 00:00:00 2001 > +From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> > +Date: Thu, 28 Apr 2016 09:12:05 +0000 > +Subject: [PATCH] gcc/c-family/ChangeLog: > + > +2016-04-28 Eduard Sanou <dh...@openmailbox.org> > + Matthias Klose <d...@debian.org> > + > + * c-common.c (get_source_date_epoch): New function, gets the environment > + variable SOURCE_DATE_EPOCH and parses it as long long with error > + handling. > + * c-common.h (get_source_date_epoch): Prototype. > + * c-lex.c (c_lex_with_flags): set parse_in->source_date_epoch. > + > +gcc/ChangeLog: > + > +2016-04-28 Eduard Sanou <dh...@openmailbox.org> > + Matthias Klose <d...@debian.org> > + > + * doc/cppenv.texi: Document SOURCE_DATE_EPOCH environment variable. > + > +libcpp/ChangeLog: > + > +2016-04-28 Eduard Sanou <dh...@openmailbox.org> > + Matthias Klose <d...@debian.org> > + > + * include/cpplib.h (cpp_init_source_date_epoch): Prototype. > + * init.c (cpp_init_source_date_epoch): New function. > + * internal.h: Added source_date_epoch variable to struct > + cpp_reader to store a reproducible date. > + * macro.c (_cpp_builtin_macro_text): Set pfile->date timestamp from > + pfile->source_date_epoch instead of localtime if source_date_epoch is > + set, to be used for __DATE__ and __TIME__ macros to help reproducible > + builds. I’d only keep the subject line of the patch rather than the complete log, to keep it small. We have the upstream commit URL anyway. Apart from that, LGTM for ‘core-updates’. Next we can remove all those __DATE__/__TIME__ snippets and dance! Thank you! Ludo’.