Commit 587c2cf3 authored by Anatol Pomozov's avatar Anatol Pomozov
Browse files

Move ARM64 cross compiler from AUR

parents
# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
_target=aarch64-linux-gnu
pkgname=$_target-gcc
pkgver=6.1.1
_islver=0.17.1
pkgrel=3
_snapshot=6-20161110
pkgdesc='The GNU Compiler Collection - cross compiler for ARM64 target'
arch=(i686 x86_64)
url='http://gcc.gnu.org/'
license=(GPL LGPL FDL)
depends=($_target-binutils $_target-glibc libmpc zlib)
makedepends=(gmp mpfr)
options=(!emptydirs !strip staticlibs)
source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2
ftp://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.bz2
http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
sha256sums=('3ba28d28dc5d66c14313b16ddcf6e9d1c52cde5945d4b8931053ca836077adf7'
'd6307bf9a59514087abac3cbaab3d99393a0abb519354f7e7834a8c842310daa')
if [ -n "$_snapshot" ]; then
_basedir=gcc-$_snapshot
else
_basedir=gcc-$pkgver
fi
prepare() {
cd $_basedir
# link isl for in-tree builds
ln -sf ../isl-$_islver isl
echo $pkgver > gcc/BASE-VER
# hack! - some configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
rm -rf $srcdir/gcc-build
mkdir $srcdir/gcc-build
}
build() {
cd gcc-build
export CFLAGS_FOR_TARGET='-O2 -pipe'
# unfortunately CXXFLAGS_FOR_TARGET is not honored https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53579
#export CXXFLAGS_FOR_TARGET='-O2 -pipe'
export CXXFLAGS='-O2 -pipe'
$srcdir/$_basedir/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--target=$_target \
--enable-shared \
--disable-nls \
--enable-threads=posix \
--enable-languages=c,c++ \
--enable-multilib \
--disable-libssp \
--disable-libquadmath \
--with-system-zlib \
--with-sysroot=/usr/$_target \
--with-build-sysroot=/usr/$_target \
--with-as=/usr/bin/$_target-as \
--with-ld=/usr/bin/$_target-ld \
--disable-libgomp \
--enable-__cxa_atexit \
--enable-addons \
--with-libelf \
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \
--with-gmp \
--with-mpfr \
--with-mpc \
--with-isl \
--enable-gnu-indirect-function
make
}
package() {
cd gcc-build
make DESTDIR="$pkgdir" install
# strip target binaries
find "$pkgdir"/usr/lib/gcc/$_target/ "$pkgdir"/usr/$_target/lib -type f -and \( -name \*.a -or -name \*.o \) -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
# strip host binaries
find "$pkgdir"/usr/bin/ "$pkgdir"/usr/lib/gcc/$_target/ -type f -and \( -executable \) -exec strip '{}' \;
# Remove files that conflict with host gcc package
rm -r "$pkgdir"/usr/share/man/man7
rm -r "$pkgdir"/usr/share/info
rm -r "$pkgdir"/usr/share/gcc-$pkgver
rm "$pkgdir"/usr/lib/libcc1.*
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment