[arch-commits] Commit in (7 files)

Sven-Hendrik Haase svenstaro at archlinux.org
Sat May 5 19:45:10 UTC 2018


    Date: Saturday, May 5, 2018 @ 19:45:09
  Author: svenstaro
Revision: 318989

Add gcc54 for cuda

Added:
  gcc54/
  gcc54/repos/
  gcc54/trunk/
  gcc54/trunk/0000-gcc-5.4.ucontext.patch
  gcc54/trunk/0001-gcc-5.4-SIGSEGV.patch
  gcc54/trunk/0002-gcc-5.4-__res_state.patch
  gcc54/trunk/PKGBUILD

--------------------------------+
 0000-gcc-5.4.ucontext.patch    |   13 ++++
 0001-gcc-5.4-SIGSEGV.patch     |   10 +++
 0002-gcc-5.4-__res_state.patch |   11 +++
 PKGBUILD                       |  119 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 153 insertions(+)

Added: gcc54/trunk/0000-gcc-5.4.ucontext.patch
===================================================================
--- gcc54/trunk/0000-gcc-5.4.ucontext.patch	                        (rev 0)
+++ gcc54/trunk/0000-gcc-5.4.ucontext.patch	2018-05-05 19:45:09 UTC (rev 318989)
@@ -0,0 +1,13 @@
+--- libsanitizer/sanitizer_common/sanitizer_linux.h.orig	2018-02-03 18:21:04.356118422 +0100
++++ libsanitizer/sanitizer_common/sanitizer_linux.h	2018-02-03 18:22:01.547962570 +0100
+@@ -16,9 +16,9 @@
+ #include "sanitizer_common.h"
+ #include "sanitizer_internal_defs.h"
+ #include "sanitizer_platform_limits_posix.h"
++#include <sys/ucontext.h>
+ 
+ struct link_map;  // Opaque type returned by dlopen().
+-struct sigaltstack;
+ 
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from

Added: gcc54/trunk/0001-gcc-5.4-SIGSEGV.patch
===================================================================
--- gcc54/trunk/0001-gcc-5.4-SIGSEGV.patch	                        (rev 0)
+++ gcc54/trunk/0001-gcc-5.4-SIGSEGV.patch	2018-05-05 19:45:09 UTC (rev 318989)
@@ -0,0 +1,10 @@
+--- libsanitizer/asan/asan_linux.cc.orig	2018-02-03 18:24:37.977222787 +0100
++++ libsanitizer/asan/asan_linux.cc	2018-02-03 18:25:03.873215178 +0100
+@@ -32,6 +32,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <unwind.h>
++#include <signal.h>
+ 
+ #if SANITIZER_FREEBSD
+ #include <sys/link_elf.h>

Added: gcc54/trunk/0002-gcc-5.4-__res_state.patch
===================================================================
--- gcc54/trunk/0002-gcc-5.4-__res_state.patch	                        (rev 0)
+++ gcc54/trunk/0002-gcc-5.4-__res_state.patch	2018-05-05 19:45:09 UTC (rev 318989)
@@ -0,0 +1,11 @@
+--- libsanitizer/tsan/tsan_platform_linux.cc.orig	2018-02-03 18:26:53.153703109 +0100
++++ libsanitizer/tsan/tsan_platform_linux.cc	2018-02-03 18:27:30.326068569 +0100
+@@ -377,7 +377,7 @@
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ #if SANITIZER_LINUX
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  res_state statp = (res_state)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];

