pmaports/cross/gcc-armv7/406-dlang-fix-interface-visibility.patch
Ruby Iris Juric 3d98f8ba79
cross/gcc-*: upgrade to 9.3.0-r2 (MR 1253)
Bring the GCC packages up to date with upstream.
Fixes libstdc++ unsatisfiable constrains related error messages.

Upstream commits:
- 1069d8331c
- e296f565db

[ci:skip-build]
2020-05-18 19:55:09 +03:00

22 lines
986 B
Diff

Upstream: Yes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92216 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95184
Reason: GDC produced errors about duplicate symbols when the same interface
was implemented by two classes in the same project.
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 3824060..7afb1aa 100644 (file)
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1803,8 +1803,11 @@ make_thunk (FuncDeclaration *decl, int offset)
DECL_CONTEXT (thunk) = d_decl_context (decl);
- /* Thunks inherit the public access of the function they are targetting. */
- TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
+ /* Thunks inherit the public access of the function they are targetting.
+ When the function is outside the current compilation unit however, then the
+ thunk must be kept private to not conflict. */
+ TREE_PUBLIC (thunk) = TREE_PUBLIC (function) && !DECL_EXTERNAL (function);
+
DECL_EXTERNAL (thunk) = 0;
/* Thunks are always addressable. */