[lld] r309128 - Merging r308998 and r309002:

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 09:07:19 PDT 2017


Author: hans
Date: Wed Jul 26 09:07:19 2017
New Revision: 309128

URL: http://llvm.org/viewvc/llvm-project?rev=309128&view=rev
Log:
Merging r308998 and r309002:
------------------------------------------------------------------------
r308998 | nico | 2017-07-25 11:08:03 -0700 (Tue, 25 Jul 2017) | 7 lines

lld: only write .manifest files if /manifest is passed, PR33925

Also emit an error if /manifestinput: is used without /manifest:embed.
Increases compatibility with link.exe

https://reviews.llvm.org/D35842

------------------------------------------------------------------------

------------------------------------------------------------------------
r309002 | nico | 2017-07-25 11:39:38 -0700 (Tue, 25 Jul 2017) | 6 lines

Attempt to fix lld tests on Windows after 308998.

The test used /manifestinput: without /manifest:embed, which isn't actually
supported.  Just remove this part of the test for now; if it's important to
check this the llvm-readobj part should be extended to check this.

------------------------------------------------------------------------

Modified:
    lld/branches/release_50/   (props changed)
    lld/branches/release_50/COFF/Config.h
    lld/branches/release_50/COFF/Driver.cpp
    lld/branches/release_50/test/COFF/manifest.test
    lld/branches/release_50/test/COFF/manifestinput.test

Propchange: lld/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 26 09:07:19 2017
@@ -1 +1 @@
-/lld/trunk:308492,308728,308935
+/lld/trunk:308492,308728,308935,308998,309002

