diff mbox series

libgomp: Allow overriding via 'GOMP_OFFLOAD_PLUGINS' the configured set of libgomp plugins

Message ID yxfpftcpgijt.fsf@hertz.schwinge.homeip.net
State New
Headers show
Series libgomp: Allow overriding via 'GOMP_OFFLOAD_PLUGINS' the configured set of libgomp plugins | expand

Commit Message

Thomas Schwinge April 27, 2020, 1:33 p.m. UTC
Hi!

Is the attached patch for "libgomp: Allow overriding via
'GOMP_OFFLOAD_PLUGINS' the configured set of libgomp plugins" OK for
master and release branches?  If approving this patch, please respond
with "Reviewed-by: NAME <EMAIL>" so that your effort will be recorded in
the commit log, see <https://gcc.gnu.org/wiki/Reviewed-by>.


Grüße
 Thomas


-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

Comments

Thomas Schwinge May 5, 2020, 8:28 p.m. UTC | #1
Hi!

Ping.


Grüße
 Thomas


On 2020-04-27T15:33:10+0200, I wrote:
> Hi!
>
> Is the attached patch for "libgomp: Allow overriding via
> 'GOMP_OFFLOAD_PLUGINS' the configured set of libgomp plugins" OK for
> master and release branches?  If approving this patch, please respond
> with "Reviewed-by: NAME <EMAIL>" so that your effort will be recorded in
> the commit log, see <https://gcc.gnu.org/wiki/Reviewed-by>.
>
>
> Grüße
>  Thomas
>
>
> From 13f04e776c803766140b0b657dad15029e2b65be Mon Sep 17 00:00:00 2001
> From: Thomas Schwinge <thomas@codesourcery.com>
> Date: Mon, 27 Apr 2020 14:01:50 +0200
> Subject: [PATCH] libgomp: Allow overriding via 'GOMP_OFFLOAD_PLUGINS' the
>  configured set of libgomp plugins
>
> This can be useful for testing the same libgomp build on several machines, with
> different offload capabilities/configurations.
>
> This is subject to change, and thus intentionally not documented.
>
>       libgomp/
>       * target.c [PLUGIN_SUPPORT] (gomp_target_init): Allow overriding
>       via 'GOMP_OFFLOAD_PLUGINS' the configured set of libgomp plugins.
> ---
>  libgomp/target.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/libgomp/target.c b/libgomp/target.c
> index 36425477dcb..d1de7fab87c 100644
> --- a/libgomp/target.c
> +++ b/libgomp/target.c
> @@ -25,6 +25,7 @@
>
>  /* This file contains the support of offloading.  */
>
> +#define _GNU_SOURCE
>  #include "libgomp.h"
>  #include "oacc-plugin.h"
>  #include "oacc-int.h"
> @@ -42,6 +43,7 @@
>  #ifdef PLUGIN_SUPPORT
>  #include <dlfcn.h>
>  #include "plugin-suffix.h"
> +#include "secure_getenv.h"
>  #endif
>
>  #define FIELD_TGT_EMPTY (~(size_t) 0)
> @@ -3163,7 +3165,10 @@ gomp_target_init (void)
>    num_devices = 0;
>    devices = NULL;
>
> -  cur = OFFLOAD_PLUGINS;
> +  /* This is subject to change, and thus intentionally not documented.  */
> +  cur = secure_getenv ("GOMP_OFFLOAD_PLUGINS");
> +  if (!cur)
> +    cur = OFFLOAD_PLUGINS;
>    if (*cur)
>      do
>        {
> --
> 2.17.1
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
diff mbox series

Patch

From 13f04e776c803766140b0b657dad15029e2b65be Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Mon, 27 Apr 2020 14:01:50 +0200
Subject: [PATCH] libgomp: Allow overriding via 'GOMP_OFFLOAD_PLUGINS' the
 configured set of libgomp plugins

This can be useful for testing the same libgomp build on several machines, with
different offload capabilities/configurations.

This is subject to change, and thus intentionally not documented.

	libgomp/
	* target.c [PLUGIN_SUPPORT] (gomp_target_init): Allow overriding
	via 'GOMP_OFFLOAD_PLUGINS' the configured set of libgomp plugins.
---
 libgomp/target.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libgomp/target.c b/libgomp/target.c
index 36425477dcb..d1de7fab87c 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -25,6 +25,7 @@ 
 
 /* This file contains the support of offloading.  */
 
+#define _GNU_SOURCE
 #include "libgomp.h"
 #include "oacc-plugin.h"
 #include "oacc-int.h"
@@ -42,6 +43,7 @@ 
 #ifdef PLUGIN_SUPPORT
 #include <dlfcn.h>
 #include "plugin-suffix.h"
+#include "secure_getenv.h"
 #endif
 
 #define FIELD_TGT_EMPTY (~(size_t) 0)
@@ -3163,7 +3165,10 @@  gomp_target_init (void)
   num_devices = 0;
   devices = NULL;
 
-  cur = OFFLOAD_PLUGINS;
+  /* This is subject to change, and thus intentionally not documented.  */
+  cur = secure_getenv ("GOMP_OFFLOAD_PLUGINS");
+  if (!cur)
+    cur = OFFLOAD_PLUGINS;
   if (*cur)
     do
       {
-- 
2.17.1