Added: gcc54/trunk/PKGBUILD
===================================================================
--- gcc54/trunk/PKGBUILD	                        (rev 0)
+++ gcc54/trunk/PKGBUILD	2018-05-05 19:45:09 UTC (rev 318989)
@@ -0,0 +1,119 @@
+# $Id$
+# Maintainer: Sven-Hendrik Haase <svenstaro at gmail.com>
+# Contributor: Michael Strecke <michael-strecke at hotmail.de>
+# Contributor: Sebastiaan Lokhorst <sebastiaanlokhorst at gmail.com>
+# Contributor: Ruben Van Boxem <vanboxem.ruben at gmail.com>
+# Contributor: Allan McRae <allan at archlinux.org>
+
+pkgname=('gcc54')
+pkgver=5.4.1
+_pkgver=5
+_islver=0.18
+pkgrel=1
+pkgdesc="The GNU Compiler Collection (5.4.x)"
+arch=('i686' 'x86_64')
+license=('GPL' 'LGPL' 'FDL' 'custom')
+url="http://gcc.gnu.org"
+depends=('binutils>=2.26' 'libmpc')
+makedepends=('git')
+options=('!emptydirs')
+provides=('gcc5==5.4')
+conflicts=('gcc5')
+_commit=c62ba6f61b276ef5729c089d866ab12bf1f38c0f
+source=(git+https://gcc.gnu.org/git/gcc.git#commit=${_commit}
+        http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
+        0000-gcc-5.4.ucontext.patch
+        0001-gcc-5.4-SIGSEGV.patch
+        0002-gcc-5.4-__res_state.patch)
+sha512sums=('SKIP'
+            '85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94'
+            'de49431ade77591b04e89a4ce33c0ad3501755600d335e8f2dc8849464b22620e591ed0d66cd1549a74bd6784a8c022b5e42d7ecbeb8f417eaae794418dbb83f'
+            '8e6574690bba2bd29c4dd3e4442c5b9fefc49ad6615903101cfe0d3f92b6d6f85a3e5fe44001e61fddfdf97a7ef8fe9bd31fe371c9073cb646c2e19064be65e6'
+            'c632488bbaf0e78c2ffe4f9f54c673208e60eb24f5f022c55c81102f780f59f47f3ba005a7caf9ff5d9bb2d204f240059ab6c1d5baf92975b5ced61a45f7e2e1')
+
+_basedir=gcc
+
+prepare() {
+  cd ${srcdir}/${_basedir}
+
+  # link isl for in-tree build
+  ln -s ../isl-${_islver} isl
+
+  # Do not run fixincludes
+  sed -i 's@\./fixinc\.sh at -c true@' gcc/Makefile.in
+
+  # fix build with glibc 2.26
+  patch -Nbup0 -i "${srcdir}/0000-gcc-5.4.ucontext.patch" # https://gcc.gnu.org/bugzilla/attachment.cgi?id=41921
+  patch -Nbup0 -i "${srcdir}/0001-gcc-5.4-SIGSEGV.patch"
+  patch -Nbup0 -i "${srcdir}/0002-gcc-5.4-__res_state.patch" # https://gcc.gnu.org/bugzilla/attachment.cgi?id=41922
+  sed -e 's:\bstruct ucontext\b:ucontext_t:g' -i $(grep --include '*.[ch]' --include '*.cc' -lre '\bstruct ucontext\b')
+  sed -e 's:\bstruct sigaltstack\b:stack_t:g' -i $(grep --include '*.[ch]' --include '*.cc' -lre '\bstruct sigaltstack\b')
+  sed -e '/^struct ucontext_t/,/^};/ d' -i 'libsanitizer/tsan/tsan_interceptors.cc'
+  if grep -e '^struct ucontext_t' 'libsanitizer/tsan/tsan_interceptors.cc'; then
+    set +u
+    echo 'Failed to remove ^struct ucontext_t'
+    false
+  fi
+
+  # Arch Linux installs x86_64 libraries /lib
+  [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
+
+  echo ${pkgver} > gcc/BASE-VER
+
+  # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
+  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
+
+  mkdir ${srcdir}/gcc-build
+}
+
+build() {
+  cd ${srcdir}/gcc-build
+
+  # using -pipe causes spurious test-suite failures
+  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
+  CFLAGS=${CFLAGS/-pipe/}
+  CXXFLAGS=${CXXFLAGS/-pipe/}
+
+  # This option exist in default makepkg.conf while it's not supported by gcc5
+  CFLAGS=${CFLAGS/-fno-plt/}
+  CXXFLAGS=${CXXFLAGS/-fno-plt/}
+
+  ${srcdir}/${_basedir}/configure --prefix=/usr \
+      --build=${CHOST} \
+      --libdir=/usr/lib --libexecdir=/usr/lib \
+      --mandir=/usr/share/man --infodir=/usr/share/info \
+      --with-bugurl=https://bugs.archlinux.org/ \
+      --enable-languages=c,c++,fortran,go,lto,objc,obj-c++ \
+      --enable-shared --enable-threads=posix --enable-libmpx \
+      --with-system-zlib --with-isl --enable-__cxa_atexit \
+      --disable-libunwind-exceptions --enable-clocale=gnu \
+      --disable-libstdcxx-pch --disable-libssp \
+      --enable-gnu-unique-object --enable-linker-build-id \
+      --enable-lto --enable-plugin \
+      --with-linker-hash-style=gnu --enable-gnu-indirect-function \
+      --disable-multilib --disable-werror \
+      --enable-checking=release \
+      --program-suffix=-${_pkgver} \
+      --enable-version-specific-runtime-libs
+      #--enable-install-libiberty
+
+  export LD_PRELOAD=/usr/lib/libstdc++.so
+  make
+}
+
+package() {
+  cd ${srcdir}/gcc-build
+
+  make -j1 DESTDIR=${pkgdir} install
+
+  # Lazy way of dealing with conflicting files...
+  rm -rf ${pkgdir}/usr/share/{info,locale,man}
+
+  # Move potentially conflicting stuff to version specific subdirectory
+  [[ -d ${pkgdir}/usr/lib ]] && mv ${pkgdir}/usr/lib/lib* ${pkgdir}/usr/lib/gcc/${CHOST}/${pkgver}/
+  [[ -d ${pkgdir}/usr/lib/gcc/${CHOST}/lib/ ]] && mv ${pkgdir}/usr/lib/gcc/${CHOST}/lib/lib* ${pkgdir}/usr/lib/gcc/${CHOST}/${pkgver}/
+
+  # Install Runtime Library Exception
+  install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \
+    ${pkgdir}/usr/share/licenses/$pkgname/RUNTIME.LIBRARY.EXCEPTION
+}



More information about the arch-commits mailing list