This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp4 7/8] libgomp: work around missing pthread_attr_t on nvptx
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>, Arutyun Avetisyan <arut at ispras dot ru>, Alexander Monakov <amonakov at ispras dot ru>
- Date: Wed, 23 Sep 2015 20:22:21 +0300
- Subject: [gomp4 7/8] libgomp: work around missing pthread_attr_t on nvptx
- Authentication-results: sourceware.org; auth=none
- References: <1443028942-4081-1-git-send-email-amonakov at ispras dot ru>
Although newlib headers define most pthreads types, pthread_attr_t is not
available. Macro-replace it by 'void' to keep the prototype of
gomp_init_thread_affinity unchanged, and do not declare gomp_thread_attr.
* libgomp.h: Define pthread_attr_t to void on NVPTX.
---
libgomp/libgomp.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h
index d51b08b..f4255b4 100644
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -510,8 +510,13 @@ static inline struct gomp_task_icv *gomp_icv (bool write)
return &gomp_global_icv;
}
+#ifdef __nvptx__
+/* pthread_attr_t is not provided by newlib on NVPTX. */
+#define pthread_attr_t void
+#else
/* The attributes to be used during thread creation. */
extern pthread_attr_t gomp_thread_attr;
+#endif
/* Function prototypes. */