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; 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 << "\n" - << "\n"; + // Use microsoft xml to support win-xp. + os << "\n" + << "\n"; if (config->manifestUAC) { - os << " \n" + os << " \n" << " \n" << " \n" << "