Gentle ping.
On 2026/10/22 13:35, Zhongteng Gui wrote:
> On 2026/10/13 01:35, Jonathan Yong wrote:
>> On 10/8/26 06:25, Zhongteng Gui wrote:
>>>
>>> From 92e86faf25ae7f5a95c1572fc93b2a2bc62a7670 Mon Sep 17 00:00:00 2001
>>> From: Zhongteng Gui <[email protected]>
>>> Date: Thu, 8 Oct 2026 13:56:45 +0800
>>> Subject: [PATCH v2] mingw: Remove outdated /mingw stuff from
>>> FLAGS_FOR_TARGET
>>> [PR126608]
>>>
>>> /mingw is only used by MSYS 1, which has been obsolete for a long time.
>>> The current users of target *-w64-mingw32 either uses their own prefix
>>> (MSYS2 and its derivatives, w64devkit, etc.), or use the default prefix
>>> /usr (Cross-compiling on linux, e.g. Conda-forge).
>>>
>>> More cleanups of /mingw may be done in future patches.
>>>
>>> ChangeLog:
>>>
>>> PR target/126608
>>> * configure.ac (x86_64-*mingw* | *-w64-mingw*): Do not use
>>> /mingw symlink.
>>>
>>> Signed-off-by: Zhongteng Gui <[email protected]>
>>> ---
>>> configure.ac | 4 +---
>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index c5de225b0ac..c81755ebbb6 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -3948,9 +3948,7 @@ esac
>>> case "$target" in
>>> x86_64-*mingw* | *-w64-mingw*)
>>> - # MinGW-w64 does not use newlib, nor does it use winsup. It may,
>>> - # however, use a symlink named 'mingw' in ${prefix} .
>>> - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib
>>> -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem
>>> ${prefix}/mingw/include'
>>> + # MinGW-w64 does not use newlib, nor does it use winsup. No special
>>> flags needed.
>>> ;;
>>> *-mingw*)
>>> # MinGW can't be handled as Cygwin above since it does not use newlib.
>>
>> Pushed to master to get rid of the old cygnus tree assumptions.
>
>
> I've cleaned up the other parts of the original patch, and split the safe
> parts below. Tested at
> https://github.com/dragon-archer/gcc-for-windows/pull/11
>
> The rest part is changes to STANDARD_STARTFILE_PREFIX_{1,2}. Unfortunately,
> there isn't a simple safe way to implement this, as currently there's no
> configure options like --with-standard-startfile-prefix. I'm wondering is it
> possible to add such option?
>
> ---
>
> From 9a260b5685028e27c25f72d4eeae1124cd511f97 Mon Sep 17 00:00:00 2001
> From: Zhongteng Gui <[email protected]>
> Date: Thu, 22 Oct 2026 02:35:24 +0800
> Subject: [PATCH] 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]>
> ---
> 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 3ac2ba57631..5a0d8b8ec4a 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 1d319b77bf8..4b2a6753def 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. */