f125901979
upstream commit:
1e550564a9
[ci:skip-build] Builds locally, no point to build on poor Gitlab CI
727 lines
28 KiB
Text
727 lines
28 KiB
Text
# Automatically generated aport, do not edit!
|
|
# Generator: pmbootstrap aportgen gcc-armv7
|
|
# Based on: main/gcc (from Alpine)
|
|
|
|
CTARGET_ARCH=armv7
|
|
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-armv7
|
|
_pkgbase=10.3.1
|
|
pkgver=10.3.1_git20211027
|
|
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
|
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
|
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
|
|
|
pkgname=gcc-armv7
|
|
pkgrel=0
|
|
pkgdesc="Stage2 cross-compiler for armv7"
|
|
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-armv7 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-armv7 binutils-armv7"
|
|
subpackages="g++-armv7: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}"
|
|
|
|
_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
|
|
_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
|
|
|
|
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
|
|
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-Use-_off_t-type-instead-of-_loff_t.patch
|
|
0029-gcc-go-Don-t-include-sys-user.h.patch
|
|
0030-gcc-go-Fix-ucontext_t-on-PPC64.patch
|
|
0031-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
|
0032-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
|
0033-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch
|
|
0034-gcc-go-signal-34-is-special-on-musl-libc.patch
|
|
0035-gcc-go-Prefer-_off_t-over-_off64_t.patch
|
|
0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
|
0037-gcc-go-link-to-libucontext.patch
|
|
0038-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch
|
|
0039-CRuntime_Musl-Support-v1.2.0-for-32-bits.patch
|
|
0040-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
|
0041-Use-generic-errstr.go-implementation-on-musl.patch
|
|
0042-configure-fix-detection-of-atomic-builtins-in-libato.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=
|
|
|
|
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
|
|
|
|
$_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 \
|
|
--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/
|
|
}
|
|
|
|
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="
|
|
2cba43a26debf22fde6442fcc446b7a84ca18bc4281cee1f1f1b50c254eee2615360982d0502df63ed39d7e739e4715373bae75f1c9f226378c7d617478062d9 gcc-10.3.1_git20211027.tar.xz
|
|
a098a33a9d5a0360341c41aec036bce9463a5b67046b19fb2f5bcecfb5fe2aeb58dbd087ec4f8831c503ce57445a7ecd45e500f11476f24d2f441b46cbb99d9c 0001-posix_memalign.patch
|
|
a8da4611f43c0a1641b6f01c230aa706bd8e65ad367acea35051ab7ea821fb4622647c2ceadb6ec7c67388c9af70d06f3c134caa1af47c8542309898e9cd96ba 0002-gcc-poison-system-directories.patch
|
|
e1b5858902dc719bef17d4d6704d66a9662173af57948240282a43b138633932216fa549ea73c54b377aeee4b2658650e756766493a2f2f30e26756b8f9b43da 0003-Turn-on-Wl-z-relro-z-now-by-default.patch
|
|
ef6bcc83e17253f403029f23eae7f0075e41fbe8ec6d391545e32b77b0f5c0cb100a2d56be592ef14cb396a48c7c4a195ad211fd761bdd84d95db7f53e7f5e51 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
|
|
93023be3c1ce4a2b19f5d1ed0a074a5a93daf74329fb59d8e01cfafe69018053e48f842ecdcd61f58526ba213fac99c6cc6cde30b603897a74972f1c51347596 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
|
|
4f6f1f3aef017841dd42a131b686b55c777769aa23d4483660f6c852ab441b6d8eac2ee41c9f83cb62a31988851a57a303fe00a96c9e9f47017e67d2eb73c714 0006-Enable-Wformat-and-Wformat-security-by-default.patch
|
|
5cf49b9be154e3f7f077ccb0737606018af5a660a35041ba0d6192082f7db423e7621874cf66af16e525670a75e7d555e0ddb44d2e5b664635267928497b9d09 0007-Enable-Wtrampolines-by-default.patch
|
|
3af183d717288f8aa0b5206bae906b553448f723380932d2da1dc41d56db730c192ef4ec424cd4eba2052acf1b2c5f35f1a7b608fc17fb8100c4c0e1d27d5e1f 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
|
|
e92cd9e054601bcb6a16966ae378cb3d3ce0b584c0a179996faa3921fb60668298d200d923dc7ca419bd39c4077c55d57d9703252a0728410dc04d427c0206e8 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
|
|
8d094d1e8f90cf44f307ef1e8257138ff61b47aabf58b9ec78080e3ad202de31319436b04f6eff33af5bbf983a0814bb2b9d8b1c8dfdcfaafd48eef414f07b1a 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
|
|
dd06807fb9d02c6de37cb44f17ffea2c86d4f22aabf441ab015e8613f9f37068113d52cd00d57365d53b145799f6affdc008b6d8d0a7daebf500e82debc4f53f 0011-libiberty-copy-PIC-objects-during-build-process.patch
|
|
6d9fe75cbb488e0ac6d85bddb4f6f06fa3424889d225d4c25352555dbd5aed7db0be6d276b6214380f3c8bff37e31a1a56da40066a090a46d727a5f68b9f92a8 0012-libitm-disable-FORTIFY.patch
|
|
ccdacf75756dda9af59a7355a87645d39231e9bf6e9a2f1fa8b6351ca0466dccecaa97a263e67c7a95d71176b31ad6d991f665ef5b855d7134e28ba7a8d30c5f 0013-libgcc_s.patch
|
|
5304f689f1016f0df3bfa580c2a8c72ac936faaaf4edd614eebbc9f1ffad40fe2e306cd46c079f4acb407b56335a4414a462001dcc9ef111afc034f1de4b956b 0014-nopie.patch
|
|
3dec2f23a0b6e4ef183cb9ec8550ac2f59873dad3758dd25eac82c9bd10573c83cf429333b584613e272bd6b20825f164ae015902d93cd996d604d0af6e59220 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
|
|
51c6ac1b3788a4a925873109e243b5cfbf081825b1890a05d1106ab1d73aead60863d80707b52dcfe75ccfe2ece7ae29a68338bb6a4142bc47d2678a10f60fb8 0016-dlang-update-zlib-binding.patch
|
|
c2d32cd3b4765924d30e96216d5482b006fb9a56a281cc10177d09d04b545c77e81f201cc0218cec5345a2672aa69452236576f57ffdedea37d942db3eca7b33 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
|
|
64836685eeb4c87a6f014f20eabe98e212b8082100827a0a3c25d8f0c8e8aa69594bbce0229d7b73fce06ab899030068f64388fa999ecd2914209c4ce7deb902 0018-ada-fix-shared-linking.patch
|
|
e85463e664371e19ac49c4f603c18e2676b395c847fe1fc9969339533d6f9f929e54038a64636ad594f5b3ff53b8fe513b504e06644f5647581aa6b301c3a27e 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
|
|
c7e0eb5f426c613f025fe26af82dd16c7be06b944a4eea642440e2b010d3e8455658ec453ca82333823dc7a52c9bf039b2edcf0f3be6e141bf69618c449b0792 0020-add-fortify-headers-paths.patch
|
|
fa2489368639203189f2ac5fd433cc4fb25c356dd21f560043aa7e2e3a94cbf13df3bd48cc9b2eb472876236f0bb807efa6b06506c2f5b51f71567e54004b430 0021-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
|
|
bf693daf2fcf497c8a804eed2d039d42b2e95725f584d87bc3d9d5fc057693fbfb9b76fb4818399664014497b6dd9055df32e2e7ea29182eb0078cc76dc14839 0022-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
|
|
3c339f40bf3d9059fb5ab14ddde239996d4aebe36e5eb10feecd2ba93ef3e88d56c78f719308458cac74175fd604d7125956568d68c49dbe011c6f8cb6c98c33 0023-Pure-64-bit-MIPS.patch
|
|
43fb576d041698ecaa2f640d6dda8511408d0967d4dd26d597400aa307d0bf9f9a224d8d4d841703453be21c6a321485b84ba0200ae69e260ea043e71a57c0d2 0024-use-pure-64-bit-configuration-where-appropriate.patch
|
|
4aab3f2319a926e25af6f4219001f2f0c250da7ff66bfc7a70c26c6489fffbd52232ec8104e79fb64dfe97e50c8914d333f44eb493629aa0014aa392e3585382 0025-always-build-libgcc_eh.a.patch
|
|
2af7eaf89af20ba945fa8b64592f310632e75afef09f417d6c6efd49f3b9e4624f6659512dcdc077ebc2c38684fcf979a9b4a501e3a414902db2c44bc105eb4c 0026-ada-libgnarl-compatibility-for-musl.patch
|
|
5ef42aa075b048592c6e22417dab5d07f78a7c13914fa1aa9e9c47f53b71bbbf27d3982201a74816b1347cd123048dd669b7c8da4ad4e481d915f67a3ae0f754 0027-ada-musl-support-fixes.patch
|
|
9fbcb2addffa042e4791b715e156402d03b8f3703356d0b9570526df7b5b311595c1b772e5295328f56e05efc7f99e22f5e5b48c5ffb9bf71ebc56afe5321d11 0028-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch
|
|
88aa25ead0706b775a4ab4d31a2319cfdbb094490798f87f8272a74228683d6a295b42f9af7c57a646ea17b8d393e8b2e52bb57d10e0527c3fbfcad6e1c5e159 0029-gcc-go-Don-t-include-sys-user.h.patch
|
|
9f38276188ae56d037b99df4a068fc71c94b5d17341d4131ef1252c42352a5029768ffdb4a8d12ef92bfd30b5d5f7a3c440ed91d334c85dc66b837d6d23897a9 0030-gcc-go-Fix-ucontext_t-on-PPC64.patch
|
|
de6fac26c37ee3d5e55129620f6793d80e74db1d922e545591d3d2a1eabb0cd9a6f2f918800a1177a79a9aaea49263ee7b126ccd1a05ecab3f90304f1ce4db68 0031-gcc-go-Fix-handling-of-signal-34-on-musl.patch
|
|
0c48d1acca7f33e796de0bd520f727ccc498530c86aa56e1bb1ceb68f2b751f2b265a5cd86ce142213906a4fbc4667e3d5bad07fb8613989ed6a77a7aaa11a29 0032-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
|
|
bebd27d21d8b64011b3752fdc9ca03ebcda52ba452aae074a484ed204eac6056ac8ea46cb4413de810e0c3df05a4ccfbb2033582497426447f9c06bd784fbc56 0033-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch
|
|
dfec489d78a0921cdd9a6a1b35a14566f565413e2f4f0467db37f0650e28be9482111bdfe93274280594ddac9c5ef7f50a9d0443c4f9393f71ef7195d1dd8166 0034-gcc-go-signal-34-is-special-on-musl-libc.patch
|
|
89ac788b3a49ce46cf852e5396c9bac99155059700a07736794773291e43dd07c3693999e115e683fc6df110b2081c6d93226b31cced0eff905b58855ff986ce 0035-gcc-go-Prefer-_off_t-over-_off64_t.patch
|
|
1473f977f2fc259a8d7abc29d554b0b44fb7d65b5e5cdddf1601505ba2cb3aa2f86e13691e8bdbe2f93c7ae866a6702ef7764adff8c535ccf2f6abf6f2e377dc 0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
|
|
89c40e32ec0f02d294f4bc576c652b976d63ff8ab4dca9f3a7533bca40e3c267e8a4b02ff5099bf7534174d68e21044c38a9141cc7a9399573bab6fc4fb7ac8d 0037-gcc-go-link-to-libucontext.patch
|
|
2742b50a629835577de5f3ac4a764770fd7a6f42e0e0da5d35673cecf4d24a2d1d4227f3f03745001947c5b69dae72fe0584941257333f916c4db3d240bcbbfa 0038-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch
|
|
70987dea8cbee832660d8a27e3ebf7b072974e6e8f5112c1365a6a4c84830bdff8342c7a4933486f5f4becabb81a89c46e3c3cde5602e172206c59965cdd5f3f 0039-CRuntime_Musl-Support-v1.2.0-for-32-bits.patch
|
|
3963bac9cd0f8c442599a5e983f033798266e20e9f7ba72c023724e0917a0ae750856d15e0e9a527f6f60e735ddfa66f8f3e300de47e54cad6c440ddc0403081 0040-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
|
|
9f82ce02f355ae38952d17512fc962886f485e06d9ae2ef57f13ccc3f7b298d7e9921f8867b86d7d1fee442df887ba4ee3983521bfa91248872110a1b6c070aa 0041-Use-generic-errstr.go-implementation-on-musl.patch
|
|
40168210e381c329a7ff3e332dedadfa0c60e9da3251c29e660aeeae478da5c5988dc9144a9e6be178202d1d15e2dfa273f5034a861054786ef7cfd4f56c2745 0042-configure-fix-detection-of-atomic-builtins-in-libato.patch
|
|
"
|