diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2020-05-18 11:08:53 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2020-05-18 10:41:39 +0000 |
commit | 1069d8331c7125eb84994d624d45579a660acc41 (patch) | |
tree | 802777d86cec64de5581b21af1a0aa41c193ab95 | |
parent | 896542734451cdff015d09d3f85c00ae1fe78566 (diff) |
main/gcc: fix visibility of interfaces in GDC
This fixes compilation of packages like glibd with GDC
-rw-r--r-- | main/gcc/406-dlang-fix-interface-visibility.patch | 22 | ||||
-rw-r--r-- | main/gcc/APKBUILD | 6 |
2 files changed, 26 insertions, 2 deletions
diff --git a/main/gcc/406-dlang-fix-interface-visibility.patch b/main/gcc/406-dlang-fix-interface-visibility.patch new file mode 100644 index 00000000000..b4d690e0153 --- /dev/null +++ b/main/gcc/406-dlang-fix-interface-visibility.patch @@ -0,0 +1,22 @@ +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. */ diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD index de29b47d80b..fe52d00a805 100644 --- a/main/gcc/APKBUILD +++ b/main/gcc/APKBUILD @@ -6,7 +6,7 @@ pkgver=9.3.0 [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="$pkgname$_target" -pkgrel=1 +pkgrel=2 pkgdesc="The GNU Compiler Collection" url="https://gcc.gnu.org" arch="all" @@ -191,6 +191,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg 403-dlang-ibmz.patch 404-dlang-zlib.patch 405-dlang-mips.patch + 406-dlang-fix-interface-visibility.patch " # gcc-4.8-build-args.patch @@ -644,4 +645,5 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45 9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch -3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch" +3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch +c226bb5c60ae5071549e5ec3ab44dc87b244615ba520973b1d4c50a2b6d3fd941c4e5e8e1f85cad28093ee8627d20415114524b593ad3a9b24998328d3f3ea72 406-dlang-fix-interface-visibility.patch" |