From: cltang Date: Tue, 22 Sep 2015 06:45:22 +0000 (+0000) Subject: 2015-09-22 Chung-Lin Tang X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f6c4c35f8b65696e9ae48cf2cbe58b759b15284;p=thirdparty%2Fgcc.git 2015-09-22 Chung-Lin Tang PR libgomp/67141 * oacc-int.h (goacc_host_init): Add declaration. * oacc-host.c (goacc_host_init): Remove static and constructor attribute. * oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227994 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 29665c226e14..8e5655db8912 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,10 @@ +2015-09-22 Chung-Lin Tang + + PR libgomp/67141 + * oacc-int.h (goacc_host_init): Add declaration. + * oacc-host.c (goacc_host_init): Remove static and constructor attribute. + * oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end. + 2015-09-08 Aditya Kumar Sebastian Pop diff --git a/libgomp/oacc-host.c b/libgomp/oacc-host.c index 55bb16b278a5..284bb0ea4116 100644 --- a/libgomp/oacc-host.c +++ b/libgomp/oacc-host.c @@ -256,7 +256,7 @@ static struct gomp_device_descr host_dispatch = }; /* Initialize and register this device type. */ -static __attribute__ ((constructor)) void +void goacc_host_init (void) { gomp_mutex_init (&host_dispatch.lock); diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c index c12f8ad71373..2258a72bbe58 100644 --- a/libgomp/oacc-init.c +++ b/libgomp/oacc-init.c @@ -644,6 +644,9 @@ goacc_runtime_initialize (void) goacc_threads = NULL; gomp_mutex_init (&goacc_thread_lock); + + /* Initialize and register the 'host' device type. */ + goacc_host_init (); } /* Compiler helper functions */ diff --git a/libgomp/oacc-int.h b/libgomp/oacc-int.h index 0ace737884aa..f11e216c44fe 100644 --- a/libgomp/oacc-int.h +++ b/libgomp/oacc-int.h @@ -97,6 +97,7 @@ void goacc_runtime_initialize (void); void goacc_save_and_set_bind (acc_device_t); void goacc_restore_bind (void); void goacc_lazy_initialize (void); +void goacc_host_init (void); #ifdef HAVE_ATTRIBUTE_VISIBILITY # pragma GCC visibility pop