Choose better deterministic timestamp for zip

This commit is contained in:
Justine Tunney 2022-03-16 16:59:45 -07:00
parent b45d50b690
commit bf62140377
7 changed files with 32 additions and 30 deletions

View file

@ -145,6 +145,8 @@ void elfwriter_zip(struct ElfWriter *elf, const char *symbol, const char *name,
size_t lfilehdrsize, uncompsize, compsize, commentsize;
uint16_t method, gflags, mtime, mdate, iattrs, dosmode;
CHECK_NE(0, mtim.tv_sec);
gflags = 0;
iattrs = 0;
compsize = size;

View file

@ -26,11 +26,13 @@
#include "libc/runtime/gc.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/time/time.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "tool/build/lib/elfwriter.h"
@ -166,6 +168,8 @@ void zipobj(int argc, char **argv) {
}
int main(int argc, char **argv) {
timestamp.tv_sec = 1647414000; /* determinism */
/* clock_gettime(CLOCK_REALTIME, &timestamp); */
zipobj(argc, argv);
return 0;
}