PKGBUILD 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Maintainer: Parabola Hackers <dev@lists.parabola.nu>
  2. _target=aarch64-linux-gnu
  3. pkgname=$_target-gcc
  4. _pkgver=9.3.0
  5. pkgver=$_pkgver
  6. _islver=0.22
  7. pkgrel=1
  8. pkgdesc='The GNU Compiler Collection - cross compiler for aarch64 target'
  9. arch=(x86_64 i686 armv7h)
  10. url='http://gcc.gnu.org/'
  11. license=(GPL LGPL FDL)
  12. depends=($_target-binutils libmpc zlib)
  13. makedepends=(gmp mpfr)
  14. makedepends+=("${pkgname}-initial")
  15. options=(!emptydirs !strip)
  16. source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}
  17. http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
  18. sha512sums=('4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de'
  19. 'SKIP'
  20. 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
  21. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06) # Jakub Jelinek <jakub@redhat.com>
  22. if [ -n "$_snapshot" ]; then
  23. _basedir=gcc-$_snapshot
  24. else
  25. _basedir=gcc-$_pkgver
  26. fi
  27. prepare() {
  28. cd $_basedir
  29. # link isl for in-tree builds
  30. ln -sf ../isl-$_islver isl
  31. echo $_pkgver > gcc/BASE-VER
  32. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  33. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
  34. mkdir $srcdir/gcc-build
  35. }
  36. build() {
  37. cd gcc-build
  38. # using -pipe causes spurious test-suite failures
  39. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  40. CFLAGS=${CFLAGS/-pipe/}
  41. CXXFLAGS=${CXXFLAGS/-pipe/}
  42. $srcdir/$_basedir/configure \
  43. --target=$_target \
  44. --prefix=/usr \
  45. --libexecdir=/usr/lib \
  46. --enable-languages=c,c++ \
  47. --enable-plugins \
  48. --enable-shared \
  49. --disable-decimal-float \
  50. --disable-libffi \
  51. --disable-libgomp \
  52. --disable-libmudflap \
  53. --disable-libquadmath \
  54. --disable-libssp \
  55. --disable-libstdcxx-pch \
  56. --disable-nls \
  57. --disable-threads \
  58. --disable-tls \
  59. --disable-multilib \
  60. --with-gnu-as \
  61. --with-gnu-ld \
  62. --with-system-zlib \
  63. --with-gmp \
  64. --with-mpfr \
  65. --with-mpc \
  66. --with-isl \
  67. --with-libelf \
  68. --enable-gnu-indirect-function
  69. make $MAKEFLAGS
  70. }
  71. package() {
  72. cd gcc-build
  73. make DESTDIR="$pkgdir" install
  74. # strip target binaries
  75. find "$pkgdir"/usr/lib/gcc/$_target/$_pkgver "$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 '{}' \;
  76. # strip host binaries
  77. find "$pkgdir"/usr/bin/ "$pkgdir"/usr/lib/gcc/$_target/$_pkgver -type f -and \( -executable \) -exec strip '{}' \;
  78. # Remove files that conflict with host gcc package
  79. rm -r "$pkgdir"/usr/share/man/man7
  80. rm -r "$pkgdir"/usr/share/info
  81. rm "$pkgdir"/usr/lib/libcc1.*
  82. }