https://gcc.gnu.org/g:ab4d353cc60a6db8aec5f7a183fe5b85ee79b08f
commit r17-5902-gab4d353cc60a6db8aec5f7a183fe5b85ee79b08f Author: Zhongteng Gui <[email protected]> Date: Thu Oct 22 02:35:24 2026 +0800 mingw: Honor --with-local-dir and --with-native-system-header-dir [PR126608] Previously, NATIVE_SYSTEM_HEADER_DIR is forced set to /mingw/include for mingw targets, even if --with-native-system-header-dir is passed to configure. Honor configure option, while retaining the default /mingw/include (used by Cygwin-cross-MinGW compiler). Similarily, remove the MinGW host make fragment's forced local_includedir override so that --with-local-prefix is honored. gcc/ChangeLog: PR target/126608 * config/i386/x-mingw32: Don't override local_includedir. * config/mingw/mingw32.h (NATIVE_SYSTEM_HEADER_DIR): Don't force override to /mingw/include. Signed-off-by: Zhongteng Gui <[email protected]> Signed-off-by: Jonathan Yong <[email protected]> Diff: --- gcc/config/i386/x-mingw32 | 4 ---- gcc/config/mingw/mingw32.h | 5 ----- 2 files changed, 9 deletions(-) diff --git a/gcc/config/i386/x-mingw32 b/gcc/config/i386/x-mingw32 index e5062047bcf9..517cd3324f4a 100644 --- a/gcc/config/i386/x-mingw32 +++ b/gcc/config/i386/x-mingw32 @@ -16,10 +16,6 @@ # along with GCC; see the file COPYING3. If not see # <http://www.gnu.org/licenses/>. # -# -# Make local_includedir relative to EXEC_PREFIX -# -local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include # Add Windows socket library. LIBS += -lws2_32 diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.h index 1d319b77bf83..4b2a6753defb 100644 --- a/gcc/config/mingw/mingw32.h +++ b/gcc/config/mingw/mingw32.h @@ -238,11 +238,6 @@ along with GCC; see the file COPYING3. If not see #define STANDARD_STARTFILE_PREFIX_2 "" #endif -/* For native mingw-version we need to take care that NATIVE_SYSTEM_HEADER_DIR - macro contains POSIX-style path. See bug 52947. */ -#undef NATIVE_SYSTEM_HEADER_DIR -#define NATIVE_SYSTEM_HEADER_DIR "/mingw/include" - /* Output STRING, a string representing a filename, to FILE. We canonicalize it to be in Unix format (backslashes are replaced forward slashes. */
