1 # Maintainer: Filipe LaĆns (FFY00) <lains@archlinux.org>
2 # Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
5 pkgname=$_target-gcc-bootstrap
9 pkgdesc='The GNU Compiler Collection - cross compiler for RISCV32 target - bootstrap version. only used to build initial libc and compiler'
11 url='http://gcc.gnu.org/'
12 license=(GPL LGPL FDL)
13 depends=($_target-binutils libmpc zlib)
14 makedepends=(gmp mpfr)
15 options=(!emptydirs !strip)
16 provides=(${pkgname%-bootstrap})
17 conflicts=(${pkgname%-bootstrap})
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
20 http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
21 sha512sums=('4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de'
23 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
24 validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.org
25 13975A70E63C361C73AE69EF6EEB81F8981C74C7 # richard.guenther@gmail.com
26 33C235A34C46AA3FFB293709A328C3A2C3C45C06) # Jakub Jelinek <jakub@redhat.com>
29 if [ -n "$_snapshot" ]; then
30 _basedir=gcc-$_snapshot
38 # link isl for in-tree builds
39 ln -sf ../isl-$_islver isl
41 echo $pkgver > gcc/BASE-VER
43 # Do not run fixincludes
44 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
46 # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
47 sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
49 rm -rf "$srcdir"/gcc-build
50 mkdir -p "$srcdir"/gcc-build
56 # using -pipe causes spurious test-suite failures
57 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
58 CFLAGS=${CFLAGS/-pipe/}
59 CXXFLAGS=${CXXFLAGS/-pipe/}
61 "$srcdir"/$_basedir/configure \
65 --libexecdir=/usr/lib \
66 --program-prefix=$_target- \
67 --with-local-prefix=/usr/$_target \
68 --with-build-sysroot=/usr/$_target \
69 --with-sysroot=/usr/$_target \
76 --enable-languages=c \
78 --disable-libmudflap \
80 --disable-libquadmath \
85 --enable-checking=release
87 make inhibit-libc=true all-gcc
88 make inhibit-libc=true all-target-libgcc
94 make DESTDIR="$pkgdir" inhibit-libc=true install-gcc
95 make DESTDIR="$pkgdir" inhibit-libc=true install-target-libgcc
97 # strip target binaries
98 find "$pkgdir"/usr/lib/gcc/$_target/ \
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/ -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