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>
11 pkgdesc='The GNU Compiler Collection - cross compiler for RISCV32 (bare-metal) target'
13 url='https://gcc.gnu.org/'
14 license=(GPL LGPL FDL)
15 depends=($_target-binutils zlib libmpc)
16 makedepends=(gmp mpfr $_target-newlib)
17 optdepends=("$_target-newlib: Standard C library optimized for embedded systems")
18 options=(!emptydirs !strip)
19 source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}
20 #ftp://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.xz
21 http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
22 sha512sums=('4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de'
24 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
25 validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06) # Jakub Jelinek <jakub@redhat.com>
27 if [ -n "$_snapshot" ]; then
28 _basedir=gcc-$_snapshot
38 # link isl for in-tree builds
39 ln -s ../isl-$_islver isl
41 echo $pkgver > gcc/BASE-VER
43 # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
44 sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
50 export CFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'
51 export CXXFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'
53 "$srcdir"/$_basedir/configure \
56 --with-sysroot=/usr/$_target \
57 --with-native-system-header-dir=/include \
58 --libexecdir=/usr/lib \
59 --enable-languages=c,c++ \
60 --enable-threads=single \
65 --disable-libquadmath \
68 --disable-libmudflap \
69 --disable-decimal-float \
70 --disable-libstdcxx-pch \
78 --with-headers=/usr/$_target/include \
79 --with-python-dir=share/gcc-$_target \
85 --enable-gnu-indirect-function \
86 --with-pkgversion="Arch Linux Repositories" \
87 --with-bugurl='https://bugs.archlinux.org/'
95 make DESTDIR="$pkgdir" install -j1
97 # strip target binaries
98 find "$pkgdir"/usr/lib/gcc/$_target/$pkgver "$pkgdir"/usr/$_target/lib \
99 -type f -and \( -name \*.a -or -name \*.o \) \
100 -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges \
101 -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \
102 -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
104 # strip host binaries
105 find "$pkgdir"/usr/bin/ "$pkgdir"/usr/lib/gcc/$_target/$pkgver -type f -and \( -executable \) -exec strip '{}' \;
107 # Remove files that conflict with host gcc package
108 rm -r "$pkgdir"/usr/share/man/man7
109 rm -r "$pkgdir"/usr/share/info
110 rm "$pkgdir"/usr/lib/libcc1.*