From d4bd97c55684ca5960ddc373fa0d1b98fe176ae2 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Thu, 20 Feb 2014 20:38:31 +0000 Subject: [PATCH] winpthreads + gcc: disabled my debugging stuff --- mingw-w64-gcc/PKGBUILD | 8 +- mingw-w64-gcc/libgomp-no-static.patch | 124 ++++++++++++++++++++++++++ mingw-w64-winpthreads/PKGBUILD | 2 +- 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 mingw-w64-gcc/libgomp-no-static.patch diff --git a/mingw-w64-gcc/PKGBUILD b/mingw-w64-gcc/PKGBUILD index 1cb4d38741..8c1ec367de 100644 --- a/mingw-w64-gcc/PKGBUILD +++ b/mingw-w64-gcc/PKGBUILD @@ -25,7 +25,7 @@ makedepends=("${_mingw_suff}-${_realname}-ada=${pkgver}" "${_mingw_suff}-${_real optdepends=() replaces=() backup=() -options=('!strip' 'debug' 'staticlibs' '!emptydirs') # '!buildflags' +options=('strip' '!debug' 'staticlibs' '!emptydirs') # '!buildflags' source=("ftp://gcc.gnu.org/pub/gcc/releases/${_realname}-${pkgver}/${_realname}-${pkgver}.tar.bz2" 'gcc-4.8-filename-output.patch' 'gcc-4.8-lambda-ICE.patch' @@ -127,8 +127,10 @@ prepare() { # Build aextra tools for Ada patch -p1 -i ${srcdir}/build-more-gnattools.mingw.patch - # Expose some libgomp internals for debugging. - patch -p1 -i ${srcdir}/libgomp-no-static.patch + if check_option "debug" "y"; then + # Expose some libgomp internals for debugging. + patch -p1 -i ${srcdir}/libgomp-no-static.patch + fi } build() { diff --git a/mingw-w64-gcc/libgomp-no-static.patch b/mingw-w64-gcc/libgomp-no-static.patch new file mode 100644 index 0000000000..3b1e52b073 --- /dev/null +++ b/mingw-w64-gcc/libgomp-no-static.patch @@ -0,0 +1,124 @@ +diff -urN a/libgomp/libgomp.h b/libgomp/libgomp.h +--- a/libgomp/libgomp.h 2014-01-23 18:05:11.422031300 +0000 ++++ b/libgomp/libgomp.h 2014-01-23 18:30:38.766439100 +0000 +@@ -370,6 +370,7 @@ + + /* ... and here is that TLS data. */ + ++/* + #ifdef HAVE_TLS + extern __thread struct gomp_thread gomp_tls_data; + static inline struct gomp_thread *gomp_thread (void) +@@ -383,6 +384,8 @@ + return pthread_getspecific (gomp_tls_key); + } + #endif ++*/ ++struct gomp_thread *gomp_thread (void); + + extern struct gomp_task_icv *gomp_new_icv (void); + +diff -urN a/libgomp/team.c b/libgomp/team.c +--- a/libgomp/team.c 2014-01-23 18:05:11.435534000 +0000 ++++ b/libgomp/team.c 2014-01-23 18:09:27.515239700 +0000 +@@ -60,7 +60,7 @@ + /* This function is a pthread_create entry point. This contains the idle + loop in which a thread waits to be called up to become part of a team. */ + +-static void * ++/*static */void * + gomp_thread_start (void *xdata) + { + struct gomp_thread_start_data *data = xdata; +@@ -175,7 +175,7 @@ + + /* Free a team data structure. */ + +-static void ++/*static */void + free_team (struct gomp_team *team) + { + gomp_barrier_destroy (&team->barrier); +@@ -185,7 +185,7 @@ + + /* Allocate and initialize a thread pool. */ + +-static struct gomp_thread_pool *gomp_new_thread_pool (void) ++/*static */struct gomp_thread_pool *gomp_new_thread_pool (void) + { + struct gomp_thread_pool *pool + = gomp_malloc (sizeof(struct gomp_thread_pool)); +@@ -196,7 +196,7 @@ + return pool; + } + +-static void ++/*static */void + gomp_free_pool_helper (void *thread_pool) + { + struct gomp_thread_pool *pool +@@ -208,7 +208,7 @@ + + /* Free a thread pool and release its threads. */ + +-static void ++/*static */void + gomp_free_thread (void *arg __attribute__((unused))) + { + struct gomp_thread *thr = gomp_thread (); +@@ -529,7 +529,7 @@ + + /* Constructors for this file. */ + +-static void __attribute__((constructor)) ++/*static */void __attribute__((constructor)) + initialize_team (void) + { + struct gomp_thread *thr; +@@ -552,7 +552,7 @@ + gomp_sem_init (&thr->release, 0); + } + +-static void __attribute__((destructor)) ++/*static */void __attribute__((destructor)) + team_destructor (void) + { + /* Without this dlclose on libgomp could lead to subsequent +@@ -570,3 +570,16 @@ + pthread_setspecific (gomp_thread_destructor, thr); + return &task->icv; + } ++ ++#ifdef HAVE_TLS ++struct gomp_thread *gomp_thread (void) ++{ ++ return &gomp_tls_data; ++} ++#else ++struct gomp_thread *gomp_thread (void) ++{ ++ return pthread_getspecific (gomp_tls_key); ++} ++#endif ++ +diff -urN a/libgomp/work.c b/libgomp/work.c +--- a/libgomp/work.c 2014-01-23 18:05:11.734093700 +0000 ++++ b/libgomp/work.c 2014-01-23 18:09:44.161568300 +0000 +@@ -34,7 +34,7 @@ + /* Allocate a new work share structure, preferably from current team's + free gomp_work_share cache. */ + +-static struct gomp_work_share * ++/*static */struct gomp_work_share * + alloc_work_share (struct gomp_team *team) + { + struct gomp_work_share *ws; +@@ -132,7 +132,7 @@ + /* Free a work share struct, if not orphaned, put it into current + team's free gomp_work_share cache. */ + +-static inline void ++/*static */inline void + free_work_share (struct gomp_team *team, struct gomp_work_share *ws) + { + gomp_fini_work_share (ws); diff --git a/mingw-w64-winpthreads/PKGBUILD b/mingw-w64-winpthreads/PKGBUILD index 6eff1e44a0..41006dc391 100644 --- a/mingw-w64-winpthreads/PKGBUILD +++ b/mingw-w64-winpthreads/PKGBUILD @@ -12,7 +12,7 @@ url="http://mingw-w64.sourceforge.net" license=('custom') groups=("${_mingw_suff}-toolchain" "${_mingw_suff}") makedepends=("subversion" "${_mingw_suff}-gcc" "${_mingw_suff}-binutils" "${_mingw_suff}-crt-svn" "${_mingw_suff}-headers-svn") -options=('!strip' '!buildflags' 'staticlibs' '!emptydirs' 'debug') +options=('strip' '!buildflags' 'staticlibs' '!emptydirs' '!debug') source=("${_realname}"::"svn+svn://svn.code.sf.net/p/mingw-w64/code/trunk/mingw-w64-libraries/winpthreads") md5sums=('SKIP')