diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-04-13 22:28:55 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-04-17 12:50:25 +0200 |
commit | bda519596543e49f77914b5677693e86be5d01d0 (patch) | |
tree | 70d41323c49a2dbddef9b55e57fb8784fba78922 /gcc/doc | |
parent | d81bc495a426b0020e44a9764fd904462a39983b (diff) | |
download | gcc-bda519596543e49f77914b5677693e86be5d01d0.zip gcc-bda519596543e49f77914b5677693e86be5d01d0.tar.gz gcc-bda519596543e49f77914b5677693e86be5d01d0.tar.bz2 |
d: Add TARGET_D_TEMPLATES_ALWAYS_COMDAT
Following up on the fix for PR99914, when testing on MinGW, it was found
not to support weak in the same way as on ELF or Mach-O targets.
So the linkage has been reverted back to COMDAT for that target, however
in order to properly support overriding functions and variables, all
declarations with external linkage must be put on COMDAT. For this a
new target hook has been added to control the behavior.
gcc/ChangeLog:
PR d/99914
* config/i386/winnt-d.c (TARGET_D_TEMPLATES_ALWAYS_COMDAT): Define.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in (D language and ABI): Add @hook for
TARGET_D_TEMPLATES_ALWAYS_COMDAT.
gcc/d/ChangeLog:
PR d/99914
* d-target.def (d_templates_always_comdat): New hook.
* d-tree.h (mark_needed): Remove prototype.
* decl.cc: Include d-target.h.
(mark_needed): Rename to...
(d_mark_needed): ...this. Make static.
(set_linkage_for_decl): Put variables in comdat if
d_templates_always_comdat.
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/tm.texi | 6 | ||||
-rw-r--r-- | gcc/doc/tm.texi.in | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 97c8eeb..823f85b 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -10850,6 +10850,12 @@ and @var{link_windows} to @code{1} to apply @code{stdcall} to functions with @code{extern(Windows)} linkage. @end deftypefn +@deftypevr {D Target Hook} bool TARGET_D_TEMPLATES_ALWAYS_COMDAT +This flag is true if instantiated functions and variables are always COMDAT +if they have external linkage. If this flag is false, then instantiated +decls will be emitted as weak symbols. The default is @code{false}. +@end deftypevr + @node Named Address Spaces @section Adding support for named address spaces @cindex named address spaces diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index e2d49ee..2321a5f 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -7369,6 +7369,8 @@ floating-point support; they are not included in this mechanism. @hook TARGET_D_HAS_STDCALL_CONVENTION +@hook TARGET_D_TEMPLATES_ALWAYS_COMDAT + @node Named Address Spaces @section Adding support for named address spaces @cindex named address spaces |