From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 030E0394FC17; Sat, 17 Apr 2021 12:37:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 030E0394FC17 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/99914] d: Template symbols not overridable by normal symbols Date: Sat, 17 Apr 2021 12:37:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: d X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw at gdcproject dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 12:37:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99914 --- Comment #5 from CVS Commits --- The master branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:bda519596543e49f77914b5677693e86be5d01d0 commit r11-8234-gbda519596543e49f77914b5677693e86be5d01d0 Author: Iain Buclaw Date: Tue Apr 13 22:28:55 2021 +0200 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): Def= ine. * 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.=