https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115302

            Bug ID: 115302
           Summary: aarch64-w64-mingw32: wrong value into
                    BUILD_SYSTEM_HEADER_DIR
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: carlo.bramix at libero dot it
  Target Milestone: ---

I downloaded the latest sources of GCC from the repository and I tried to
compile them for making the (experimental) aarch64-w64-mingw32 target.
Besides the target, the only important options for this issue are:
 --with-sysroot=/usr/aarch64-w64-mingw32/sys-root
 --enable-languages=c
on the command line.
Everything was fine until it stopped with this error:

The directory (BUILD_SYSTEM_HEADER_DIR) that should contain system headers does
not exist:
  /usr/aarch64-w64-mingw32/sys-root/usr/include
make[2]: *** [Makefile:3446: stmp-fixinc] Error 1

But this is wrong because it must use:
 /usr/aarch64-w64-mingw32/sys-root/mingw/include
and not:
 /usr/aarch64-w64-mingw32/sys-root/usr/include
so this is the reason because it cannot find the headers.
At first sight, it seems the current code is using the default path for the
native system headers.
Actually, existing x86 and x86_64 targets have configured
native_system_header_dir to /mingw/include as you can see here into config.gcc
from the mirror at GITHUB:

https://github.com/gcc-mirror/gcc/blob/f46eaad445e680034df51bd0dec4e6c7b1f372a4/gcc/config.gcc#L2274

but the same line doesn't exist into the section for the aarch64-*-mingw* as
you can read here:

https://github.com/gcc-mirror/gcc/blob/f46eaad445e680034df51bd0dec4e6c7b1f372a4/gcc/config.gcc#L1272

So, in my opinion, simply adding this line:

native_system_header_dir=/mingw/include

into the above section should be enough for solving immediately this issue.
I don't know if this fix needs other changes to be made also into binutils, but
probably not.
Thank you very much for your support.
  • [Bug c/115302] New: aarch6... carlo.bramix at libero dot it via Gcc-bugs

Reply via email to