746 lines
29 KiB
Text
746 lines
29 KiB
Text
# Automatically generated aport, do not edit!
|
|
# Generator: pmbootstrap aportgen gcc-aarch64
|
|
# Based on: main/gcc (from Alpine)
|
|
|
|
CTARGET_ARCH=aarch64
|
|
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
|
LANG_D=false
|
|
LANG_OBJC=false
|
|
LANG_JAVA=false
|
|
LANG_GO=false
|
|
LANG_FORTRAN=false
|
|
LANG_ADA=false
|
|
options="!strip !tracedeps"
|
|
|
|
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
|
# when this variable matches "no*"
|
|
BOOTSTRAP="nobuildbase"
|
|
|
|
# abuild will only cross compile when this variable is set, but it
|
|
# needs to find a valid package database in there for dependency
|
|
# resolving, so we set it to /.
|
|
CBUILDROOT="/"
|
|
|
|
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
|
|
|
pkgname=gcc-aarch64
|
|
_pkgbase=11.2.1
|
|
pkgver=11.2.1_git20211128
|
|
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
|
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
|
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
|
|
|
pkgname=gcc-aarch64
|
|
pkgrel=1
|
|
pkgdesc="Stage2 cross-compiler for aarch64"
|
|
url="https://gcc.gnu.org"
|
|
arch="x86_64"
|
|
license="GPL-2.0-or-later LGPL-2.1-or-later"
|
|
_gccrel=$pkgver-r$pkgrel
|
|
depends="isl binutils-aarch64 mpc1"
|
|
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
|
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
|
|
subpackages="g++-aarch64:gpp"
|
|
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
|
replaces="libstdc++ binutils"
|
|
|
|
: "${LANG_CXX:=true}"
|
|
: "${LANG_D:=true}"
|
|
: "${LANG_OBJC:=true}"
|
|
: "${LANG_GO:=true}"
|
|
: "${LANG_FORTRAN:=true}"
|
|
: "${LANG_ADA:=true}"
|
|
: "${LANG_JIT:=true}"
|
|
|
|
_libgomp=true
|
|
_libgcc=true
|
|
_libatomic=true
|
|
_libitm=true
|
|
|
|
if [ "$CHOST" != "$CTARGET" ]; then
|
|
if [ "$BOOTSTRAP" = nolibc ]; then
|
|
LANG_CXX=false
|
|
LANG_ADA=false
|
|
_libgcc=false
|
|
_builddir="$srcdir/build-cross-pass2"
|
|
else
|
|
_builddir="$srcdir/build-cross-final"
|
|
fi
|
|
LANG_OBJC=false
|
|
LANG_GO=false
|
|
LANG_FORTRAN=false
|
|
LANG_D=false
|
|
LANG_JIT=false
|
|
_libgomp=false
|
|
_libatomic=false
|
|
_libitm=false
|
|
|
|
# reset target flags (should be set in crosscreate abuild)
|
|
# fixup flags. seems gcc treats CPPFLAGS as global without
|
|
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
|
export CFLAGS="$CPPFLAGS $CFLAGS"
|
|
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
|
unset CPPFLAGS
|
|
export CFLAGS_FOR_TARGET=" "
|
|
export CXXFLAGS_FOR_TARGET=" "
|
|
export LDFLAGS_FOR_TARGET=" "
|
|
|
|
STRIP_FOR_TARGET="$CTARGET-strip"
|
|
elif [ "$CBUILD" != "$CHOST" ]; then
|
|
# fixup flags. seems gcc treats CPPFLAGS as global without
|
|
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
|
export CFLAGS="$CPPFLAGS $CFLAGS"
|
|
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
|
unset CPPFLAGS
|
|
|
|
# reset flags and cc for build
|
|
export CC_FOR_BUILD="gcc"
|
|
export CXX_FOR_BUILD="g++"
|
|
export CFLAGS_FOR_BUILD=" "
|
|
export CXXFLAGS_FOR_BUILD=" "
|
|
export LDFLAGS_FOR_BUILD=" "
|
|
export CFLAGS_FOR_TARGET=" "
|
|
export CXXFLAGS_FOR_TARGET=" "
|
|
export LDFLAGS_FOR_TARGET=" "
|
|
|
|
# Languages that do not need bootstrapping
|
|
LANG_OBJC=false
|
|
LANG_GO=false
|
|
LANG_FORTRAN=false
|
|
LANG_D=false
|
|
LANG_JIT=false
|
|
|
|
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
|
_builddir="$srcdir/build-cross-native"
|
|
else
|
|
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
|
_builddir="$srcdir/build"
|
|
fi
|
|
|
|
# GDC hasn't been ported to PowerPC
|
|
# See libphobos/configure.tgt in GCC sources for supported targets
|
|
# riscv fails with: error: static assert "unimplemented"
|
|
case "$CARCH" in
|
|
ppc64le|riscv64) LANG_D=false ;;
|
|
esac
|
|
|
|
# libitm has TEXTRELs in ARM build, so disable for now
|
|
case "$CTARGET_ARCH" in
|
|
arm*) _libitm=false ;;
|
|
mips*) _libitm=false ;;
|
|
riscv64) _libitm=false ;;
|
|
esac
|
|
|
|
# Internal libffi fails to build on MIPS at the moment, need to
|
|
# investigate further. We disable LANG_GO on mips64 as it requires
|
|
# the internal libffi.
|
|
case "$CTARGET_ARCH" in
|
|
mips*) LANG_GO=false ;;
|
|
esac
|
|
|
|
# Fortran uses libquadmath if toolchain has __float128
|
|
# currently on x86, x86_64 and ia64
|
|
_libquadmath=$LANG_FORTRAN
|
|
case "$CTARGET_ARCH" in
|
|
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
|
|
*) _libquadmath=false ;;
|
|
esac
|
|
|
|
# libatomic is a dependency for openvswitch
|
|
$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
|
$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
|
$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
|
if $_libgomp; then
|
|
depends="$depends libgomp=$_gccrel"
|
|
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
|
fi
|
|
|
|
case "$CARCH" in
|
|
riscv64)
|
|
LANG_ADA=false;;
|
|
esac
|
|
|
|
_languages=c
|
|
if $LANG_CXX; then
|
|
_languages="$_languages,c++"
|
|
fi
|
|
if $LANG_D; then
|
|
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
|
|
_languages="$_languages,d"
|
|
makedepends_build="$makedepends_build libucontext-dev"
|
|
fi
|
|
if $LANG_OBJC; then
|
|
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
|
_languages="$_languages,objc"
|
|
fi
|
|
if $LANG_GO; then
|
|
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
|
|
_languages="$_languages,go"
|
|
fi
|
|
if $LANG_FORTRAN; then
|
|
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
|
|
_languages="$_languages,fortran"
|
|
fi
|
|
if $LANG_ADA; then
|
|
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
|
_languages="$_languages,ada"
|
|
[ "$CBUILD" = "$CTARGET" ] && makedepends_build="$makedepends_build gcc-gnat-bootstrap"
|
|
[ "$CBUILD" != "$CTARGET" ] && makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
|
fi
|
|
if $LANG_JIT; then
|
|
subpackages="$subpackages libgccjit:jit libgccjit-dev:jitdev"
|
|
_languages="$_languages,jit"
|
|
fi
|
|
makedepends="$makedepends_build $makedepends_host"
|
|
|
|
# when using upstream releases, use this URI template
|
|
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
|
#
|
|
# right now, we are using a git snapshot.
|
|
#
|
|
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
|
|
# so that they can be properly tracked and easily rebased if needed.
|
|
source="https://dev.alpinelinux.org/~nenolod/gcc-${pkgver}.tar.xz
|
|
0001-posix_memalign.patch
|
|
0002-gcc-poison-system-directories.patch
|
|
0003-Turn-on-Wl-z-relro-z-now-by-default.patch
|
|
0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
|
0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
|
0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
|
0007-Enable-Wtrampolines-by-default.patch
|
|
0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
|
0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
|
0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
|
0011-libiberty-copy-PIC-objects-during-build-process.patch
|
|
0012-libitm-disable-FORTIFY.patch
|
|
0013-libgcc_s.patch
|
|
0014-nopie.patch
|
|
0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
|
0016-dlang-update-zlib-binding.patch
|
|
0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
|
|
0018-ada-fix-shared-linking.patch
|
|
0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
|
0020-add-fortify-headers-paths.patch
|
|
0021-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
|
0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
|
0023-Pure-64-bit-MIPS.patch
|
|
0024-use-pure-64-bit-configuration-where-appropriate.patch
|
|
0025-always-build-libgcc_eh.a.patch
|
|
0026-ada-libgnarl-compatibility-for-musl.patch
|
|
0027-ada-musl-support-fixes.patch
|
|
0028-gcc-go-Fix-ucontext_t-on-PPC64.patch
|
|
0029-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
|
0030-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
|
|
0031-gcc-go-signal-34-is-special-on-musl-libc.patch
|
|
0032-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
|
0033-gcc-go-link-to-libucontext.patch
|
|
0034-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch
|
|
0035-Use-generic-errstr.go-implementation-on-musl.patch
|
|
0036-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
|
0037-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
|
0038-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
|
0039-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
|
|
0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
|
|
"
|
|
|
|
# we build out-of-tree
|
|
_gccdir="$srcdir"/gcc-$pkgver
|
|
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
|
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
|
|
|
|
prepare() {
|
|
cd "$_gccdir"
|
|
|
|
_err=
|
|
for i in $source; do
|
|
case "$i" in
|
|
*.patch)
|
|
msg "Applying $i"
|
|
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ -n "$_err" ]; then
|
|
error "The following patches failed:"
|
|
for i in $_err; do
|
|
echo " $i"
|
|
done
|
|
return 1
|
|
fi
|
|
|
|
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
|
|
}
|
|
|
|
build() {
|
|
local _arch_configure=
|
|
local _libc_configure=
|
|
local _bootstrap_configure=
|
|
local _symvers=
|
|
local _jit_configure=
|
|
|
|
cd "$_gccdir"
|
|
|
|
case "$CTARGET" in
|
|
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
|
|
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
|
|
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
|
|
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
|
|
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
|
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
|
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
|
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
|
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
|
|
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
|
|
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
|
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
|
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
|
riscv64-*-*-*) _arch_configure="--with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic";;
|
|
esac
|
|
|
|
case "$CTARGET_ARCH" in
|
|
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
|
|
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
|
|
esac
|
|
|
|
case "$CTARGET_LIBC" in
|
|
musl)
|
|
# musl does not support mudflap, or libsanitizer
|
|
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
|
|
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
|
|
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
|
|
_symvers="--disable-symvers"
|
|
export libat_cv_have_ifunc=no
|
|
;;
|
|
esac
|
|
|
|
|
|
case "$BOOTSTRAP" in
|
|
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
|
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
|
esac
|
|
|
|
$LANG_JIT && _jit_configure="--enable-host-shared"
|
|
|
|
$_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
|
$_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
|
$_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
|
$_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath"
|
|
|
|
msg "Building the following:"
|
|
echo ""
|
|
echo " CBUILD=$CBUILD"
|
|
echo " CHOST=$CHOST"
|
|
echo " CTARGET=$CTARGET"
|
|
echo " CTARGET_ARCH=$CTARGET_ARCH"
|
|
echo " CTARGET_LIBC=$CTARGET_LIBC"
|
|
echo " languages=$_languages"
|
|
echo " arch_configure=$_arch_configure"
|
|
echo " libc_configure=$_libc_configure"
|
|
echo " cross_configure=$_cross_configure"
|
|
echo " bootstrap_configure=$_bootstrap_configure"
|
|
echo " hash_style_configure=$_hash_style_configure"
|
|
echo ""
|
|
|
|
export CFLAGS="$CFLAGS -O2"
|
|
|
|
mkdir -p "$_builddir"
|
|
cd "$_builddir"
|
|
"$_gccdir"/configure --prefix=/usr \
|
|
--mandir=/usr/share/man \
|
|
--infodir=/usr/share/info \
|
|
--build=${CBUILD} \
|
|
--host=${CHOST} \
|
|
--target=${CTARGET} \
|
|
--with-pkgversion="Alpine $pkgver" \
|
|
--enable-checking=release \
|
|
--disable-fixed-point \
|
|
--disable-libstdcxx-pch \
|
|
--disable-multilib \
|
|
--disable-nls \
|
|
--disable-werror \
|
|
$_symvers \
|
|
--enable-__cxa_atexit \
|
|
--enable-default-pie \
|
|
--enable-default-ssp \
|
|
--enable-cloog-backend \
|
|
--enable-languages=$_languages \
|
|
$_arch_configure \
|
|
$_libc_configure \
|
|
$_cross_configure \
|
|
$_bootstrap_configure \
|
|
$_jit_configure \
|
|
--with-system-zlib \
|
|
$_hash_style_configure
|
|
make
|
|
}
|
|
|
|
package() {
|
|
cd "$_builddir"
|
|
make -j1 DESTDIR="$pkgdir" install
|
|
|
|
ln -s gcc "$pkgdir"/usr/bin/cc
|
|
|
|
# we dont support gcj -static
|
|
# and saving 35MB is not bad.
|
|
find "$pkgdir" \( -name libgtkpeer.a \
|
|
-o -name libgjsmalsa.a \
|
|
-o -name libgij.a \) \
|
|
-delete
|
|
|
|
# strip debug info from some static libs
|
|
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 \
|
|
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
|
-a -type f \
|
|
-exec ${STRIP_FOR_TARGET} -g {} +
|
|
|
|
if $_libgomp; then
|
|
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
|
fi
|
|
if $_libitm; then
|
|
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
|
fi
|
|
|
|
# remove ffi
|
|
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
|
find "$pkgdir" -name 'ffi*.h' -delete
|
|
|
|
local gdblib=${_target:+$CTARGET/}lib
|
|
if [ -d "$pkgdir"/usr/$gdblib/ ]; then
|
|
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do
|
|
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
|
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
|
done
|
|
fi
|
|
|
|
# move ada runtime libs
|
|
if $LANG_ADA; then
|
|
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
|
|
mv "$i" "$pkgdir"/usr/lib/
|
|
ln -s ../../../../${i##*/} $i
|
|
done
|
|
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
|
|
mv "$i" "$pkgdir"/usr/lib/
|
|
ln -s ../../../../${i##*/} $i
|
|
done
|
|
fi
|
|
|
|
if [ "$CHOST" != "$CTARGET" ]; then
|
|
# cross-gcc: remove any files that would conflict with the
|
|
# native gcc package
|
|
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
|
|
# libcc1 does not depend on target, don't ship it
|
|
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
|
|
|
# fixup gcc library symlinks to be linker scripts so
|
|
# linker finds the libs from relocated sysroot
|
|
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
|
|
if [ -h "$so" ]; then
|
|
local _real=$(basename "$(readlink "$so")")
|
|
rm -f "$so"
|
|
echo "GROUP ($_real)" > "$so"
|
|
fi
|
|
done
|
|
else
|
|
# add c89/c99 wrapper scripts
|
|
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
|
#!/bin/sh
|
|
_flavor="-std=c89"
|
|
for opt; do
|
|
case "$opt" in
|
|
-ansi|-std=c89|-std=iso9899:1990) _flavor="";;
|
|
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
|
exit 1;;
|
|
esac
|
|
done
|
|
exec gcc $_flavor ${1+"$@"}
|
|
EOF
|
|
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
|
#!/bin/sh
|
|
_flavor="-std=c99"
|
|
for opt; do
|
|
case "$opt" in
|
|
-std=c99|-std=iso9899:1999) _flavor="";;
|
|
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
|
exit 1;;
|
|
esac
|
|
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
|
|
}
|
|
|
|
libatomic() {
|
|
pkgdesc="GCC Atomic library"
|
|
depends=
|
|
replaces="gcc"
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
libcxx() {
|
|
pkgdesc="GNU C++ standard runtime library"
|
|
depends=
|
|
|
|
if [ "$CHOST" = "$CTARGET" ]; then
|
|
# verify that we are using clock_gettime rather than doing direct syscalls
|
|
# so we dont break 32 bit arches due to time64.
|
|
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
|
|
fi
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
gpp() {
|
|
pkgdesc="GNU C++ standard library and compiler"
|
|
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
|
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
|
"$subpkgdir"/usr/bin \
|
|
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
|
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
|
|
|
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
|
|
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
|
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
|
|
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
|
}
|
|
|
|
jit() {
|
|
pkgdesc="GCC JIT Library"
|
|
depends=
|
|
amove usr/lib/libgccjit.so*
|
|
}
|
|
|
|
jitdev() {
|
|
pkgdesc="GCC JIT Library (development files)"
|
|
depends="libgccjit"
|
|
amove usr/include/libgccjit*.h
|
|
}
|
|
|
|
libobjc() {
|
|
pkgdesc="GNU Objective-C runtime"
|
|
replaces="objc"
|
|
depends=
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
objc() {
|
|
pkgdesc="GNU Objective-C"
|
|
replaces="gcc"
|
|
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
|
|
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
|
"$subpkgdir"/$_gcclibdir/include \
|
|
"$subpkgdir"/usr/lib
|
|
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
|
|
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
|
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
|
"$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
libgcc() {
|
|
pkgdesc="GNU C compiler runtime libraries"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
libgomp() {
|
|
pkgdesc="GCC shared-memory parallel programming API library"
|
|
depends=
|
|
replaces="gcc"
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
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 musl-dev"
|
|
depends="$depends libucontext-dev"
|
|
|
|
mkdir -p "$subpkgdir/$_gcclibexec" \
|
|
"$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/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
|
|
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/lib/libgphobos.spec "$subpkgdir"/usr/lib/
|
|
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
|
|
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
|
|
}
|
|
|
|
|
|
libgo() {
|
|
pkgdesc="Go runtime library for GCC"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
go() {
|
|
pkgdesc="Go support for GCC"
|
|
depends="gcc=$_gccrel libgo=$_gccrel !go"
|
|
|
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
|
"$subpkgdir"/usr/lib \
|
|
"$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
|
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
|
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
|
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
|
|
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
|
|
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
|
|
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
|
|
mv "$pkgdir"/usr/lib/libgo.a \
|
|
"$pkgdir"/usr/lib/libgo.so \
|
|
"$pkgdir"/usr/lib/libgobegin.a \
|
|
"$pkgdir"/usr/lib/libgolibbegin.a \
|
|
"$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
libgfortran() {
|
|
pkgdesc="Fortran runtime library for GCC"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
libquadmath() {
|
|
replaces="gcc"
|
|
pkgdesc="128-bit math library for GCC"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
gfortran() {
|
|
pkgdesc="GNU Fortran Compiler"
|
|
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
|
$_libquadmath && depends="$depends libquadmath=$_gccrel"
|
|
replaces="gcc"
|
|
|
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
|
"$subpkgdir"/$_gcclibdir \
|
|
"$subpkgdir"/usr/lib \
|
|
"$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
|
|
mv "$pkgdir"/usr/lib/libgfortran.a \
|
|
"$pkgdir"/usr/lib/libgfortran.so \
|
|
"$subpkgdir"/usr/lib/
|
|
if $_libquadmath; then
|
|
mv "$pkgdir"/usr/lib/libquadmath.a \
|
|
"$pkgdir"/usr/lib/libquadmath.so \
|
|
"$subpkgdir"/usr/lib/
|
|
fi
|
|
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
|
|
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
|
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
|
}
|
|
|
|
libgnat() {
|
|
pkgdesc="GNU Ada runtime shared libraries"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
libgnatstatic() {
|
|
pkgdesc="GNU Ada static libraries"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
|
|
}
|
|
|
|
gnat() {
|
|
pkgdesc="Ada support for GCC"
|
|
depends="gcc=$_gccrel"
|
|
provides="$pkgname-gnat-bootstrap"
|
|
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
|
|
|
mkdir -p "$subpkgdir"/$_gcclibexec \
|
|
"$subpkgdir"/$_gcclibdir \
|
|
"$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
|
|
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
|
|
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
|
}
|
|
|
|
sha512sums="
|
|
99c25b0cf5ae57806e3ecc76977c4b177e60660a289117506061243d3b492c76392cc47ba1165a04b1d46b932c1492db045edb29eab5460774be90243e984f22 gcc-11.2.1_git20211128.tar.xz
|
|
a1b8ae8ba40ed0e384484590ca7c9328f922f6237c883d7a78ad16a5110f522280c577ede7ee65163ca8b9e2cb02d5eefa343d8a60a8d6a64d2fc3496b01b80a 0001-posix_memalign.patch
|
|
79ad02ec110f485bc19364459f94d16556b4e178a029a538b9a448ce356950fcad99674d711edb012d8a28b4e39a865370dec1a12c86d6fd91160acf80135ee3 0002-gcc-poison-system-directories.patch
|
|
fd8819d4b7ef3f3d32bd09f049098f04f7503556b65f1f85c91cd7f724770b3b8f16af580774e518310be83462070551cdc8ef78963e73760849de26d8a107f7 0003-Turn-on-Wl-z-relro-z-now-by-default.patch
|
|
eeca973fb0f6a82203358cb8ce15cac256315e0e22ad00b579b73a3bb093da306f62d59f86f7f3d3c0194370dff6ee4b0a01026153a29933437b3c3ed758c34e 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
|
faa5bd16cb5d4c898dd1c7f9b88a12e1549d2f643c13cfe0413fdf8dccf9ce48489415de4f3786df86d9ca305fbeba650b4f9f2440f9800297bcd9fa5624f714 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
|
371ebf3a572fb1dce7756bde18dd116e3cff9c110c80e05e46d6d01a3b7545f28ec6e65a062226bfa1b4b3da8ab436835d03f5a14b33ada1a250c726ce8c45e4 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
|
ed48ccf5733d0f988cc1838c3f5f8466e21b92390af8679e79447699fd8fae51cd2091233d15f77b44412f09f1b8266d68d1da669c6f9b409f4808fbb1e9a2ed 0007-Enable-Wtrampolines-by-default.patch
|
|
9481738fb87f7c453569ba88aa7629d773d5d88185e67a412e3b06422868da0719b3d98f11f29f21a7e9948a6d598c34a7e9806bb60428734a3de724984f9de0 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
|
47650d47faa0d896179b11513171b10547b6a374a574cfdf923816c46adf643dda61abac56bd3ce971acccd9b2843b28b8fac8cc46e92e9f325a275113413771 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
|
4470ecbcfb1dbdcf5157d94178229b7e4f24c997a92f48b688f0850454bdf19ea1525d1ebbc541d5da203408e2d5d577ca9a769db8501ead4e4888fde21fb2ef 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
|
c324b0cfc83f90f65ffe2b09ced8248d907f8d3c7120491f1311601d76f1729e8728177b0b57db691c7b917265bf1e0c33f08a3f1360fc26f75aec057262e0d2 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
|
3a7ccaa7ef78a55b3d327c4c2e3474bc904192cc8d9f62ab4658ed75887301f5069af823aa9d01560a5047fe95c89ee0c1f98745722441d27ba544870af56c7c 0012-libitm-disable-FORTIFY.patch
|
|
68442827a2335c40e9ea1979b64e026634497f076c21a8a9f11bf09f612ec72625c72e16ff6d50da659d0d5c49a7df266be4e99b2af3712fe84238b926ad14b2 0013-libgcc_s.patch
|
|
b34a972b39f4b55d11ed2bfaa17181a353e721424f31c35892a0a7d16a680d017856d4679b1bcd6ebdee304d3e15aae5f545a59c5a5abf0e48d094e8fef52ae0 0014-nopie.patch
|
|
03574bbbb8cc76ab3303862e68d19898b6b1971cbea0d8e3f8d0bef47c33376bc8d37d0a3aee9783e6f04ca3857fa6cfc054b24fafe5eed51a75215e61dde9ea 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
|
5233ae40bf0e42f8c9cd379f776c6a5af11bf986c0e09b3032e02e5c4f257d12d8f2c27739775b48bd07fcf6c4062086465864b1ca11983126752fd46b85c658 0016-dlang-update-zlib-binding.patch
|
|
627a24e669e408165c4b63c9a4e0a980373a4b801286f7b6e6a3a4c335e0c9160d164d23701c90170217ad333d0403b1aef7738ac90c4ed9f832d27c0eb4cd38 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
|
|
482a8556fa7bf2ca14782ccce01465211ad476b83c3087668298d6078b32e1eae2138c0ea236c4b191f57171bc6ce64d51cac2dfea4f33d69283f12ecec9e9c6 0018-ada-fix-shared-linking.patch
|
|
8fe388c533b687542aacda86c1ca04290a53123050e2700867895005aa34ec0b23f2c394c5710b1b87e85442fb976c47a95d10360984da13a82a3ff5307996d5 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
|
563d17f07468d412b46b012cff37d1c4acdee2bd1046b7ac817c1b35034c167e252a6067dd34b418770d3b0c170f8ae14a4ee9b2ab0df1b8b7d2581afec83731 0020-add-fortify-headers-paths.patch
|
|
49ba07e45442651cd9610ca339035deb19d73744850149722c6da9a0e1b5081ab27e8e88f45e836de2a432770dcd7fd2073bc5379679921175a68627e9a0941f 0021-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
|
a6d88c765aded0dcd0ecc0bf68a9ad3e4d0bb8f2fe1f7b1245db068d5cee154aec8c3bed47390d60b10809c224fbbafb5f36225a46fc6c8f143bd8317fa2d062 0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
|
40fb955eaa10d2536acf99a716aed68cb587e94bdde8260581b2ba7026a9698058495f0b040a3909096b4102565b1c704c70e3b870e239366450df10d73a201c 0023-Pure-64-bit-MIPS.patch
|
|
5ff7f3836a4ae7729bbe8fffe97956eeebb6cd40657214423e79a9ec42e85654491cb73fdb263ff70d4e37e14f42370f2a90ba2c97411c5ec4b2d967c6d70a85 0024-use-pure-64-bit-configuration-where-appropriate.patch
|
|
e45369759649d0680b7c39512e20a5424706d2e7711d14076d893850105daba8b9bb5094db962813859d225e70e018a5667155d92827a918674961015f13eb95 0025-always-build-libgcc_eh.a.patch
|
|
a16387cda58085fce4413db099e18c089d3e2f6603ba4d3add07fd4d31f3d254c91611ad4b8ee36135a364f12e0897bfd6d5998b95c0f431ca8b79d142f26958 0026-ada-libgnarl-compatibility-for-musl.patch
|
|
3467decc5a090d82497a6b029ec6e34aac3876fadd23db2a3af385017e5cd992f82cf11b928e6b461248b60990fa50a469017a4646954f63974572c3a6fcaaec 0027-ada-musl-support-fixes.patch
|
|
9960b164c608c47f35de2bf624cfe8782984e8d3ed23a72a456284e3082620f95501299b3e9e26b0f8c0d0796c68c353584bb5c48e85b101010abe29a46ccf5d 0028-gcc-go-Fix-ucontext_t-on-PPC64.patch
|
|
c89f234df9a37cfe0c0d9ca891febe57b3ae0eb01416edaeb5d66738d3f5dcf5e62eedfa12a22e56aaef7cd833ecb9b85e72ae3636ef2dd0c6ec8654609ba3fe 0029-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
|
df6447febdecabacadaeb9925830ee531a860ddd5a1970ff42f608a798eccce81e8beaa5caf2f121411c55361af1ca4e8352552f21809b4fcaffda36e870c69c 0030-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
|
|
5220d075b3882e235cbc5e00b22d5a314d986a078ef7242bc777b32e00891f65fa887ed4557aa5d5c712c4e8ab49d56560cfe2489e36fb02843f1ff892b0fcf7 0031-gcc-go-signal-34-is-special-on-musl-libc.patch
|
|
09f5fc4fadf1e60a3766ad33bfaf8c1ce73cdaacb41734d31fb78583e9fcdb5ca7650c3e03c01c8c3239a81d6ed849f39d17e0a31a672cb15c7138ce58c82c1b 0032-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
|
c0abc9a985a195612d9bd9d12ea7a18e5717723d23790a90610f03881f9dcf54911332be002cb79043575db3b2f82099ff927d7f761050a063601fbe2e04e8f1 0033-gcc-go-link-to-libucontext.patch
|
|
d5722d15a3dd9669ee4da062a3e0a0a2049772f10224f7da615eb4093e5f24bca4372078c9282a457cba649b12c4f1180ec7523584410e5cba555f4612740186 0034-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch
|
|
afb7d25f10f23e3ac634a10424f43e9ebe737d4aec9d067c2ad42c1144d08208271f206cdf54582b97a15a0900e5d426ea2940850b9e67abbd2b03f5a30a1793 0035-Use-generic-errstr.go-implementation-on-musl.patch
|
|
ca185b3e0644dab6a87bf524042c72069ffda0cde578e803bd59a9c5e40ba4d7d6f0be49836bc3aa622a4367606bdc71a6b90fcc2c377e045bbdbe1fb5ce6730 0036-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
|
11f93cd928881264b2a2a78dd52001980dca26cb22d2207a3ff286d63deca81468daa649762ff27f1a6475c0334bc3135b7bb080ce1b152b0f1a1e8f81287c5f 0037-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
|
7541d57f7c04571b3d60a2e40038245b33e68c4b53373f64d2827d106349546834f06eb77227194f950b570e15f4fe9e259238458d5be8f10c41c56404f7cfff 0038-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
|
|
2c5edf9e3fe6822a322c1dc75218062afb56799c304aa583c4e1e80136c6262cbd9bb950843f167b40639c6623a33a0475990c4452e03307af434dc8760d437d 0039-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
|
|
8e44678fc77094a2c0cbc78575759ee51d50ea53189cf4d651c8501eb1b46210bb6d5969b81f5f63532914320971e7a1e2e80b32cb679ab41af86f21742b4c19 0040-stddef.h-add-support-for-musl-typedef-macro-guards.patch
|
|
"
|