Hello,

    In Win 10 and later, Windows removed MAX_PATH path length limitations
    but made it so that applications would have to opt-in by shipping a
    manifest with "longPathAware" set to true.

    gcc already ships with a manifest, sourced from
    gcc/config/i386/winnt-utf8.manifest when built for MinGW host. The
    manifest currently enables UTF-8 code page, but the XML namespaces
    don't line up with Microsoft's documentation (see
    
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#activeCodePage)
    and also 
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/702559.html.

    This patch fixes that and also adds longPathAware to the
    settings. Verified by inspecting the PEB on a Windows machine with the
    registry settings also configured to turn on long path support.

    Ok for master?

    gcc/ChangeLog:

            * config/i386/winnt-utf8.manifest: Fix namespaces and set
            longPathAware to true.

diff --git a/gcc/config/i386/winnt-utf8.manifest
b/gcc/config/i386/winnt-utf8.manifest
index dab929e1515..c0bdb362c7b 100644
--- a/gcc/config/i386/winnt-utf8.manifest
+++ b/gcc/config/i386/winnt-utf8.manifest
@@ -1,8 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
-  <application>
-    <windowsSettings>
-      <activeCodePage
xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings";>UTF-8</activeCodePage>
-    </windowsSettings>
-  </application>
-</assembly>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly manifestVersion="1.0"
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+  <asmv3:application>
+    <asmv3:windowsSettings>
+      <longPathAware
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings";>true</longPathAware>
+      <activeCodePage
xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings";>UTF-8</activeCodePage>
+    </asmv3:windowsSettings>
+  </asmv3:application>
+</assembly>

Reply via email to