diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index d59d80b47733..603809966e13 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,14 @@ +2015-09-22 Chung-Lin Tang + + Backport from mainline: + + 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-08-24 Joost VandeVondele PR libgomp/66761 diff --git a/libgomp/oacc-host.c b/libgomp/oacc-host.c index 6dcdbf3658e1..042d6d88dec3 100644 --- a/libgomp/oacc-host.c +++ b/libgomp/oacc-host.c @@ -82,8 +82,8 @@ static struct gomp_device_descr host_dispatch = }; /* Register this device type. */ -static __attribute__ ((constructor)) -void goacc_host_init (void) +void +goacc_host_init (void) { gomp_mutex_init (&host_dispatch.lock); goacc_register (&host_dispatch); diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c index a7c2e0d82086..339f2fa397a1 100644 --- a/libgomp/oacc-init.c +++ b/libgomp/oacc-init.c @@ -580,6 +580,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