[PATCH] D116335: Make lld to support win-xp

gmh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 28 09:40:03 PST 2021


gmh5225 updated this revision to Diff 396407.
gmh5225 added a comment.

Re-upload diff


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116335/new/

https://reviews.llvm.org/D116335

Files:
  lld/COFF/Config.h
  lld/COFF/DriverUtils.cpp


Index: lld/COFF/DriverUtils.cpp
===================================================================
--- lld/COFF/DriverUtils.cpp
+++ lld/COFF/DriverUtils.cpp
@@ -386,11 +386,12 @@
 
   // Emit the XML. Note that we do *not* verify that the XML attributes are
   // syntactically correct. This is intentional for link.exe compatibility.
-  os << "<?xml version=\"1.0\" standalone=\"yes\"?>\n"
-     << "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\"\n"
-     << "          manifestVersion=\"1.0\">\n";
+  // Use microsoft xml to support win-xp.
+  os << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n"
+     << "<assembly xmlns='urn:schemas-microsoft-com:asm.v1' "
+        "manifestVersion='1.0'>\n";
   if (config->manifestUAC) {
-    os << "  <trustInfo>\n"
+    os << "  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n"
        << "    <security>\n"
        << "      <requestedPrivileges>\n"
        << "         <requestedExecutionLevel level=" << config->manifestLevel
Index: lld/COFF/Config.h
===================================================================
--- lld/COFF/Config.h
+++ lld/COFF/Config.h
@@ -248,9 +248,11 @@
   uint32_t minorImageVersion = 0;
   // If changing the default os/subsys version here, update the default in
   // the MinGW driver accordingly.
-  uint32_t majorOSVersion = 6;
+  // Chang the value to 4 to support win-xp
+  uint32_t majorOSVersion = 4;
   uint32_t minorOSVersion = 0;
-  uint32_t majorSubsystemVersion = 6;
+  // Chang the value to 4 to support win-xp
+  uint32_t majorSubsystemVersion = 4;
   uint32_t minorSubsystemVersion = 0;
   uint32_t timestamp = 0;
   uint32_t functionPadMin = 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116335.396407.patch
Type: text/x-patch
Size: 1669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211228/184591fa/attachment.bin>


More information about the llvm-commits mailing list