<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16542</bug_id>
          
          <creation_ts>2026-12-01 17:08:47 +0000</creation_ts>
          <short_desc>Toolchain SDK built with mingw does not support long paths</short_desc>
          <delta_ts>2026-12-01 17:08:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Other YP Layers</product>
          <component>meta-mingw</component>
          <version>6.0.9</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Joshua Watt">JPEWhacker</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>107729</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2026-12-01 17:08:47 +0000</bug_when>
    <thetext>Installing a mingw built toolchain in a deep windows path can fail to function.  There is apparently some sort of value called &quot;LongPathsEnabled=1&quot; that can be set in the windows registry.

I do not currently have a Windows machine, so I&apos;m attempting to transcribe the report for a user of the SDK I build.

Reported issue:

The GCC cross-compilers are built against the legacy MSVCRT C runtime and do not carry a longPathAware application manifest. As a result cc1.exe / cc1plus.exe / ar.exe cannot open source, dependency, or object files when the absolute path exceeds the Windows MAX_PATH limit of 260 characters — even though LongPathsEnabled=1 is set in the registry. This breaks the CMake/Ninja-based embeddedsw BSP build for any moderately nested workspace.

Environment:

Windows 10/11 with HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 0x1 (verified)
CMake 4.0.1 — longPathAware, works
Upstream Ninja 1.12.1 — longPathAware, works

(note I don&apos;t think the cmake or ninja they are using is coming from the SDK.)

Steps to Reproduce:

Enable Windows long paths (LongPathsEnabled=1), reboot.
Create a source file test.c (int main(void){return 0;}) at a path 348 characters long.
Confirm the file exists (type &quot;\\?\&lt;longpath&gt;\test.c&quot; prints it).
Compile directly, no CMake/Ninja:
aarch64-none-elf-gcc.exe -c &quot;&lt;longpath&gt;\test.c&quot; -o &quot;&lt;longpath&gt;\test.o&quot;

Result:

cc1.exe: fatal error: C:\...\longpath_compile_test\test.c: No such file or directory
compilation terminated.

Root Cause:

The compiler back-end binaries (cc1.exe, cc1plus.exe) and binutils (ar.exe, ranlib.exe) are linked against MSVCRT, whose fopen()/open()/stat() truncate at MAX_PATH. Neither the LongPathsEnabled registry key nor an added longPathAware manifest fixes MSVCRT file I/O — the manifest only affects Win32 CreateProcess. This is GCC Bugzilla 
#107974 (still open) and MSYS2 issue #29471, where the fix was to rebuild against UCRT (MSYS2 UCRT64 works; MINGW64/MSVCRT does not).

References:

GCC Bugzilla 
#107974 — https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974
MSYS2 mingw-packages #29471 — https://github.com/msys2/mingw-packages/issues/29471
Ninja v1.12.0 long path support — https://github.com/ninja-build/ninja/releases/tag/v1.12.0</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>