[PATCH 0/1] MR5748: winegcc: do not add timestamp to allow reproducible builds
The PE abi does not require them for binaries. Signed-off-by: Marcus Meissner <meissner(a)suse.de> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5748
From: Marcus Meissner <meissner(a)suse.de> The PE abi does not require them for binaries. Signed-off-by: Marcus Meissner <meissner(a)suse.de> --- tools/winegcc/winegcc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index fb759063da9..6de0cf85a44 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -403,7 +403,11 @@ static struct strarray get_link_args( struct options *opts, const char *output_n strarray_add( &flags, "-shared" ); strarray_add( &flags, "-Wl,--kill-at" ); } - else strarray_add( &flags, opts->gui_app ? "-mwindows" : "-mconsole" ); + else + { + strarray_add( &flags, opts->gui_app ? "-mwindows" : "-mconsole" ); + strarray_add( &flags, "-Wl,--no-insert-timestamp" ); + } if (opts->unicode_app) strarray_add( &flags, "-municode" ); if (opts->nodefaultlibs || opts->use_msvcrt) strarray_add( &flags, "-nodefaultlibs" ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5748
Hi Marcus the drawback of having a zero timestamp is that is will likely generate collisions when storing PE modules in a symbol store (the keys used for storing are: filename, file size (rounded to page size IIRC), and timestamp)) for repro build, we should either: - pass the timestamp as an external item and let winegcc handles it (setting SOURCE_DATE_EPOCH env var should do, or option --insert-timestamp) - implement in binutils/ld what MS linker does for repro builds: the PE timestamp is set to a hash of generated file -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5748#note_71638
I believe binutils 2.42 now honors SOURCE_DATE_EPOCH for the PE timestamp, if you want reproducible builds you would likely be building with that already. It would be nice if binutils used a hash by default, the MS linker and LLVM lld already do this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5748#note_71659
IIRC there also were some DRMs which don't like zero timestamp field. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5748#note_71930
then lets close and see if binutils does it. mingw64-cross-binutils-utils-2.39 is currently used in openSUSE. I think we will get there when its updated. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5748#note_72111
This merge request was closed by Marcus Meissner. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5748
participants (5)
-
Brendan Shanks (@bshanks) -
eric pouech (@epo) -
Marcus Meissner -
Marcus Meissner (@msmeissn) -
Paul Gofman (@gofman)