public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]
@ 2023-11-21 18:07 Costas Argyris
  2023-11-22  1:17 ` Jonathan Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Costas Argyris @ 2023-11-21 18:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jonathan Yong


[-- Attachment #1.1: Type: text/plain, Size: 298 bytes --]

This patch makes the inclusion of the utf8 manifest on the
mingw hosts optional by introducing the configure option
--disable-win32-utf8-manifest (has no effect on non-mingw
hosts).

Bootstrapped OK on i686-w64-mingw32 and x86_64-w64-mingw32
with and without --disable-win32-utf8-manifest.

Costas

[-- Attachment #2: Exclude-win32-utf8-manifest.patch --]
[-- Type: application/octet-stream, Size: 2409 bytes --]

From f40dc8f71e08798039f7285f38f328485972bd60 Mon Sep 17 00:00:00 2001
From: Costas Argyris <costas.argyris@gmail.com>
Date: Mon, 20 Nov 2023 17:58:16 +0000
Subject: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]

Make the utf8 manifest optional (on by default and
explicitly off with --disable-win32-utf8-manifest)
in the mingw hosts.

Also eliminate duplication between the 32-bit and
64-bit mingw hosts by putting them both in the
same branch and special-case only the 64-bit long
long setting.

PR mingw/111170
PR mingw/108865

Signed-off-by: Costas Argyris <costas.argyris@gmail.com>
---
 gcc/config.host | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/gcc/config.host b/gcc/config.host
index 5df85752ed4..ce4aeb0e7b1 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -230,24 +230,23 @@ case ${host} in
     host_exeext=.exe
     host_lto_plugin_soname=cyglto_plugin.dll
     ;;
-  i[34567]86-*-mingw32*)
+  i[34567]86-*-mingw32* | x86_64-*-mingw*)
     host_xm_file=i386/xm-mingw32.h
-    host_xmake_file="${host_xmake_file} i386/x-mingw32 i386/x-mingw32-utf8"
+    host_xmake_file="${host_xmake_file} i386/x-mingw32"
+    host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o"
     host_exeext=.exe
     out_host_hook_obj=host-mingw32.o
-    host_extra_objs="${host_extra_objs} utf8-mingw32.o"
-    host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o utf8rc-mingw32.o"
-    host_lto_plugin_soname=liblto_plugin.dll
-    ;;
-  x86_64-*-mingw*)
-    use_long_long_for_widest_fast_int=yes
-    host_xm_file=i386/xm-mingw32.h
-    host_xmake_file="${host_xmake_file} i386/x-mingw32 i386/x-mingw32-utf8"
-    host_exeext=.exe
-    out_host_hook_obj=host-mingw32.o
-    host_extra_objs="${host_extra_objs} utf8-mingw32.o"
-    host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o utf8rc-mingw32.o"
     host_lto_plugin_soname=liblto_plugin.dll
+    case ${host} in
+      x86_64-*-*)
+        use_long_long_for_widest_fast_int=yes
+        ;;
+    esac
+    if test x$enable_win32_utf8_manifest != xno; then
+      host_xmake_file="${host_xmake_file} i386/x-mingw32-utf8"
+      host_extra_gcc_objs="${host_extra_gcc_objs} utf8rc-mingw32.o"
+      host_extra_objs="${host_extra_objs} utf8-mingw32.o"
+    fi
     ;;
   aarch64*-*-darwin*)
     out_host_hook_obj="${out_host_hook_obj} host-aarch64-darwin.o"
-- 
2.42.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]
  2023-11-21 18:07 [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865] Costas Argyris
@ 2023-11-22  1:17 ` Jonathan Yong
  2023-11-22 12:34   ` Costas Argyris
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Yong @ 2023-11-22  1:17 UTC (permalink / raw)
  To: Costas Argyris, gcc-patches

On 11/21/23 18:07, Costas Argyris wrote:
> This patch makes the inclusion of the utf8 manifest on the
> mingw hosts optional by introducing the configure option
> --disable-win32-utf8-manifest (has no effect on non-mingw
> hosts).
> 
> Bootstrapped OK on i686-w64-mingw32 and x86_64-w64-mingw32
> with and without --disable-win32-utf8-manifest.
> 
> Costas
> 

I would prefer a AC_ARG_ENABLE to document the option in configure.ac, 
so it would show with configure --help. It should set new variables to 
i386/x-mingw32-utf8, utf8rc-mingw32.o and utf8-mingw32.o respectively 
unless disabled, like so:

host_xmake_mingw=i386/x-mingw32-utf8
host_extra_gcc_objs_mingw=utf8rc-mingw32.o
host_extra_objs=utf8-mingw32.o

And then entries in config.host would be:

>   i[34567]86-*-mingw32* | x86_64-*-mingw*)
>     host_xm_file=i386/xm-mingw32.h
>     host_xmake_file="${host_xmake_file} ${host_xmake_mingw} i386/x-mingw32"
>     host_extra_gcc_objs="${host_extra_gcc_objs} ${host_extra_gcc_objs_mingw} driver-mingw32. >     host_extra_objs="${host_extra_objs} ${host_extra_objs_mingw}"


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]
  2023-11-22  1:17 ` Jonathan Yong
