From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1814) id BB3B93858407; Tue, 28 Mar 2023 08:04:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB3B93858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679990683; bh=wKjgpAZhUnHoy7mnA/aWGIqsBsrj2BPcnJph6roIUqI=; h=From:To:Subject:Date:From; b=pzW7Pnc6gwHXXZBd9ay4OlqI3lM+koDuM1rm9yjF2NsylSxyqdiXhZ2IIjf3uyBPB j55oPANbUsH7RJPy+s3SLCTcUijfapHQpy/ZTa+SRAHJHzCjsXW5yDRZr9ru+4HCDO Pa9TOR+AsFia008AsYfBbpos5B18yYrVSRlrCIkY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Yong To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6890] Extend UTF-8 support to the 32-bit mingw host. X-Act-Checkin: gcc X-Git-Author: Costas Argyris X-Git-Refname: refs/heads/master X-Git-Oldrev: b462947dae9f8c0dd7c11165ccfdf6acd6f12a1c X-Git-Newrev: 304c7d44a2212e6fd618587331cea2c266dc10bf Message-Id: <20230328080443.BB3B93858407@sourceware.org> Date: Tue, 28 Mar 2023 08:04:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:304c7d44a2212e6fd618587331cea2c266dc10bf commit r13-6890-g304c7d44a2212e6fd618587331cea2c266dc10bf Author: Costas Argyris Date: Sun Mar 26 11:32:13 2023 +0100 Extend UTF-8 support to the 32-bit mingw host. Prevent any name mangling in HOST_EXTRA_OBJS_SYMBOL such that the linker always finds it by that name. Also add the .manifest file as an explicit dependency in the make rule such that the object gets re-built if it changes. gcc/ChangeLog: * config.host: Pull in i386/x-mingw32-utf8 Makefile fragment and reference utf8rc-mingw32.o explicitly for mingw hosts. * config/i386/sym-mingw32.cc: prevent name mangling of stub symbol. * config/i386/x-mingw32-utf8: Make utf8rc-mingw32.o depend on manifest file explicitly. Signed-off-by: Jonathan Yong <10walls@gmail.com> Diff: --- gcc/config.host | 5 +++-- gcc/config/i386/sym-mingw32.cc | 4 +++- gcc/config/i386/x-mingw32-utf8 | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/config.host b/gcc/config.host index 4abb32ad73d..5df85752ed4 100644 --- a/gcc/config.host +++ b/gcc/config.host @@ -232,10 +232,11 @@ case ${host} in ;; i[34567]86-*-mingw32*) host_xm_file=i386/xm-mingw32.h - host_xmake_file="${host_xmake_file} i386/x-mingw32" + 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_gcc_objs="${host_extra_gcc_objs} driver-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*) diff --git a/gcc/config/i386/sym-mingw32.cc b/gcc/config/i386/sym-mingw32.cc index f369698abc4..2f8dee6c1ec 100644 --- a/gcc/config/i386/sym-mingw32.cc +++ b/gcc/config/i386/sym-mingw32.cc @@ -1 +1,3 @@ -char HOST_EXTRA_OBJS_SYMBOL; +/* Prevent any name mangling to make sure that the linker + will always find the symbol. */ +char HOST_EXTRA_OBJS_SYMBOL asm ("HOST_EXTRA_OBJS_SYMBOL"); diff --git a/gcc/config/i386/x-mingw32-utf8 b/gcc/config/i386/x-mingw32-utf8 index 9de963d7965..cf5c3db3d8b 100644 --- a/gcc/config/i386/x-mingw32-utf8 +++ b/gcc/config/i386/x-mingw32-utf8 @@ -27,7 +27,8 @@ # The resulting .o file gets added to host_extra_gcc_objs in # config.host for x86_64-*-mingw* host and gets linked into # the driver as a .o file, so it's lack of symbols is OK. -utf8rc-mingw32.o : $(srcdir)/config/i386/utf8-mingw32.rc +utf8rc-mingw32.o : $(srcdir)/config/i386/utf8-mingw32.rc \ + $(srcdir)/config/i386/winnt-utf8.manifest $(WINDRES) $< $@ # Create an object file that just exports the global symbol