summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: ed20e12059ebe98add3b1db71758597283da6eea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Maintainer: Finlay Maroney <finman292004@protonmail.com>

_target=i686-elf
pkgname=$_target-gcc
pkgver=12.1.0
pkgrel=1
pkgdesc='The GNU Compiler Collection - cross compiler for i686-elf target'
arch=(i686 x86_64)
url='http://gcc.gnu.org/'
license=(GPL LGPL)
depends=($_target-binutils zlib libmpc mpfr gmp)
options=(!emptydirs)
source=("https://mirrors.kernel.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz"
        "libiberty-ignore-cflags.patch"
        "https://mirrors.kernel.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz.sig")
sha256sums=('62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b'
            '8b2aea00e98f7c311b1d0fb14e4b435a03c65fde32bc992c924edb6fa7b83c9c'
            'SKIP')
_basedir=gcc-$pkgver
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9  # bpiotrowski@archlinux.org
              86CFFCA918CF3AF47147588051E8B148A9999C34  # evangelos@foutrelis.com
              13975A70E63C361C73AE69EF6EEB81F8981C74C7  # richard.guenther@gmail.com
              D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62) # Jakub Jelinek <jakub@redhat.com>
prepare() {
  cd $_basedir
 
  patch -p1 -i $srcdir/libiberty-ignore-cflags.patch

  mkdir $srcdir/gcc-build
}

build() {
  cd gcc-build

  $srcdir/$_basedir/configure \
    --target=$_target \
    --prefix=/usr \
    --disable-nls \
    --disable-plugin \
    --enable-languages=c,c++ \
    --without-headers

  make all-gcc
  make all-target-libgcc
}

check() {
  cd gcc-build

  # increase stack size to prevent test failures
  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
  ulimit -s 32768

  # do not abort on error as some are "expected"
  make -k check || true
  $srcdir/$_basedir/contrib/test_summary
}

package() {
  cd gcc-build

  make DESTDIR="$pkgdir" install-gcc
  make DESTDIR="$pkgdir" install-target-libgcc

  # Remove files that conflict with host gcc package
  rm -r "$pkgdir"/usr/share/man/man7
  rm -r "$pkgdir"/usr/share/info
}