From: Martin Storsjo Date: Tue, 5 Feb 2019 08:16:06 +0000 (+0000) Subject: [MinGW] Hook up the --no-insert-timestamp option X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=537a718fcbbc830ba660477af5a7328cd157c8b9;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index 723a779..71e86f5 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -187,6 +187,9 @@ bool mingw::link(ArrayRef ArgsArr, raw_ostream &Diag) { Args.getLastArgValue(OPT_m) != "arm64pe" && !Args.hasArg(OPT_dynamicbase)) Add("-dynamicbase:no"); + if (Args.hasArg(OPT_no_insert_timestamp)) + Add("-timestamp:0"); + if (Args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, false)) Add("-opt:ref"); else diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td index 4dc6133..d5c1763 100644 --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -22,6 +22,8 @@ def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; def map: S<"Map">, HelpText<"Output a linker map">; def map_eq: J<"Map=">, Alias; +def no_insert_timestamp: F<"no-insert-timestamp">, + HelpText<"Don't include PE header timestamp">; def no_whole_archive: F<"no-whole-archive">, HelpText<"No longer include all object files for following archives">; def large_address_aware: Flag<["--"], "large-address-aware">, diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test index 3222bb1..b853527 100644 --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -151,3 +151,6 @@ REQUIRE-DEFINED: -include:_foo -include:_bar -include:_baz -include:_foo2 RUN: ld.lld -### -m i386pep foo.o -Llibpath | FileCheck -check-prefix LIBPATH %s LIBPATH: -libpath:libpath + +RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp | FileCheck -check-prefix NOTIMESTAMP %s +NOTIMESTAMP: -timestamp:0