[Ping^3][PATCH] mingw: Remove outdated /mingw stuff
LIU Hao
lh_mouse@126.com
Thu Oct 8 06:51:21 GMT 2026
在 2026-10-8 14:25, Zhongteng Gui 写道:
> As I've said in the original commit message, I did lots of searches before, and I think this is
> inherited from the very-old MSYS 1 together with MinGW (no -w64). Also, I doubt it can't even build
> some older GCC versions, not to say latest GCC 16/17. (The last proved version was GCC 6, see [1]).
>
> Most modern distributions (that can build GCC 16) as I've listed in the commit message usually use `sed`
> to replace `/mingw` with either `/usr` or their own prefixes. This is very hacky, and I think (and it'v proved
> to work in MSYS2 and conda-forge) that it's better to use --sysroot with no special prefixes.
For Cygwin the headers and libraries for Cygwin-to-native cross-compilers are located in
(https://cygwin.com/pipermail/cygwin-apps/2012-March/029797.html)
* /usr/i686-w64-mingw32/sys-root/mingw/{include,lib} (CRT)
* /usr/i686-w64-mingw32/sys-root/w32api/{include,lib} (Platform)
* /usr/x86_64-w64-mingw32/sys-root/mingw/{include,lib} (CRT)
* /usr/x86_64-w64-mingw32/sys-root/w32api/{include,lib} (Platform)
> From 92e86faf25ae7f5a95c1572fc93b2a2bc62a7670 Mon Sep 17 00:00:00 2001
> From: Zhongteng Gui <dragon-archer@outlook.com>
> 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 <dragon-archer@outlook.com>
> ---
> 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.
This checks `$target` so may affect Cygwin as well.
--
Best regards,
LIU Hao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20261008/2ddcca04/attachment.sig>
More information about the Gcc-patches
mailing list