Skip to content

Commit 537a718

Browse files
committedFeb 5, 2019
[MinGW] Hook up the --no-insert-timestamp option
This fixes PR40582. Patch by Georg Koppen! Differential Revision: https://reviews.llvm.org/D57679 llvm-svn: 353145
1 parent f3da6ab commit 537a718

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

Diff for: ‎lld/MinGW/Driver.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
187187
Args.getLastArgValue(OPT_m) != "arm64pe" && !Args.hasArg(OPT_dynamicbase))
188188
Add("-dynamicbase:no");
189189

190+
if (Args.hasArg(OPT_no_insert_timestamp))
191+
Add("-timestamp:0");
192+
190193
if (Args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, false))
191194
Add("-opt:ref");
192195
else

Diff for: ‎lld/MinGW/Options.td

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
2222
def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
2323
def map: S<"Map">, HelpText<"Output a linker map">;
2424
def map_eq: J<"Map=">, Alias<map>;
25+
def no_insert_timestamp: F<"no-insert-timestamp">,
26+
HelpText<"Don't include PE header timestamp">;
2527
def no_whole_archive: F<"no-whole-archive">,
2628
HelpText<"No longer include all object files for following archives">;
2729
def large_address_aware: Flag<["--"], "large-address-aware">,

Diff for: ‎lld/test/MinGW/driver.test

+3
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,6 @@ REQUIRE-DEFINED: -include:_foo -include:_bar -include:_baz -include:_foo2
151151

152152
RUN: ld.lld -### -m i386pep foo.o -Llibpath | FileCheck -check-prefix LIBPATH %s
153153
LIBPATH: -libpath:libpath
154+
155+
RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp | FileCheck -check-prefix NOTIMESTAMP %s
156+
NOTIMESTAMP: -timestamp:0

0 commit comments

Comments
 (0)
Please sign in to comment.