PKGBUILDs/core/gcc/gdc_thunk_weak_ref.patch
2019-11-06 13:39:52 +00:00

14 lines
526 B
Diff

diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 49723649230..d31f6bef8d4 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1817,6 +1817,9 @@ make_thunk (FuncDeclaration *decl, int offset)
DECL_COMDAT (thunk) = DECL_COMDAT (function);
DECL_WEAK (thunk) = DECL_WEAK (function);
+ if (DECL_VISIBILITY (function) == 0)
+ DECL_WEAK (thunk) = 1;
+
tree target_name = DECL_ASSEMBLER_NAME (function);
unsigned identlen = IDENTIFIER_LENGTH (target_name) + 14;
const char *ident = XNEWVEC (const char, identlen);