1 # Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
2 # Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
3 # Contributor: Martin Schmölzer <mschmoelzer@gmail.com>
10 pkgdesc='The GNU Compiler Collection - cross compiler for Andes 32 little-endian (bare-metal) target'
12 url='https://gcc.gnu.org/'
13 license=(GPL LGPL FDL)
14 depends=($_target-binutils zlib libmpc libisl zstd)
15 makedepends=(gmp mpfr $_target-newlib)
16 optdepends=("$_target-newlib: Standard C library optimized for embedded systems")
17 options=(!emptydirs !strip !lto)
18 source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}
19 #ftp://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.xz
21 sha512sums=('e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173'
23 validpgpkeys=(D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62 # Jakub Jelinek <jakub@redhat.com>
24 13975A70E63C361C73AE69EF6EEB81F8981C74C7) # Richard Guenther <richard.guenther@gmail.com>
26 if [ -n "$_snapshot" ]; then
27 _basedir=gcc-$_snapshot
37 echo $pkgver > gcc/BASE-VER
43 CFLAGS=${CFLAGS/-Werror=format-security/}
44 CXXFLAGS=${CXXFLAGS/-Werror=format-security/}
46 export CFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'
47 export CXXFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'
49 "$srcdir"/$_basedir/configure \
52 --with-sysroot=/usr/$_target \
53 --with-native-system-header-dir=/include \
54 --libexecdir=/usr/lib \
55 --enable-languages=c,c++ \
56 --enable-threads=single \
61 --disable-libquadmath \
64 --disable-libmudflap \
65 --disable-decimal-float \
66 --disable-libstdcxx-pch \
74 --with-headers=/usr/$_target/include \
75 --with-python-dir=share/gcc-$_target \
81 --enable-gnu-indirect-function \
82 --with-pkgversion="Arch Linux Repositories" \
83 --with-bugurl='https://bugs.archlinux.org/'
91 make DESTDIR="$pkgdir" install -j1
93 # strip target binaries
94 find "$pkgdir"/usr/lib/gcc/$_target/$pkgver "$pkgdir"/usr/$_target/lib \
95 -type f -and \( -name \*.a -or -name \*.o \) \
96 -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges \
97 -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \
98 -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
100 # strip host binaries
101 find "$pkgdir"/usr/bin/ "$pkgdir"/usr/lib/gcc/$_target/$pkgver -type f -and \( -executable \) -exec strip '{}' \;
103 # Remove files that conflict with host gcc package
104 rm -r "$pkgdir"/usr/share/man/man7
105 rm -r "$pkgdir"/usr/share/info
106 rm "$pkgdir"/usr/lib/libcc1.*