diff options
author | Geod24 <pro.mathias.lang@gmail.com> | 2019-10-28 03:07:44 +0900 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-12-26 10:16:00 +0000 |
commit | 5bbe16ae7b8eec705cb27a5ab84914130c077d65 (patch) | |
tree | c5f7dfbc6662960c337b5fb261eec407c6d75493 /main/gcc/APKBUILD | |
parent | ae019b5c972f11cdbd4d827ab7676ad1ef364f0c (diff) | |
download | aports-5bbe16ae7b8eec705cb27a5ab84914130c077d65.tar.gz aports-5bbe16ae7b8eec705cb27a5ab84914130c077d65.tar.bz2 aports-5bbe16ae7b8eec705cb27a5ab84914130c077d65.tar.xz |
main/gcc: Add support for the D programming language
GDC, the GCC-based D compiler, is part of GCC since GCC9.
Upstream support for Musl was added progressively (D relies heavily on libc),
and some key components were missing as of GCC 9.2.0 release (2019-08-12).
The final patches to support Musl have been submitted to
the gcc-patches mailing list on the 2019-08-21.
This includes a smaller version of those patches,
tailored to only include the changes necessary to Musl.
Most of the patch could be removed after/if GCC 9.3.0 is released.
Diffstat (limited to 'main/gcc/APKBUILD')
-rw-r--r-- | main/gcc/APKBUILD | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD index ebc564df6a..e1bba99cb6 100644 --- a/main/gcc/APKBUILD +++ b/main/gcc/APKBUILD @@ -6,7 +6,7 @@ pkgver=9.2.0 [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="$pkgname$_target" -pkgrel=3 +pkgrel=4 pkgdesc="The GNU Compiler Collection" url="https://gcc.gnu.org" arch="all" @@ -20,6 +20,7 @@ subpackages=" " replaces="libstdc++ binutils" : ${LANG_CXX:=true} +: ${LANG_D:=true} : ${LANG_OBJC:=true} : ${LANG_GO:=true} : ${LANG_FORTRAN:=true} @@ -33,6 +34,7 @@ LIBITM=true if [ "$CHOST" != "$CTARGET" ]; then if [ "$BOOTSTRAP" = nolibc ]; then LANG_CXX=false + LANG_D=false LANG_ADA=false LIBGCC=false _builddir="$srcdir/build-cross-pass2" @@ -86,6 +88,10 @@ else _builddir="$srcdir/build" fi +# GDC hasn't been ported to PowerPC +# See libphobos/configure.tgt in GCC sources for supported targets +[ "$CARCH" = ppc64le ] && LANG_D=false + # Go needs {set,make,swap}context, unimplemented in musl [ "$CTARGET_LIBC" = musl ] && LANG_GO=false @@ -117,6 +123,10 @@ if $LANG_CXX; then subpackages="$subpackages libstdc++:libcxx:$CTARGET_ARCH g++$_target:gpp" _languages="$_languages,c++" fi +if $LANG_D; then + subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc" + _languages="$_languages,d" +fi if $LANG_OBJC; then subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc" _languages="$_languages,objc" @@ -173,6 +183,9 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg gcc-pure64-mips.patch 0016-invalid_tls_model.patch gcc10-pr91920.patch + + 400-dlang-phobos.patch + 401-dlang-32bits.patch " # gcc-4.8-build-args.patch @@ -320,6 +333,7 @@ package() { # strip debug info from some static libs ${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \ + -o -name libgphobos.a -o -name libgdruntime.a \ -o -name libmudflap.a -o -name libmudflapth.a \ -o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \ -o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \ @@ -471,6 +485,32 @@ libgomp() { mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/ } +libgphobos() { + pkgdesc="D programming language standard library for GCC" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/ +} + +gdc() { + pkgdesc="GCC-based D language compiler" + depends="gcc=$_gccrel libgphobos=$_gccrel" + + mkdir -p "$subpkgdir"/$_gcclibdir/include/d/ \ + "$subpkgdir"/usr/lib \ + "$subpkgdir"/usr/bin + # Copy: The installed `.d` files, the static lib, the binary itself + # The shared libs are part of `libgphobos` so one can run program + # without installing the compiler + mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/ + mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/ +} + + libgo() { pkgdesc="Go runtime library for GCC" depends= @@ -587,4 +627,6 @@ a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a1507 f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch 86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch 17e0faeef742d32d57a070d983480367dd28cd28d47a8966ce327afdff3a38ea76803a833c90aff7d3a93aa66dae76c9be47b2408500913b40571af25b85aca7 0016-invalid_tls_model.patch -e9fef7677f9541848cd1df0bf3c330f06f1369bdf1d228238b7f1d03d8f2c4be07fd62be503b7bf72b6b1e2d4e404ddd957157b56b8050e3657820ade77491aa gcc10-pr91920.patch" +e9fef7677f9541848cd1df0bf3c330f06f1369bdf1d228238b7f1d03d8f2c4be07fd62be503b7bf72b6b1e2d4e404ddd957157b56b8050e3657820ade77491aa gcc10-pr91920.patch +38772c5b0905455a44c43d6ef7e5f140530006e2bde9f5ffd6b569c7cf9633992515f666b486d7a78c30ab8da99b92b2775c90fde47821ae542ef1c49dc405df 400-dlang-phobos.patch +84bdbdfcb972161765b81220ea2e80e83c32f3ab27596b77eb451d8cac4bd6312210df468581c2b0e1363f5e3b31654e369c47ae84c907f3b54a1786d7c17830 401-dlang-32bits.patch" |