summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Veness2016-08-14 17:01:19 -0700
committerTyler Veness2016-08-14 17:01:19 -0700
commitcb8ec83de09498f7df30f7968edde0cf440f0719 (patch)
tree8f1fce55c84439f36c4161785218dc659a021613
downloadaur-cb8ec83de09498f7df30f7968edde0cf440f0719.tar.gz
Initial commit
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD82
-rw-r--r--pointer-cast.patch14
-rw-r--r--vxworks-pthread.patch145
4 files changed, 272 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9a93614f49d8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = powerpc-wrs-vxworks-gcc
+ pkgdesc = The GNU Compiler Collection (powerpc-wrs-vxworks)
+ pkgver = 6.1.0
+ pkgrel = 1
+ url = http://gcc.gnu.org
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = LGPL
+ makedepends = wget
+ depends = wrs-vxworks-headers
+ depends = binutils-powerpc-wrs-vxworks
+ depends = libmpc
+ depends = elfutils
+ provides = gcc-powerpc-wrs-vxworks
+ conflicts = gcc-powerpc-wrs-vxworks
+ options = !strip
+ options = !libtool
+ options = !zipman
+ options = !buildflags
+ options = !makeflags
+ options = staticlibs
+ source = http://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.bz2
+ source = vxworks-pthread.patch
+ source = pointer-cast.patch
+ sha512sums = eeed3e2018b8c012aabce419e8d718fde701e5c3c179b4486c61ba46e5736eecc8fccdd18b01fcd973a42c6ad3116dbbe2ee247fe3757d622d373f93ebaf8d2e
+ sha512sums = 5ba8c2757a1970df26bc1c656a5c315c32c62ea3e1f2e17d48cb77855a662b7770e581d5319d0d55bed270bd4028f7ce308c88d7d96c28806be484165b48e689
+ sha512sums = e1e7bec1e821ec7cc14bbab97bcce53e9a4932d238f530597dc5a957c2eac1773817b820c3e863119e2807b8b9ece364fbc4b1cf58c9ecbaf67ac6f068978a36
+
+pkgname = powerpc-wrs-vxworks-gcc
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d0c2eb8f27e1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,82 @@
+# Maintainer: Tyler Veness <calcmogul at gmail dot com>
+# Contributor: Alex Brinister <alex_brinister@yahoo.com>
+
+_target=powerpc-wrs-vxworks
+pkgname=${_target}-gcc
+pkgver=6.1.0
+pkgrel=1
+pkgdesc="The GNU Compiler Collection (${_target})"
+arch=('i686' 'x86_64')
+url="http://gcc.gnu.org"
+license=('GPL' 'LGPL')
+depends=('wrs-vxworks-headers' 'binutils-powerpc-wrs-vxworks' 'libmpc' 'elfutils')
+makedepends=('wget')
+conflicts=('gcc-powerpc-wrs-vxworks')
+provides=('gcc-powerpc-wrs-vxworks')
+options=('!strip' '!libtool' '!zipman' '!buildflags' '!makeflags' 'staticlibs')
+source=(http://ftp.gnu.org/gnu/gcc/gcc-"${pkgver}"/gcc-"${pkgver}".tar.bz2
+ vxworks-pthread.patch
+ pointer-cast.patch)
+sha512sums=('eeed3e2018b8c012aabce419e8d718fde701e5c3c179b4486c61ba46e5736eecc8fccdd18b01fcd973a42c6ad3116dbbe2ee247fe3757d622d373f93ebaf8d2e'
+ '5ba8c2757a1970df26bc1c656a5c315c32c62ea3e1f2e17d48cb77855a662b7770e581d5319d0d55bed270bd4028f7ce308c88d7d96c28806be484165b48e689'
+ 'e1e7bec1e821ec7cc14bbab97bcce53e9a4932d238f530597dc5a957c2eac1773817b820c3e863119e2807b8b9ece364fbc4b1cf58c9ecbaf67ac6f068978a36')
+
+prepare() {
+ cd "${srcdir}/gcc-${pkgver}"
+
+ # Apply patches
+ patch -p1 < ../vxworks-pthread.patch
+ patch -p1 < ../pointer-cast.patch
+
+ mkdir ${srcdir}/gcc-build
+}
+
+build() {
+ cd "${srcdir}/gcc-build"
+
+ export CFLAGS_FOR_TARGET="-g -O2 -mlongcall"
+ ${srcdir}/gcc-${pkgver}/configure \
+ --prefix=/usr \
+ --program-prefix=${_target}- \
+ --target=${_target} \
+ --host=$CHOST \
+ --build=$CHOST \
+ --disable-nls \
+ --enable-threads=posix \
+ --enable-languages=c,c++ \
+ --disable-multilib \
+ --with-sysroot=/usr/${_target} \
+ --with-build-sysroot=/usr/${_target} \
+ --with-as=/usr/bin/${_target}-as \
+ --with-ld=/usr/bin/${_target}-ld \
+ --with-cpu-PPC603 \
+ --with-float=hard \
+ --enable-lto \
+ --enable-plugin \
+ --disable-shared \
+ --disable-libssp \
+ --enable-libstdcxx \
+ --enable-libstdcxx-time \
+ --without-gconv \
+ --disable-libgomp \
+ --disable-libmudflap \
+ --disable-symvers \
+ --enable-cxx-flags=-mlongcall
+
+ source /etc/profile.d/wind_base.sh
+ make all-gcc all-target-libgcc all-target-libstdc++-v3
+}
+
+package() {
+ cd "${srcdir}/gcc-build"
+
+ make "DESTDIR=${pkgdir}" install-gcc install-target-libgcc \
+ install-target-libstdc++-v3
+
+ rm -rf ${pkgdir}/usr/share/{man/man7,info}/
+
+ cp -r "${pkgdir}"/usr/libexec/* "${pkgdir}/usr/lib/"
+ rm -rf "${pkgdir}/usr/libexec"
+
+ rm -rf "${pkgdir}/usr/share/gcc-${pkgver}/python"
+}
diff --git a/pointer-cast.patch b/pointer-cast.patch
new file mode 100644
index 000000000000..17afbf81eb6b
--- /dev/null
+++ b/pointer-cast.patch
@@ -0,0 +1,14 @@
+diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc
+index d60a00b..57128e7 100644
+--- a/libstdc++-v3/src/c++11/random.cc
++++ b/libstdc++-v3/src/c++11/random.cc
+@@ -136,7 +136,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
+ #ifdef _GLIBCXX_HAVE_UNISTD_H
+ do
+ {
+- const int e = read(fileno(static_cast<FILE*>(_M_file)), p, n);
++ const int e = read(fileno(static_cast<FILE*>(_M_file)), static_cast<char*>(p),
++ n);
+ if (e > 0)
+ {
+ n -= e;
diff --git a/vxworks-pthread.patch b/vxworks-pthread.patch
new file mode 100644
index 000000000000..dd309f24056e
--- /dev/null
+++ b/vxworks-pthread.patch
@@ -0,0 +1,145 @@
+From 2cf34e06f47345884f234bb870714ed2896745a6 Mon Sep 17 00:00:00 2001
+From: rbmj <rbmj@verizon.net>
+Date: Sat, 4 Jan 2014 09:11:02 -0500
+Subject: [PATCH] Allowed posix as a thread option for vxworks
+
+Note: VxWorks defines all of the _POSIX_TIMERS functions, but doesn't
+define the macro. Configure looks for the _POSIX_TIMERS macro when
+checking for these functions. This seems strange to me. It seems like
+if the try_compile can find them, then everything should be fine.
+I'm not an expert though, and acinclude.m4 notes that there is a similar
+situation for darwin, so I'll just let it be this way for now.
+---
+ gcc/config.gcc | 1 +
+ libgcc/config.host | 8 ++++++
+ libgcc/config/t-vxworks-pthread | 14 +++++++++++
+ libgcc/gthr-posix.h | 38 ++++++++++++++++++++++++++++-
+ libstdc++-v3/config/os/vxworks/os_defines.h | 3 +++
+ 5 files changed, 63 insertions(+), 1 deletion(-)
+ create mode 100644 libgcc/config/t-vxworks-pthread
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 92d57dd..3fd9bb5 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -804,6 +804,7 @@ case ${target} in
+ case ${enable_threads} in
+ no) ;;
+ "" | yes | vxworks) thread_file='vxworks' ;;
++ posix) thread_file='posix' ;;
+ *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
+ esac
+ ;;
+diff --git a/libgcc/config.host b/libgcc/config.host
+index 259c9a7..21471db 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -261,6 +261,14 @@ case ${host} in
+ ;;
+ *-*-vxworks*)
+ tmake_file=t-vxworks
++ case ${target_thread_file} in
++ vxworks)
++ tmake_file=t-vxworks
++ ;;
++ posix)
++ tmake_file=t-vxworks-pthread
++ ;;
++ esac
+ ;;
+ *-*-elf)
+ extra_parts="crtbegin.o crtend.o"
+diff --git a/libgcc/config/t-vxworks-pthread b/libgcc/config/t-vxworks-pthread
+new file mode 100644
+index 0000000..4e538f9
+--- /dev/null
++++ b/libgcc/config/t-vxworks-pthread
+@@ -0,0 +1,14 @@
++# Don't build libgcc.a with debug info
++LIBGCC2_DEBUG_CFLAGS =
++
++# No out-of line help needed
++LIB2ADD =
++
++# This ensures that the correct target headers are used; some
++# VxWorks system headers have names that collide with GCC's
++# internal (host) headers, e.g. regs.h.
++LIBGCC2_INCLUDES = -nostdinc -I \
++ `case "/$$(MULTIDIR)" in \
++ */mrtp*) echo $(WIND_USR)/h ;; \
++ *) echo $(WIND_BASE)/target/h ;; \
++ esac`
+diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h
+index f0d8cd7..b6a6069 100644
+--- a/libgcc/gthr-posix.h
++++ b/libgcc/gthr-posix.h
+@@ -33,6 +33,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define __GTHREADS_CXX0X 1
+
+ #include <pthread.h>
++/* For timespec, in case pthread.h doesn't include this */
++#include <time.h>
++/* For sched_yield, in case pthread.h doesn't include this */
++#include <sched.h>
+
+ #if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
+ || !defined(_GTHREAD_USE_MUTEX_TIMEDLOCK))
+@@ -130,10 +134,42 @@ __gthrw(pthread_cond_destroy)
+
+ __gthrw(pthread_key_create)
+ __gthrw(pthread_key_delete)
++
+ __gthrw(pthread_mutexattr_init)
+-__gthrw(pthread_mutexattr_settype)
+ __gthrw(pthread_mutexattr_destroy)
+
++/* VxWorks does not define pthread_mutexattr_settype itself, and we need
++ the constants and a prototype to be defined somewhere so the rest of
++ this file will compile (they will be ignored) */
++#ifdef __VXWORKS__
++
++#define ATTRIBUTE_UNUSED __attribute__((unused))
++
++static inline int
++__gthrw_pthread_mutexattr_settype (pthread_mutexattr_t *a ATTRIBUTE_UNUSED, int t ATTRIBUTE_UNUSED)
++{
++ /* TODO: It might be possible to override the mutex machinery to
++ simulate non-recursive mutexes, but this doesn't seem to be
++ necessary because all vxworks mutexes are recursive, and recursive
++ mutexes cover the most general case. */
++ return 0;
++}
++
++#undef ATTRIBUTE_UNUSED
++
++#define PTHREAD_MUTEX_NORMAL 0
++#define PTHREAD_MUTEX_ERRORCHECK 0
++#define PTHREAD_MUTEX_RECURSIVE 0
++#define PTHREAD_MUTEX_DEFAULT 0
++
++#else
++
++__gthrw(pthread_mutexattr_settype)
++
++#endif
++
++
++
+
+ #if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+ /* Objective-C. */
+diff --git a/libstdc++-v3/config/os/vxworks/os_defines.h b/libstdc++-v3/config/os/vxworks/os_defines.h
+index de2522e..edb6693 100644
+--- a/libstdc++-v3/config/os/vxworks/os_defines.h
++++ b/libstdc++-v3/config/os/vxworks/os_defines.h
+@@ -39,4 +39,7 @@
+ #endif
+ #define NOMINMAX 1
+
++#define _GLIBCXX_USE_NANOSLEEP 1
++#define _GLIBCXX_USE_CLOCK_REALTIME 1
++
+ #endif
+--
+1.8.4.rc3
+