This is an archive of the discontinued LLVM Phabricator instance.

Support SOURCE_DATE_EPOCH environment variable

Authored by emaste on May 30 2016, 8:17 AM.



SOURCE_DATE_EPOCH specifies a UNIX timestamp (number of seconds since 01 Jan 1970 00:00:00 UTC) to be used as the timestamp input for build processes e.g. __DATE__ and __TIME__

See for details, and GCC support at

Diff Detail

Event Timeline

emaste updated this revision to Diff 58959.May 30 2016, 8:17 AM
emaste retitled this revision from to Support SOURCE_DATE_EPOCH environment variable.
emaste updated this object.
emaste added a subscriber: cfe-commits.
emaste added a subscriber: dim.
mattia added a subscriber: mattia.May 30 2016, 8:25 AM
emaste updated this revision to Diff 58977.May 30 2016, 10:32 AM

Use gmtime to report in UTC when SOURCE_DATE_EPOCH is set. This follows GCC and makes sense given the purpose of SOURCE_DATE_EPOCH.

For reference here is discussion on the GCC list when this was introduced there:

emaste abandoned this revision.Jan 3 2017, 10:55 AM

Abandon in favour of D23934