[llvm-bugs] [Bug 52227] New: majorOSVersion and majorSubsystemVersion are set into too large values

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 19 12:48:12 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52227

            Bug ID: 52227
           Summary: majorOSVersion and majorSubsystemVersion are set into
                    too large values
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: kolan_n at mail.ru
                CC: llvm-bugs at lists.llvm.org

Created attachment 25375
  --> https://bugs.llvm.org/attachment.cgi?id=25375&action=edit
Added support of Windows XP for the files generated by Clang and lld.

The too high values in these fields cause inability to run the programs
compiled with Clang (using MinGW-w64 free and open source runtime) on Windows
XP and ReactOS.

I have implemented the patch intended to fix that. This patch sets the version
to 4.0 - the one used in MinGW shared libs.

I haven't tested this patch myself, because compiling llvm is time- and
resource-consuming proccess, but I have implemented a stopgap tool in python
for patching PE headers, https://github.com/KOLANICH-tools/PEHeaderFixer.py ,
and used it to patch the binaries generated by LLD 14 + CLang 14. The resulting
binaries have worked fine on XP and ReactOS.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211019/1c61a891/attachment.html>


More information about the llvm-bugs mailing list