diff --git a/cross/gcc-aarch64/406-dlang-fix-interface-visibility.patch b/cross/gcc-aarch64/406-dlang-fix-interface-visibility.patch new file mode 100644 index 000000000..b4d690e01 --- /dev/null +++ b/cross/gcc-aarch64/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/cross/gcc-aarch64/APKBUILD b/cross/gcc-aarch64/APKBUILD index 8dfc70afa..d7554db56 100644 --- a/cross/gcc-aarch64/APKBUILD +++ b/cross/gcc-aarch64/APKBUILD @@ -30,7 +30,7 @@ pkgver=9.3.0 [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="gcc-aarch64" -pkgrel=1 +pkgrel=2 pkgdesc="Stage2 cross-compiler for aarch64" url="https://gcc.gnu.org" arch="x86_64" @@ -214,6 +214,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 @@ -438,6 +439,10 @@ done exec gcc $_flavor ${1+"$@"} EOF chmod 755 "$pkgdir"/usr/bin/c?9 + + # install lto plugin so regular binutils may use it + mkdir -p "$pkgdir"/usr/lib/bfd-plugins + ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/" fi } @@ -660,4 +665,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" diff --git a/cross/gcc-armhf/406-dlang-fix-interface-visibility.patch b/cross/gcc-armhf/406-dlang-fix-interface-visibility.patch new file mode 100644 index 000000000..b4d690e01 --- /dev/null +++ b/cross/gcc-armhf/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/cross/gcc-armhf/APKBUILD b/cross/gcc-armhf/APKBUILD index 46f43b338..c93cfbc15 100644 --- a/cross/gcc-armhf/APKBUILD +++ b/cross/gcc-armhf/APKBUILD @@ -30,7 +30,7 @@ pkgver=9.3.0 [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="gcc-armhf" -pkgrel=1 +pkgrel=2 pkgdesc="Stage2 cross-compiler for armhf" url="https://gcc.gnu.org" arch="x86_64" @@ -214,6 +214,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 @@ -438,6 +439,10 @@ done exec gcc $_flavor ${1+"$@"} EOF chmod 755 "$pkgdir"/usr/bin/c?9 + + # install lto plugin so regular binutils may use it + mkdir -p "$pkgdir"/usr/lib/bfd-plugins + ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/" fi } @@ -660,4 +665,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" diff --git a/cross/gcc-armv7/406-dlang-fix-interface-visibility.patch b/cross/gcc-armv7/406-dlang-fix-interface-visibility.patch new file mode 100644 index 000000000..b4d690e01 --- /dev/null +++ b/cross/gcc-armv7/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/cross/gcc-armv7/APKBUILD b/cross/gcc-armv7/APKBUILD index 9e4b5abf4..15caae5e2 100644 --- a/cross/gcc-armv7/APKBUILD +++ b/cross/gcc-armv7/APKBUILD @@ -30,7 +30,7 @@ pkgver=9.3.0 [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="gcc-armv7" -pkgrel=1 +pkgrel=2 pkgdesc="Stage2 cross-compiler for armv7" url="https://gcc.gnu.org" arch="x86_64" @@ -214,6 +214,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 @@ -438,6 +439,10 @@ done exec gcc $_flavor ${1+"$@"} EOF chmod 755 "$pkgdir"/usr/bin/c?9 + + # install lto plugin so regular binutils may use it + mkdir -p "$pkgdir"/usr/lib/bfd-plugins + ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/" fi } @@ -660,4 +665,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"