]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mingw: Exclude utf8 manifest [PR111170, PR108865]
authorCostas Argyris <costas.argyris@gmail.com>
Mon, 20 Nov 2023 17:58:16 +0000 (17:58 +0000)
committerJonathan Yong <10walls@gmail.com>
Wed, 29 Nov 2023 10:55:41 +0000 (10:55 +0000)
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>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
gcc/Changelog:

* configure.ac: Handle new --enable-win32-utf8-manifest
option.
* config.host: allow win32 utf8 manifest to be disabled
by user.
* configure: Regenerate.

(cherry picked from commit 4f1ebd54380e16927cd0085be939165870354eac)

gcc/config.host
gcc/configure
gcc/configure.ac

index 5df85752ed42cf62f45f82862f2a921a5825f714..21a988e6376942a6ef0b372701ed2177356a35c8 100644 (file)
@@ -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"
index 0ab71aa3bcdce0c2852c45c12f5de4339e3c2efc..dec2eca1a45399b2c796647ee6eb02ad1a9e23c9 100755 (executable)
@@ -991,6 +991,7 @@ enable_rpath
 with_libiconv_prefix
 with_libiconv_type
 enable_sjlj_exceptions
+enable_win32_utf8_manifest
 with_gcc_major_version_only
 enable_secureplt
 enable_mingw_wildcard
@@ -1715,6 +1716,11 @@ Optional Features:
   --disable-rpath         do not hardcode runtime library paths
   --enable-sjlj-exceptions
                           arrange to use setjmp/longjmp exception handling
+  --disable-win32-utf8-manifest
+                          disable embedding a utf8 manifest on mingw hosts
+  --enable-win32-utf8-manifest
+                          enable embedding a utf8 manifest on mingw hosts
+                          (default)
   --enable-secureplt      enable -msecure-plt by default for PowerPC
   --enable-mingw-wildcard Set whether to expand wildcard on command-line.
                           Default to platform configuration
@@ -12811,6 +12817,23 @@ _ACEOF
 
 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.
+# Check whether --enable-win32-utf8-manifest was given.
+if test "${enable_win32_utf8_manifest+set}" = set; then :
+  enableval=$enable_win32_utf8_manifest;
+fi
+
+
+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
 # --------------------------------------------------------
@@ -19825,7 +19848,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19828 "configure"
+#line 19851 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19931,7 +19954,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19934 "configure"
+#line 19957 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index fcd45f54c7d9fdd15a76ab487e9df78755c51b92..c0d067ec2716f2fa8bcba1c526c00f059e4b594c 100644 (file)
@@ -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
 # --------------------------------------------------------