aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorEvgeny Karpov <Evgeny.Karpov@microsoft.com>2024-06-24 12:38:40 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2024-06-25 06:38:38 +0000
commit63512c72df09b43d56ac7680cdfd57a66d40c636 (patch)
tree26d7e4e7f8fff1c432f168b84c525344d112890d /gcc/config.gcc
parent104d06c028c6304edcde736bdc5fffd6aaed94e6 (diff)
downloadgcc-63512c72df09b43d56ac7680cdfd57a66d40c636.zip
gcc-63512c72df09b43d56ac7680cdfd57a66d40c636.tar.gz
gcc-63512c72df09b43d56ac7680cdfd57a66d40c636.tar.bz2
Extract ix86 dllimport implementation to mingw
This patch extracts the ix86 implementation for expanding a SYMBOL into its corresponding dllimport, far-address, or refptr symbol. It will be reused in the aarch64-w64-mingw32 target. The implementation is copied as is from i386/i386.cc with minor changes to follow to the code style. Also this patch replaces the original DLL import/export implementation in ix86 with mingw. 2024-06-08 Evgeny Karpov <Evgeny.Karpov@microsoft.com> gcc/ChangeLog: * config.gcc: Add winnt-dll.o, which contains the DLL import/export implementation. * config/i386/cygming.h (SUB_TARGET_RECORD_STUB): Remove the old implementation. Rename the required function to MinGW. Use MinGW implementation for COFF and nothing otherwise. (GOT_ALIAS_SET): Likewise. * config/i386/i386-expand.cc (ix86_expand_move): Likewise. * config/i386/i386-expand.h (ix86_GOT_alias_set): Likewise. (legitimize_pe_coff_symbol): Likewise. * config/i386/i386-protos.h (i386_pe_record_stub): Likewise. * config/i386/i386.cc (is_imported_p): Likewise. (legitimate_pic_address_disp_p): Likewise. (ix86_GOT_alias_set): Likewise. (legitimize_pic_address): Likewise. (legitimize_tls_address): Likewise. (struct dllimport_hasher): Likewise. (GTY): Likewise. (get_dllimport_decl): Likewise. (legitimize_pe_coff_extern_decl): Likewise. (legitimize_dllimport_symbol): Likewise. (legitimize_pe_coff_symbol): Likewise. (ix86_legitimize_address): Likewise. * config/i386/i386.h (GOT_ALIAS_SET): Likewise. * config/mingw/winnt.cc (i386_pe_record_stub): Likewise. (mingw_pe_record_stub): Likewise. * config/mingw/winnt.h (mingw_pe_record_stub): Likewise. * config/mingw/t-cygming: Add the winnt-dll.o compilation. * config/mingw/winnt-dll.cc: New file. * config/mingw/winnt-dll.h: New file.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5e7e6f7..70757c9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2177,11 +2177,13 @@ i[4567]86-wrs-vxworks*|x86_64-wrs-vxworks7*)
i[34567]86-*-cygwin*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/cygming.h i386/cygwin.h i386/cygwin-stdint.h"
tm_file="${tm_file} mingw/winnt.h"
+ tm_file="${tm_file} mingw/winnt-dll.h"
xm_file=i386/xm-cygwin.h
tmake_file="${tmake_file} mingw/t-cygming t-slibgcc"
target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt.cc"
+ target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt-dll.cc"
extra_options="${extra_options} mingw/cygming.opt i386/cygwin.opt"
- extra_objs="${extra_objs} winnt.o winnt-stubs.o"
+ extra_objs="${extra_objs} winnt.o winnt-stubs.o winnt-dll.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
d_target_objs="${d_target_objs} cygwin-d.o"
@@ -2196,11 +2198,13 @@ x86_64-*-cygwin*)
need_64bit_isa=yes
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/cygming.h i386/cygwin.h i386/cygwin-w64.h i386/cygwin-stdint.h"
tm_file="${tm_file} mingw/winnt.h"
+ tm_file="${tm_file} mingw/winnt-dll.h"
xm_file=i386/xm-cygwin.h
tmake_file="${tmake_file} mingw/t-cygming t-slibgcc"
target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt.cc"
+ target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt-dll.cc"
extra_options="${extra_options} mingw/cygming.opt i386/cygwin.opt"
- extra_objs="${extra_objs} winnt.o winnt-stubs.o"
+ extra_objs="${extra_objs} winnt.o winnt-stubs.o winnt-dll.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
d_target_objs="${d_target_objs} cygwin-d.o"
@@ -2266,6 +2270,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
esac
tm_file="${tm_file} mingw/mingw-stdint.h"
tm_file="${tm_file} mingw/winnt.h"
+ tm_file="${tm_file} mingw/winnt-dll.h"
tmake_file="${tmake_file} t-winnt mingw/t-cygming t-slibgcc"
case ${target} in
x86_64-w64-*)
@@ -2277,6 +2282,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
esac
native_system_header_dir=/mingw/include
target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt.cc"
+ target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt-dll.cc"
extra_options="${extra_options} mingw/cygming.opt mingw/mingw.opt"
case ${target} in
*-w64-*)
@@ -2285,7 +2291,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
*)
;;
esac
- extra_objs="${extra_objs} winnt.o winnt-stubs.o"
+ extra_objs="${extra_objs} winnt.o winnt-stubs.o winnt-dll.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
gas=yes