Modified: lld/branches/release_50/COFF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_50/COFF/Config.h?rev=309128&r1=309127&r2=309128&view=diff
==============================================================================
--- lld/branches/release_50/COFF/Config.h (original)
+++ lld/branches/release_50/COFF/Config.h Wed Jul 26 09:07:19 2017
@@ -130,7 +130,7 @@ struct Configuration {
   std::map<StringRef, uint32_t> Section;
 
   // Options for manifest files.
-  ManifestKind Manifest = SideBySide;
+  ManifestKind Manifest = No;
   int ManifestID = 1;
   StringRef ManifestDependency;
   bool ManifestUAC = true;

Modified: lld/branches/release_50/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_50/COFF/Driver.cpp?rev=309128&r1=309127&r2=309128&view=diff
==============================================================================
--- lld/branches/release_50/COFF/Driver.cpp (original)
+++ lld/branches/release_50/COFF/Driver.cpp Wed Jul 26 09:07:19 2017
@@ -899,18 +899,25 @@ void LinkerDriver::link(ArrayRef<const c
   for (auto *Arg : Args.filtered(OPT_section))
     parseSection(Arg->getValue());
 
-  // Handle /manifest
-  if (auto *Arg = Args.getLastArg(OPT_manifest_colon))
-    parseManifest(Arg->getValue());
+  // Handle /manifestdependency. This enables /manifest unless /manifest:no is
+  // also passed.
+  if (auto *Arg = Args.getLastArg(OPT_manifestdependency)) {
+    Config->ManifestDependency = Arg->getValue();
+    Config->Manifest = Configuration::SideBySide;
+  }
+
+  // Handle /manifest and /manifest:
+  if (auto *Arg = Args.getLastArg(OPT_manifest, OPT_manifest_colon)) {
+    if (Arg->getOption().getID() == OPT_manifest)
+      Config->Manifest = Configuration::SideBySide;
+    else
+      parseManifest(Arg->getValue());
+  }
 
   // Handle /manifestuac
   if (auto *Arg = Args.getLastArg(OPT_manifestuac))
     parseManifestUAC(Arg->getValue());
 
-  // Handle /manifestdependency
-  if (auto *Arg = Args.getLastArg(OPT_manifestdependency))
-    Config->ManifestDependency = Arg->getValue();
-
   // Handle /manifestfile
   if (auto *Arg = Args.getLastArg(OPT_manifestfile))
     Config->ManifestFile = Arg->getValue();
@@ -919,6 +926,11 @@ void LinkerDriver::link(ArrayRef<const c
   for (auto *Arg : Args.filtered(OPT_manifestinput))
     Config->ManifestInput.push_back(Arg->getValue());
 
+  if (!Config->ManifestInput.empty() &&
+      Config->Manifest != Configuration::Embed) {
+    fatal("/MANIFESTINPUT: requires /MANIFEST:EMBED");
+  }
+
   // Handle miscellaneous boolean flags.
   if (Args.hasArg(OPT_allowisolation_no))
     Config->AllowIsolation = false;

Modified: lld/branches/release_50/test/COFF/manifest.test
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_50/test/COFF/manifest.test?rev=309128&r1=309127&r2=309128&view=diff
==============================================================================
--- lld/branches/release_50/test/COFF/manifest.test (original)
+++ lld/branches/release_50/test/COFF/manifest.test Wed Jul 26 09:07:19 2017
@@ -1,6 +1,10 @@
 # RUN: yaml2obj %p/Inputs/ret42.yaml > %t.obj
 
+# RUN: rm -f %t.exe.manifest
 # RUN: lld-link /out:%t.exe /entry:main %t.obj
+# RUN: test ! -e %t.exe.manifest
+
+# RUN: lld-link /manifest /out:%t.exe /entry:main %t.obj
 # RUN: FileCheck -check-prefix=MANIFEST %s < %t.exe.manifest
 
 MANIFEST: <?xml version="1.0" standalone="yes"?>
@@ -15,7 +19,7 @@ MANIFEST:     </security>
 MANIFEST:   </trustInfo>
 MANIFEST: </assembly>
 
-# RUN: lld-link /out:%t.exe /entry:main \
+# RUN: lld-link /out:%t.exe /entry:main /manifest \
 # RUN:   /manifestuac:"level='requireAdministrator' uiAccess='true'" %t.obj
 # RUN: FileCheck -check-prefix=UAC %s < %t.exe.manifest
 
@@ -31,6 +35,7 @@ UAC:     </security>
 UAC:   </trustInfo>
 UAC: </assembly>
 
+# /manifestdependency implies /manifest. (/manifestuac doesn't.)
 # RUN: lld-link /out:%t.exe /entry:main \
 # RUN:   /manifestdependency:"foo='bar'" %t.obj
 # RUN: FileCheck -check-prefix=DEPENDENCY %s < %t.exe.manifest
@@ -52,7 +57,7 @@ DEPENDENCY:     </dependentAssembly>
 DEPENDENCY:   </dependency>
 DEPENDENCY: </assembly>
 
-# RUN: lld-link /out:%t.exe /entry:main /manifestuac:no %t.obj
+# RUN: lld-link /manifest /out:%t.exe /entry:main /manifestuac:no %t.obj
 # RUN: FileCheck -check-prefix=NOUAC %s < %t.exe.manifest
 
 NOUAC: <?xml version="1.0" standalone="yes"?>

Modified: lld/branches/release_50/test/COFF/manifestinput.test
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_50/test/COFF/manifestinput.test?rev=309128&r1=309127&r2=309128&view=diff
==============================================================================
--- lld/branches/release_50/test/COFF/manifestinput.test (original)
+++ lld/branches/release_50/test/COFF/manifestinput.test Wed Jul 26 09:07:19 2017
@@ -2,15 +2,6 @@
 
 # RUN: yaml2obj %p/Inputs/ret42.yaml > %t.obj
 # RUN: lld-link /out:%t.exe /entry:main \
-# RUN:   /manifestuac:"level='requireAdministrator'" \
-# RUN:   /manifestinput:%p/Inputs/manifestinput.test %t.obj
-# RUN: FileCheck %s < %t.exe.manifest
-
-CHECK: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-CHECK: <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity></dependentAssembly></dependency><trustInfo><security><requestedPrivileges><requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo></assembly>
-
-# RUN: yaml2obj %p/Inputs/ret42.yaml > %t.obj
-# RUN: lld-link /out:%t.exe /entry:main \
 # RUN:   /manifest:embed \
 # RUN:   /manifestuac:"level='requireAdministrator'" \
 # RUN:   /manifestinput:%p/Inputs/manifestinput.test %t.obj




More information about the llvm-commits mailing list