core/gcc to 9.2.0-4

This commit is contained in:
Kevin Mihelich 2019-11-06 13:39:52 +00:00
parent 84f578a6d7
commit 4e420f8276
4 changed files with 70 additions and 6 deletions

View file

@ -1,5 +1,6 @@
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Daniel Kozak <kozzi11@gmail.com>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: libtool requires rebuilt with each new gcc version
@ -18,7 +19,7 @@ pkgname=(gcc gcc-libs gcc-fortran gcc-objc gcc-go gcc-d)
pkgver=9.2.0
_majorver=${pkgver:0:1}
_islver=0.21
pkgrel=3
pkgrel=4
pkgdesc='The GNU Compiler Collection'
arch=(x86_64)
license=(GPL LGPL FDL custom)
@ -30,8 +31,10 @@ options=(!emptydirs !distcc)
source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}
#source=(gcc::svn://gcc.gnu.org/svn/gcc/branches/gcc-${_majorver}-branch
http://isl.gforge.inria.fr/isl-${_islver}.tar.xz
phobos_path.patch
c89 c99
gdc_phobos_path.patch
gdc_artificial_decl.patch
gdc_thunk_weak_ref.patch
0001-ARMv5-disable-LDRD-STRD.patch)
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.org
86CFFCA918CF3AF47147588051E8B148A9999C34 # evangelos@foutrelis.com
@ -40,9 +43,11 @@ validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.
sha256sums=('ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206'
'SKIP'
'777058852a3db9500954361e294881214f6ecd4b594c00da5eee974cd6a54960'
'c86372c207d174c0918d4aedf1cb79f7fc093649eb1ad8d9450dccc46849d308'
'de48736f6e4153f03d0a5d38ceb6c6fdb7f054e8f47ddd6af0a3dbf14f27b931'
'2513c6d9984dd0a2058557bf00f06d8d5181734e41dcfe07be7ed86f2959622a'
'c86372c207d174c0918d4aedf1cb79f7fc093649eb1ad8d9450dccc46849d308'
'3862757491160700ac2fb723096f6f636f30320cccc6efd9537149ed348b57d1'
'9699d7105375754f0dcf6abff87d09b270565bfc6578a13641770f3fc62d678a'
'31e24baa9eee826d7d77dbcf8f1a6a44c92f771e52d21677acb8d76fac7ae204')
_svnrev=264010
@ -87,7 +92,9 @@ prepare() {
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
# D hacks
patch -p1 -i "$srcdir/phobos_path.patch"
patch -p1 -i "$srcdir/gdc_phobos_path.patch"
patch -p1 -i "$srcdir/gdc_artificial_decl.patch"
patch -p1 -i "$srcdir/gdc_thunk_weak_ref.patch"
#sed -i "/GDCFLAGSX=/s/-Wall/-shared-libphobos -Wall/" libphobos/configure
# ALARM: Specify build host types, triplet patch
@ -352,8 +359,8 @@ package_gcc-d() {
install -Dm755 gcc/d21 "$pkgdir"/"$_libdir"/d21
make -C $CHOST/libphobos DESTDIR="$pkgdir" install
rm -f "$pkgdir/usr/lib/"lib{gphobos,gdruntime}.{so,a}*
rm -f "$pkgdir/usr/lib32/"lib{gphobos,gdruntime}.{so,a}*
rm -f "$pkgdir/usr/lib/"lib{gphobos,gdruntime}.so*
rm -f "$pkgdir/usr/lib32/"lib{gphobos,gdruntime}.so*
install -d "$pkgdir"/usr/include/dlang
ln -s /"${_libdir}"/include/d "$pkgdir"/usr/include/dlang/gdc

View file

@ -0,0 +1,43 @@
diff --git a/gcc/d/d-tree.h b/gcc/d/d-tree.h
index a514bc3902f..303d52390c2 100644
--- a/gcc/d/d-tree.h
+++ b/gcc/d/d-tree.h
@@ -600,6 +600,7 @@ extern tree d_signed_type (tree);
extern void d_keep (tree);
/* In decl.cc. */
+extern const char *mangle_decl (Dsymbol *);
extern tree mangle_internal_decl (Dsymbol *, const char *, const char *);
extern void build_decl_tree (Dsymbol *);
extern tree get_symbol_decl (Declaration *);
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 49723649230..90871b4c90b 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -59,7 +59,7 @@ along with GCC; see the file COPYING3. If not see
/* Return identifier for the external mangled name of DECL. */
-static const char *
+const char *
mangle_decl (Dsymbol *decl)
{
if (decl->isFuncDeclaration ())
diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index bbd3961181d..a678b7938a6 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -1107,8 +1107,12 @@ public:
CONSTRUCTOR_APPEND_ELT (elms, size_int (i),
build_typeinfo (d->loc, arg->type));
}
+
+ const char *prefix = concat (GDC_PREFIX ("__tuple"),
+ mangle_decl (Module::rootModule), NULL);
+
tree ctor = build_constructor (build_ctype (satype), elms);
- tree decl = build_artificial_decl (TREE_TYPE (ctor), ctor);
+ tree decl = build_artificial_decl (TREE_TYPE (ctor), ctor, prefix);
/* The internal pointer reference should be public, but not visible outside
the compilation unit, as it's referencing COMDAT decls. */

View file

@ -0,0 +1,14 @@
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);