PKGBUILD 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. # $Id$
  2. # Maintainer: Luke R. <g4jc@openmailbox.org> GPG: rsa4096/3EAE8697
  3. # Maintainer (Arch): Allan McRae <allan@archlinux.org>
  4. # toolchain build order: linux-libre-api-headers->glibc->binutils->gcc->binutils->glibc
  5. # NOTE: libtool requires rebuilt with each new gcc version
  6. pkgname=('gcc-multilib' 'gcc-libs-multilib' 'lib32-gcc-libs' 'gcc-fortran-multilib' 'gcc-objc-multilib' 'gcc-ada-multilib' 'gcc-go-multilib')
  7. pkgver=6.3.1
  8. gccver=6.3.0
  9. _pkgver=6
  10. _islver=0.16
  11. pkgrel=1.90.parabola1
  12. pkgdesc="The GNU Compiler Collection"
  13. arch=('i686' 'x86_64')
  14. license=('GPL' 'LGPL' 'FDL' 'custom')
  15. url="https://gcc.gnu.org"
  16. makedepends=('binutils>=2.27' 'libmpc' 'gcc-ada-multilib' 'doxygen' 'git'
  17. 'lib32-glibc>=2.24')
  18. checkdepends=('dejagnu' 'inetutils')
  19. options=('!emptydirs')
  20. source=("https://ftp.gnu.org/gnu/gcc/gcc-$gccver/gcc-$gccver.tar.bz2"{,.sig}
  21. "http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2")
  22. validpgpkeys=('33C235A34C46AA3FFB293709A328C3A2C3C45C06') # Jakub Jelinek <jakub@redhat.com> # Note: (Weak DSA) :(
  23. sha512sums=('234dd9b1bdc9a9c6e352216a7ef4ccadc6c07f156006a59759c5e0e6a69f0abcdc14630eff11e3826dd6ba5933a8faa43043f3d1d62df6bd5ab1e82862f9bf78'
  24. '0c222c7abd96421bd4de7ed9496248e2c94dda5178481b35d90a6ba88c4b46005976253b4978cf7dac01b352d855a975028609301ef2c935c5d6204506cbb6ae'
  25. '680da559a37e377c494d9688577159c5c6552c38bf60986c982df8144f3ef60785d530f7223a553c8446bac0c05fd52398e946b1419fbcf511e06316a8fd2d18')
  26. # CHOST is in the form <architecture>-<vendor>-<operatingSystem>-<cLibrary>
  27. # Arch currently reports CHOST with vendor "unknown". GCC expected this until recently, when for architecture x86_64 it now expects "pc".
  28. _CHOST=${CHOST}
  29. if [[ "${CHOST}" == 'x86_64-unknown-linux-gnu' ]]; then
  30. _CHOST='x86_64-pc-linux-gnu'
  31. fi
  32. _libdir="usr/lib/gcc/$_CHOST/32/$gccver"
  33. prepare() {
  34. cd ${srcdir}/gcc-$gccver
  35. # link isl for in-tree build
  36. ln -s ../isl-${_islver} isl
  37. # Do not run fixincludes
  38. sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
  39. # Arch Linux installs x86_64 libraries /lib
  40. [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
  41. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  42. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
  43. mkdir ${srcdir}/gcc-build
  44. }
  45. build() {
  46. cd ${srcdir}/gcc-build
  47. # using -pipe causes spurious test-suite failures
  48. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  49. CFLAGS=${CFLAGS/-pipe/}
  50. CXXFLAGS=${CXXFLAGS/-pipe/}
  51. ${srcdir}/gcc-$gccver/configure --prefix=/usr \
  52. --libdir=/usr/lib \
  53. --libexecdir=/usr/lib \
  54. --mandir=/usr/share/man \
  55. --infodir=/usr/share/info \
  56. --with-bugurl=https://bugs.archlinux.org/ \
  57. --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ \
  58. --enable-shared \
  59. --enable-threads=posix \
  60. --enable-libmpx \
  61. --with-system-zlib \
  62. --with-isl \
  63. --enable-__cxa_atexit \
  64. --disable-libunwind-exceptions \
  65. --enable-clocale=gnu \
  66. --disable-libstdcxx-pch \
  67. --disable-libssp \
  68. --enable-gnu-unique-object \
  69. --enable-linker-build-id \
  70. --enable-lto \
  71. --enable-plugin \
  72. --enable-install-libiberty \
  73. --with-linker-hash-style=gnu \
  74. --enable-gnu-indirect-function \
  75. --enable-default-pie \
  76. --enable-multilib \
  77. --disable-werror \
  78. --enable-checking=release
  79. make
  80. # make documentation
  81. make -C $_CHOST/libstdc++-v3/doc doc-man-doxygen
  82. }
  83. check() {
  84. cd ${srcdir}/gcc-build
  85. # increase stack size to prevent test failures
  86. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
  87. ulimit -s 32768
  88. # do not abort on error as some are "expected"
  89. make -k check || true
  90. ${srcdir}/gcc-$gccver/contrib/test_summary
  91. }
  92. package_lib32-gcc-libs()
  93. {
  94. pkgdesc="Runtime libraries shipped by GCC (32-bit)"
  95. depends=('lib32-glibc>=2.24')
  96. options=('!emptydirs' '!strip')
  97. cd ${srcdir}/gcc-build
  98. make -C $_CHOST/32/libgcc DESTDIR=${pkgdir} install-shared
  99. rm ${pkgdir}/${_libdir}/32/libgcc_eh.a
  100. for lib in libatomic \
  101. libcilkrts \
  102. libgfortran \
  103. libgo \
  104. libgomp \
  105. libitm \
  106. libquadmath \
  107. libsanitizer/{a,l,ub}san \
  108. libstdc++-v3/src \
  109. libvtv; do
  110. make -C $_CHOST/32/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES
  111. done
  112. make -C $_CHOST/32/libobjc DESTDIR=${pkgdir} install-libs
  113. make -C $_CHOST/32/libmpx DESTDIR=${pkgdir} install
  114. rm ${pkgdir}/usr/lib32/libmpx.spec
  115. # remove stuff in gcc-libs-multilib
  116. rm -r ${pkgdir}/usr/lib
  117. # Install Runtime Library Exception
  118. install -Dm644 ${srcdir}/gcc/COPYING.RUNTIME \
  119. ${pkgdir}/usr/share/licenses/lib32-gcc-libs/RUNTIME.LIBRARY.EXCEPTION
  120. }
  121. package_gcc-libs-multilib()
  122. {
  123. pkgdesc="Runtime libraries shipped by GCC for multilib"
  124. depends=('glibc>=2.24' "lib32-gcc-libs=$gccver-$pkgrel")
  125. provides=("gcc-libs=$gccver-$pkgrel")
  126. conflicts=('gcc-libs')
  127. options=('!emptydirs' '!strip')
  128. cd ${srcdir}/gcc-build
  129. make -C $_CHOST/libgcc DESTDIR=${pkgdir} install-shared
  130. rm ${pkgdir}/${_libdir}/libgcc_eh.a
  131. for lib in libatomic \
  132. libcilkrts \
  133. libgfortran \
  134. libgo \
  135. libgomp \
  136. libitm \
  137. libquadmath \
  138. libsanitizer/{a,l,ub}san \
  139. libstdc++-v3/src \
  140. libvtv; do
  141. make -C $_CHOST/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES
  142. done
  143. [[ $CARCH == "x86_64" ]] && \
  144. make -C $_CHOST/libsanitizer/tsan DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES
  145. make -C $_CHOST/libobjc DESTDIR=${pkgdir} install-libs
  146. make -C $_CHOST/libstdc++-v3/po DESTDIR=${pkgdir} install
  147. make -C $_CHOST/libmpx DESTDIR=${pkgdir} install
  148. rm ${pkgdir}/usr/lib/libmpx.spec
  149. for lib in libgomp \
  150. libitm \
  151. libquadmath; do
  152. make -C $_CHOST/$lib DESTDIR=${pkgdir} install-info
  153. done
  154. # remove stuff in lib32-gcc-libs
  155. rm -r ${pkgdir}/usr/lib32
  156. # Install Runtime Library Exception
  157. install -Dm644 ${srcdir}/gcc-$gccver/COPYING.RUNTIME \
  158. ${pkgdir}/usr/share/licenses/gcc-libs-multilib/RUNTIME.LIBRARY.EXCEPTION
  159. }
  160. package_gcc-multilib()
  161. {
  162. pkgdesc="The GNU Compiler Collection - C and C++ frontends for multilib"
  163. depends=("gcc-libs-multilib=$gccver-$pkgrel" 'binutils>=2.26' 'libmpc')
  164. groups=('multilib-devel')
  165. options=('staticlibs')
  166. provides=("gcc=$gccver-$pkgrel")
  167. conflicts=('gcc')
  168. cd ${srcdir}/gcc-build
  169. make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \
  170. c++.install-common install-headers install-plugin install-lto-wrapper
  171. install -m755 -t $pkgdir/usr/bin/ gcc/gcov{,-tool}
  172. install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1}
  173. make -C $_CHOST/libgcc DESTDIR=${pkgdir} install
  174. make -C $_CHOST/32/libgcc DESTDIR=${pkgdir} install
  175. rm ${pkgdir}/usr/lib{,32}/libgcc_s.so*
  176. make -C $_CHOST/libstdc++-v3/src DESTDIR=${pkgdir} install
  177. make -C $_CHOST/libstdc++-v3/include DESTDIR=${pkgdir} install
  178. make -C $_CHOST/libstdc++-v3/libsupc++ DESTDIR=${pkgdir} install
  179. make -C $_CHOST/libstdc++-v3/python DESTDIR=${pkgdir} install
  180. make -C $_CHOST/32/libstdc++-v3/src DESTDIR=${pkgdir} install
  181. make -C $_CHOST/32/libstdc++-v3/include DESTDIR=${pkgdir} install
  182. make -C $_CHOST/32/libstdc++-v3/libsupc++ DESTDIR=${pkgdir} install
  183. make DESTDIR=${pkgdir} install-libcc1
  184. install -d $pkgdir/usr/share/gdb/auto-load/usr/lib
  185. mv $pkgdir/usr/lib/libstdc++.so.6.*-gdb.py \
  186. $pkgdir/usr/share/gdb/auto-load/usr/lib/
  187. rm ${pkgdir}/usr/lib{,32}/libstdc++.so*
  188. make DESTDIR=${pkgdir} install-fixincludes
  189. make -C gcc DESTDIR=${pkgdir} install-mkheaders
  190. make -C lto-plugin DESTDIR=${pkgdir} install
  191. install -dm755 ${pkgdir}/usr/lib/bfd-plugins/
  192. ln -s /usr/lib/gcc/$_CHOST/${pkgver}/liblto_plugin.so \
  193. ${pkgdir}/usr/lib/bfd-plugins/
  194. make -C $_CHOST/libcilkrts DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS \
  195. install-nodist_cilkincludeHEADERS
  196. make -C $_CHOST/libgomp DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS \
  197. install-nodist_libsubincludeHEADERS
  198. make -C $_CHOST/libitm DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  199. make -C $_CHOST/libquadmath DESTDIR=${pkgdir} install-nodist_libsubincludeHEADERS
  200. make -C $_CHOST/libsanitizer DESTDIR=${pkgdir} install-nodist_{saninclude,toolexeclib}HEADERS
  201. make -C $_CHOST/libsanitizer/asan DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  202. make -C $_CHOST/libmpx DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  203. make -C $_CHOST/32/libcilkrts DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  204. make -C $_CHOST/32/libgomp DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  205. make -C $_CHOST/32/libitm DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  206. make -C $_CHOST/32/libsanitizer DESTDIR=${pkgdir} install-nodist_{saninclude,toolexeclib}HEADERS
  207. make -C $_CHOST/32/libsanitizer/asan DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  208. make -C $_CHOST/32/libmpx DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
  209. make -C libiberty DESTDIR=${pkgdir} install
  210. # install PIC version of libiberty
  211. install -m644 ${srcdir}/gcc-build/libiberty/pic/libiberty.a ${pkgdir}/usr/lib
  212. make -C gcc DESTDIR=${pkgdir} install-man install-info
  213. rm ${pkgdir}/usr/share/man/man1/{gccgo,gfortran}.1
  214. rm ${pkgdir}/usr/share/info/{gccgo,gfortran,gnat-style,gnat_rm,gnat_ugn}.info
  215. make -C libcpp DESTDIR=${pkgdir} install
  216. make -C gcc DESTDIR=${pkgdir} install-po
  217. # many packages expect this symlink
  218. ln -s gcc ${pkgdir}/usr/bin/cc
  219. # POSIX conformance launcher scripts for c89 and c99
  220. cat > $pkgdir/usr/bin/c89 <<"EOF"
  221. #!/bin/sh
  222. fl="-std=c89"
  223. for opt; do
  224. case "$opt" in
  225. -ansi|-std=c89|-std=iso9899:1990) fl="";;
  226. -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
  227. exit 1;;
  228. esac
  229. done
  230. exec gcc $fl ${1+"$@"}
  231. EOF
  232. cat > $pkgdir/usr/bin/c99 <<"EOF"
  233. #!/bin/sh
  234. fl="-std=c99"
  235. for opt; do
  236. case "$opt" in
  237. -std=c99|-std=iso9899:1999) fl="";;
  238. -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
  239. exit 1;;
  240. esac
  241. done
  242. exec gcc $fl ${1+"$@"}
  243. EOF
  244. chmod 755 $pkgdir/usr/bin/c{8,9}9
  245. # install the libstdc++ man pages
  246. make -C $_CHOST/libstdc++-v3/doc DESTDIR=$pkgdir doc-install-man
  247. # Install Runtime Library Exception
  248. install -d ${pkgdir}/usr/share/licenses/gcc-multilib/
  249. ln -s ../gcc-libs-multilib/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-multilib/
  250. }
  251. package_gcc-fortran-multilib()
  252. {
  253. pkgdesc="Fortran front-end for GCC for multilib"
  254. depends=("gcc-multilib=$gccver-$pkgrel")
  255. provides=("gcc-fortran=$gccver-$pkgrel")
  256. conflicts=('gcc-fortran')
  257. options=('!emptydirs')
  258. cd ${srcdir}/gcc-build
  259. make -C $_CHOST/libgfortran DESTDIR=$pkgdir install-cafexeclibLTLIBRARIES \
  260. install-{toolexeclibDATA,nodist_fincludeHEADERS}
  261. make -C $_CHOST/32/libgfortran DESTDIR=$pkgdir install-cafexeclibLTLIBRARIES \
  262. install-{toolexeclibDATA,nodist_fincludeHEADERS}
  263. make -C $_CHOST/libgomp DESTDIR=$pkgdir install-nodist_fincludeHEADERS
  264. make -C gcc DESTDIR=$pkgdir fortran.install-{common,man,info}
  265. install -Dm755 gcc/f951 $pkgdir/${_libdir}/f951
  266. ln -s gfortran ${pkgdir}/usr/bin/f95
  267. # Install Runtime Library Exception
  268. install -d ${pkgdir}/usr/share/licenses/gcc-fortran-multilib/
  269. ln -s ../gcc-libs-multilib/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-fortran-multilib/
  270. }
  271. package_gcc-objc-multilib()
  272. {
  273. pkgdesc="Objective-C front-end for GCC for multilib"
  274. depends=("gcc-multilib=$gccver-$pkgrel")
  275. provides=("gcc-objc=$gccver-$pkgrel")
  276. conflicts=('gcc-objc')
  277. cd ${srcdir}/gcc-build
  278. make DESTDIR=$pkgdir -C $_CHOST/libobjc install-headers
  279. install -dm755 $pkgdir/${_libdir}
  280. install -m755 gcc/cc1obj{,plus} $pkgdir/${_libdir}/
  281. # Install Runtime Library Exception
  282. install -d ${pkgdir}/usr/share/licenses/gcc-objc-multilib/
  283. ln -s ../gcc-libs-multilib/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-objc-multilib/
  284. }
  285. package_gcc-ada-multilib()
  286. {
  287. pkgdesc="Ada front-end for GCC (GNAT) for multilib"
  288. depends=("gcc-multilib=$gccver-$pkgrel")
  289. provides=("gcc-ada=$gccver-$pkgrel")
  290. conflicts=('gcc-ada')
  291. options=('staticlibs' '!emptydirs')
  292. cd ${srcdir}/gcc-build/gcc
  293. make DESTDIR=$pkgdir ada.install-{common,info}
  294. install -m755 gnat1 $pkgdir/${_libdir}
  295. cd ../$_CHOST/32/libada
  296. make DESTDIR=${pkgdir} INSTALL="install" \
  297. INSTALL_DATA="install -m644" install-gnatlib
  298. ln -s gcc ${pkgdir}/usr/bin/gnatgcc
  299. # insist on dynamic linking, but keep static libraries because gnatmake complains
  300. mv ${pkgdir}/${_libdir}/adalib/libgna{rl,t}-${_pkgver}.so ${pkgdir}/usr/lib
  301. ln -s libgnarl-${_pkgver}.so ${pkgdir}/usr/lib/libgnarl.so
  302. ln -s libgnat-${_pkgver}.so ${pkgdir}/usr/lib/libgnat.so
  303. rm ${pkgdir}/${_libdir}/adalib/libgna{rl,t}.so
  304. install -d ${pkgdir}/usr/lib32/
  305. mv ${pkgdir}/${_libdir}/32/adalib/libgna{rl,t}-${_pkgver}.so ${pkgdir}/usr/lib32
  306. ln -s libgnarl-${_pkgver}.so ${pkgdir}/usr/lib32/libgnarl.so
  307. ln -s libgnat-${_pkgver}.so ${pkgdir}/usr/lib32/libgnat.so
  308. rm ${pkgdir}/${_libdir}/32/adalib/libgna{rl,t}.so
  309. # Install Runtime Library Exception
  310. install -d ${pkgdir}/usr/share/licenses/gcc-ada-multilib/
  311. ln -s ../gcc-libs-multilib/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-ada-multilib/
  312. }
  313. package_gcc-go-multilib()
  314. {
  315. pkgdesc="Go front-end for GCC for multilib"
  316. depends=("gcc-multilib=$gccver-$pkgrel")
  317. provides=("gcc-go=$gccver-$pkgrel")
  318. conflicts=('go' 'gcc-go')
  319. options=('!emptydirs')
  320. cd ${srcdir}/gcc-build
  321. make -C $_CHOST/libgo DESTDIR=$pkgdir install-exec-am
  322. make -C $_CHOST/32/libgo DESTDIR=$pkgdir install-exec-am
  323. rm ${pkgdir}/usr/lib/libgo.so* ${pkgdir}/usr/lib32/libgo.so*
  324. make -C gcc DESTDIR=$pkgdir go.install-{common,man,info}
  325. install -Dm755 gcc/go1 $pkgdir/${_libdir}/go1
  326. make DESTDIR=${pkgdir} install-gotools
  327. # Install Runtime Library Exception
  328. install -d ${pkgdir}/usr/share/licenses/gcc-go-multilib/
  329. ln -s ../gcc-libs-multilib/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-go-multilib/
  330. }