2018-08-14 22:28:55 +02:00
|
|
|
VERSION="8.2.0"
|
2017-12-09 21:51:48 +01:00
|
|
|
SRCDIR="gcc-$VERSION"
|
|
|
|
TARBALL="gcc-$VERSION.tar.xz"
|
|
|
|
URL="http://ftp.gnu.org/gnu/gcc/gcc-$VERSION"
|
2018-08-14 22:28:55 +02:00
|
|
|
SHA256SUM="196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080"
|
2019-02-27 14:22:03 +01:00
|
|
|
DEPENDS="tc-binutils tc-cloog tc-gmp tc-isl tc-mpc tc-mpfr linux-dev fortify-headers"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
prepare() {
|
2018-10-17 00:39:37 +02:00
|
|
|
apply_patches
|
|
|
|
|
2018-09-28 23:34:05 +02:00
|
|
|
#
|
|
|
|
# XXX: if you ever add support for another 64 bit processor,
|
|
|
|
# you need to patch this.
|
|
|
|
#
|
|
|
|
# Fixup multilib configuration to install libraries
|
|
|
|
# into /lib instead of /lib64
|
|
|
|
#
|
|
|
|
for subdir in "i386/t-linux64" "aarch64/t-aarch64-linux"; do
|
2018-10-21 17:31:25 +02:00
|
|
|
sed -e 's/lib64/lib/g' \
|
2018-09-28 23:34:05 +02:00
|
|
|
-i "$PKGSRCDIR/$SRCDIR/gcc/config/$subdir"
|
|
|
|
done
|
|
|
|
|
2017-12-09 21:51:48 +01:00
|
|
|
for child in cloog gmp isl mpc mpfr; do
|
2018-02-19 12:55:59 +01:00
|
|
|
include_pkg "tc-$child"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
if [ ! -e "$child" ]; then
|
|
|
|
echo "installing symlink to $child..."
|
|
|
|
ln -s "$PKGSRCDIR/$SRCDIR" "$child"
|
|
|
|
else
|
|
|
|
if [ ! -L "$child" ]; then
|
|
|
|
echo "ERROR: $child " \
|
|
|
|
"exists but is not a symlink!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2018-10-20 12:52:06 +02:00
|
|
|
local extra="--disable-libssp"
|
2018-10-19 13:02:06 +02:00
|
|
|
|
|
|
|
if [ "x$TC_HARDENING" = "xyes" ]; then
|
2018-10-20 12:52:06 +02:00
|
|
|
extra="$extra --enable-default-pie"
|
2018-10-19 13:02:06 +02:00
|
|
|
extra="$extra --enable-default-ssp"
|
|
|
|
fi
|
|
|
|
|
2018-02-16 23:22:04 +01:00
|
|
|
$1/configure --prefix="$TCDIR" --target="$TARGET" \
|
|
|
|
--build="$HOSTTUPLE" --host="$HOSTTUPLE" \
|
|
|
|
--with-sysroot="$TCDIR/$TARGET" \
|
|
|
|
--disable-nls --disable-shared --without-headers \
|
|
|
|
--disable-multilib --disable-decimal-float \
|
|
|
|
--disable-libgomp --disable-libmudflap \
|
2018-10-19 13:02:06 +02:00
|
|
|
--disable-libatomic \
|
2018-02-16 23:22:04 +01:00
|
|
|
--disable-libquadmath --disable-threads \
|
|
|
|
--enable-languages=c --with-newlib \
|
2019-03-03 15:51:22 +01:00
|
|
|
--with-as="$TCDIR/bin/$TARGET-as" \
|
|
|
|
--with-ld="$TCDIR/bin/$TARGET-ld" \
|
2018-10-19 13:02:06 +02:00
|
|
|
--with-arch="$GCC_CPU" $extra $GCC_EXTRACFG
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
make -j $NUMJOBS all-gcc all-target-libgcc
|
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
|
|
|
make install-gcc install-target-libgcc
|
2019-02-08 00:24:54 +01:00
|
|
|
|
2019-03-06 10:03:12 +01:00
|
|
|
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
|
|
|
cat > "$PKGDEPLOYDIR/$PKGNAME.desc" <<_EOF
|
2019-03-03 11:25:03 +01:00
|
|
|
requires tc-binutils linux-dev fortify-headers
|
2019-02-08 00:24:54 +01:00
|
|
|
_EOF
|
2017-12-09 21:51:48 +01:00
|
|
|
}
|
2018-05-06 17:23:31 +02:00
|
|
|
|
|
|
|
check_update() {
|
|
|
|
curl --silent -L "http://ftp.gnu.org/gnu/gcc" | \
|
|
|
|
grep -o ">gcc-[0-9.]*/<" | \
|
|
|
|
sed 's/>gcc-//g' | sed 's/\/<//g' | \
|
|
|
|
verson_find_greatest "$VERSION"
|
2018-09-28 23:34:05 +02:00
|
|
|
}
|