@ 2023-11-22 12:34   ` Costas Argyris
  2023-11-23  0:49     ` Jonathan Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Costas Argyris @ 2023-11-22 12:34 UTC (permalink / raw)
  To: Jonathan Yong, gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 1530 bytes --]

Attached a new patch.

A couple things to note:

1) I changed your

host_extra_objs=utf8-mingw32.o

to

host_extra_objs_mingw=utf8-mingw32.o

to match the other two, since I believe that's what you meant.

2) This approach has the complication that the variables
in configure.ac need to be set before it sources config.host.

On Wed, 22 Nov 2023 at 01:17, Jonathan Yong <10walls@gmail.com> wrote:

> On 11/21/23 18:07, Costas Argyris wrote:
> > This patch makes the inclusion of the utf8 manifest on the
> > mingw hosts optional by introducing the configure option
> > --disable-win32-utf8-manifest (has no effect on non-mingw
> > hosts).
> >
> > Bootstrapped OK on i686-w64-mingw32 and x86_64-w64-mingw32
> > with and without --disable-win32-utf8-manifest.
> >
> > Costas
> >
>
> I would prefer a AC_ARG_ENABLE to document the option in configure.ac,
> so it would show with configure --help. It should set new variables to
> i386/x-mingw32-utf8, utf8rc-mingw32.o and utf8-mingw32.o respectively
> unless disabled, like so:
>
> host_xmake_mingw=i386/x-mingw32-utf8
> host_extra_gcc_objs_mingw=utf8rc-mingw32.o
> host_extra_objs=utf8-mingw32.o
>
> And then entries in config.host would be:
>
> >   i[34567]86-*-mingw32* | x86_64-*-mingw*)
> >     host_xm_file=i386/xm-mingw32.h
> >     host_xmake_file="${host_xmake_file} ${host_xmake_mingw}
> i386/x-mingw32"
> >     host_extra_gcc_objs="${host_extra_gcc_objs}
> ${host_extra_gcc_objs_mingw} driver-mingw32. >
>  host_extra_objs="${host_extra_objs} ${host_extra_objs_mingw}"
>
>

[-- Attachment #2: Exclude-win32-utf8-manifest.patch --]
[-- Type: application/octet-stream, Size: 3544 bytes --]

From 70af6f8ba00152c76ef1949c5b0a776d0bba302c Mon Sep 17 00:00:00 2001
From: Costas Argyris <costas.argyris@gmail.com>
Date: Mon, 20 Nov 2023 17:58:16 +0000
Subject: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]

Make the utf8 manifest optional (on by default and
explicitly off with --disable-win32-utf8-manifest)
in the mingw hosts.

Also eliminate duplication between the 32-bit and
64-bit mingw hosts by putting them both in the
same branch and special-case only the 64-bit long
long setting.

PR mingw/111170
PR mingw/108865

Signed-off-by: Costas Argyris <costas.argyris@gmail.com>
---
 gcc/config.host  | 23 +++++++++--------------
 gcc/configure.ac | 17 +++++++++++++++++
 2 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/gcc/config.host b/gcc/config.host
index 5df85752ed4..21a988e6376 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -230,24 +230,19 @@ case ${host} in
     host_exeext=.exe
     host_lto_plugin_soname=cyglto_plugin.dll
     ;;
-  i[34567]86-*-mingw32*)
+  i[34567]86-*-mingw32* | x86_64-*-mingw*)
     host_xm_file=i386/xm-mingw32.h
-    host_xmake_file="${host_xmake_file} i386/x-mingw32 i386/x-mingw32-utf8"
+    host_xmake_file="${host_xmake_file} ${host_xmake_mingw} i386/x-mingw32"
+    host_extra_gcc_objs="${host_extra_gcc_objs} ${host_extra_gcc_objs_mingw} driver-mingw32.o"
+    host_extra_objs="${host_extra_objs} ${host_extra_objs_mingw}"
     host_exeext=.exe
     out_host_hook_obj=host-mingw32.o
-    host_extra_objs="${host_extra_objs} utf8-mingw32.o"
-    host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o utf8rc-mingw32.o"
-    host_lto_plugin_soname=liblto_plugin.dll
-    ;;
-  x86_64-*-mingw*)
-    use_long_long_for_widest_fast_int=yes
-    host_xm_file=i386/xm-mingw32.h
-    host_xmake_file="${host_xmake_file} i386/x-mingw32 i386/x-mingw32-utf8"
-    host_exeext=.exe
-    out_host_hook_obj=host-mingw32.o
-    host_extra_objs="${host_extra_objs} utf8-mingw32.o"
-    host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o utf8rc-mingw32.o"
     host_lto_plugin_soname=liblto_plugin.dll
