[1/1] BFD: Use SOURCE_DATE_EPOCH for COFF style armaps.
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
Commit Message
Previously, ar created archives where the files have timestamps corresponding to SOURCE_DATE_EPOCH (if set), but the armap has a timestamp corresponding to the current system time. This change ensures that the armap has a timestamp corresponding to SOURCE_DATE_EPOCH as well (if set).
Per SOURCE_DATE_EPOCH specification [1]: “Build processes MUST use this variable for embedded timestamps in place of the "current" date and time.”
This change is not relevant when deterministic mode is enabled, since in that case, the armap timestamp will be set to 0, regardless of SOURCE_DATE_EPOCH.
[1] https://reproducible-builds.org/specs/source-date-epoch/
Signed-off-by: Manuel Jacob <me@manueljacob.de>
---
bfd/archive.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 15.04.2026 23:57, Manuel Jacob wrote:
> Previously, ar created archives where the files have timestamps corresponding to SOURCE_DATE_EPOCH (if set), but the armap has a timestamp corresponding to the current system time. This change ensures that the armap has a timestamp corresponding to SOURCE_DATE_EPOCH as well (if set).
>
> Per SOURCE_DATE_EPOCH specification [1]: “Build processes MUST use this variable for embedded timestamps in place of the "current" date and time.”
>
> This change is not relevant when deterministic mode is enabled, since in that case, the armap timestamp will be set to 0, regardless of SOURCE_DATE_EPOCH.
>
> [1] https://reproducible-builds.org/specs/source-date-epoch/
>
> Signed-off-by: Manuel Jacob <me@manueljacob.de>
Okay.
Jan
@@ -2915,7 +2915,7 @@ _bfd_coff_write_armap (bfd *arch,
return false;
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0
- ? time (NULL) : 0));
+ ? bfd_get_current_time (0) : 0));
/* This, at least, is what Intel coff sets the values to. */
_bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", 0);
_bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", 0);