summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f02bf6a4a6c1ec1a4d62c44768ce301eaaf99bf7 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Maintainer: Andrew Whatson <https://aur.archlinux.org/account/flatwhatson>
# Maintainer: ZenTauro <zentauro at riseup dot net>
# Contributor: Ruben De Smet <ruben dot de dot smet at glycos dot org>
# Contributor: Jashandeep Sohi <jashandeep.s.sohi@gmail.com>

pkgname=libgccjit
pkgver=11.1.0
pkgrel=1
pkgdesc='Just-In-Time Compilation using GCC.'
arch=(x86_64)
license=(GPL3)
url='https://gcc.gnu.org/wiki/JIT'
makedepends=(binutils libmpc)
checkdepends=(dejagnu)
depends=(glibc libmpc "gcc-libs=$pkgver")
options=(!emptydirs)
source=(https://sourceware.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz{,.sig})
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9  # bpiotrowski@archlinux.org
              86CFFCA918CF3AF47147588051E8B148A9999C34  # evangelos@foutrelis.com
              13975A70E63C361C73AE69EF6EEB81F8981C74C7  # richard.guenther@gmail.com
              D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62) # Jakub Jelinek <jakub@redhat.com>
sha256sums=('4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf'
            'SKIP')

prepare() {
 cd "$srcdir/gcc-$pkgver"

 # Do not run fixincludes
 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

 # Arch Linux installs x86_64 libraries /lib
 sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64

 # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
 sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
}

build() {
 mkdir -p "$srcdir/$pkgname-build"
 cd "$srcdir/$pkgname-build"

 CFLAGS=${CFLAGS/-Werror=format-security/}
 CXXFLAGS=${CXXFLAGS/-Werror=format-security/}

 "$srcdir/gcc-$pkgver/configure" --prefix=/usr \
     --libdir=/usr/lib \
     --libexecdir=/usr/lib \
     --mandir=/usr/share/man \
     --infodir=/usr/share/info \
     --with-bugurl=https://aur.archlinux.org/packages/libgccjit/ \
     --enable-languages=jit \
     --with-linker-hash-style=gnu \
     --with-system-zlib \
     --enable-__cxa_atexit \
     --enable-cet=auto \
     --enable-checking=release \
     --enable-clocale=gnu \
     --enable-default-pie \
     --enable-default-ssp \
     --enable-gnu-indirect-function \
     --enable-gnu-unique-object \
     --enable-install-libiberty \
     --enable-linker-build-id \
     --enable-lto \
     --enable-multilib \
     --enable-plugin \
     --enable-shared \
     --enable-host-shared \
     --enable-threads=posix \
     --disable-bootstrap \
     --disable-multilib \
     --disable-libssp \
     --disable-lto \
     --disable-libquadmath \
     --disable-liboffloadmic \
     --disable-libada \
     --disable-libsanitizer \
     --disable-libquadmath-support \
     --disable-libgomp \
     --disable-libvtv \
     --disable-libsanitizer \
     --disable-libstdcxx-pch \
     --disable-libunwind-exceptions \
     --disable-werror

 make
}

package() {
 cd "$srcdir/$pkgname-build/gcc"
 make DESTDIR="$pkgdir" jit.install-common jit.install-info
}

check() {
 cd "$srcdir/$pkgname-build/gcc"
 make check-jit RUNTESTFLAGS="-v -v -v"
}

post_install() {
 [[ -x usr/bin/install-info ]] || return 0
 install-info usr/share/info/libgccjit.info.gz usr/share/info/dir 2> /dev/null
}

# vim: tabstop=1 expandtab