+    case ${host} in
+      x86_64-*-*)
+        use_long_long_for_widest_fast_int=yes
+        ;;
+    esac
     ;;
   aarch64*-*-darwin*)
     out_host_hook_obj="${out_host_hook_obj} host-aarch64-darwin.o"
diff --git a/gcc/configure.ac b/gcc/configure.ac
index fcd45f54c7d..c0d067ec271 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1846,6 +1846,23 @@ if test $force_sjlj_exceptions = yes; then
     [Define 0/1 to force the choice for exception handling model.])
 fi
 
+# Windows32 UTF-8 manifest support for running the driver and compiler
+# executables with the UTF-8 active code page on mingw hosts.
+# Non-mingw hosts ignore this option.
+# The shell variables this sets are picked up from the mingw branches
+# of config.host so they have to be set before it gets sourced.
+AC_ARG_ENABLE(win32-utf8-manifest,
+[AS_HELP_STRING([--disable-win32-utf8-manifest],
+                [disable embedding a utf8 manifest on mingw hosts])
+AS_HELP_STRING([--enable-win32-utf8-manifest],
+               [enable embedding a utf8 manifest on mingw hosts (default)])],,)
+
+if test "x$enable_win32_utf8_manifest" != xno; then
+  host_xmake_mingw=i386/x-mingw32-utf8
+  host_extra_gcc_objs_mingw=utf8rc-mingw32.o
+  host_extra_objs_mingw=utf8-mingw32.o
+fi
+
 # --------------------------------------------------------
 # Build, host, and target specific configuration fragments
 # --------------------------------------------------------
-- 
2.42.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]
  2023-11-22 12:34   ` Costas Argyris
@ 2023-11-23  0:49     ` Jonathan Yong
  2023-11-29  9:36       ` Costas Argyris
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Yong @ 2023-11-23  0:49 UTC (permalink / raw)
  To: Costas Argyris, gcc-patches

On 11/22/23 12:34, Costas Argyris wrote:
> Attached a new patch.
> 
> A couple things to note:
> 
> 1) I changed your
> 
> host_extra_objs=utf8-mingw32.o
> 
> to
> 
> host_extra_objs_mingw=utf8-mingw32.o
> 
> to match the other two, since I believe that's what you meant.
> 
> 2) This approach has the complication that the variables
> in configure.ac need to be set before it sources config.host.
> 

I specifically asked for it to be done that way so users are aware of it 
with --help. Thanks, pushed to master.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]
  2023-11-23  0:49     ` Jonathan Yong
@ 2023-11-29  9:36       ` Costas Argyris
  2023-11-29 10:58         ` Jonathan Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Costas Argyris @ 2023-11-29  9:36 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: gcc-patches, ebotcazou

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Thanks.

Eric, who originally reported the issue with the Ada compiler dropping
a feature due to the utf8 manifest, is asking for this to be backported
onto the 13 branch here:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111170#c13

If you agree with this, is there anything you would like me to do
patch-wise?

Costas

On Thu, 23 Nov 2023 at 00:50, Jonathan Yong <10walls@gmail.com> wrote:

> On 11/22/23 12:34, Costas Argyris wrote:
> > Attached a new patch.
> >
> > A couple things to note:
> >
> > 1) I changed your
> >
> > host_extra_objs=utf8-mingw32.o
> >
> > to
> >
> > host_extra_objs_mingw=utf8-mingw32.o
> >
> > to match the other two, since I believe that's what you meant.
> >
> > 2) This approach has the complication that the variables
> > in configure.ac need to be set before it sources config.host.
> >
>
> I specifically asked for it to be done that way so users are aware of it
> with --help. Thanks, pushed to master.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865]
  2023-11-29  9:36       ` Costas Argyris
@ 2023-11-29 10:58         ` Jonathan Yong
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Yong @ 2023-11-29 10:58 UTC (permalink / raw)
  To: Costas Argyris; +Cc: gcc-patches, ebotcazou


[-- Attachment #1.1.1: Type: text/plain, Size: 527 bytes --]

On 11/29/23 09:36, Costas Argyris wrote:
> Thanks.
> 
> Eric, who originally reported the issue with the Ada compiler dropping
> a feature due to the utf8 manifest, is asking for this to be backported
> onto the 13 branch here:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111170#c13
> 
> If you agree with this, is there anything you would like me to do
> patch-wise?
> 
> Costas
> 

No, I have just cherry-picked it onto releases/gcc-13, it should be part 
of any newer gcc-13 releases from now on.



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 9939 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-29 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 18:07 [PATCH] mingw: Exclude utf8 manifest [PR111170, PR108865] Costas Argyris
2023-11-22  1:17 ` Jonathan Yong
2023-11-22 12:34   ` Costas Argyris
2023-11-23  0:49     ` Jonathan Yong
2023-11-29  9:36       ` Costas Argyris
2023-11-29 10:58         ` Jonathan Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).