Hi Jakub, Rainer,

> On 9 Sep 2022, at 23:17, Jakub Jelinek <ja...@redhat.com> wrote:
> 
> On Fri, Sep 09, 2022 at 11:13:52PM +0100, Iain Sandoe wrote:
>> We already have such a header …
>> include/environ.h
> 
> Ah, ok, then please just use it.  Seems libgomp Makefile.am
> already includes -I$(top_srcdir)/../include
> 
> So just include that and remove the extern char **environ;
> from the constructor.

done as below, tested on powerpc64-linux, x86_64-darwin11/15 confirming that
the bootstrap succeeds on all and there are no new libgomp fails.  Pushed to
master

thanks
Iain

[pushed] libgomp: Use libiberty environ.h to declare the environment
 pointer.

This allows for target-specific mechanisms for finding the pointer.

Signed-off-by: Iain Sandoe <i...@sandoe.co.uk>

libgomp/ChangeLog:

        * env.c (initialize_env): Include libiberty environ.h.
---
 libgomp/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/env.c b/libgomp/env.c
index 92f32f72020..ac8c764db60 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -60,6 +60,7 @@
 #endif /* LIBGOMP_OFFLOADED_ONLY */
 
 #include "secure_getenv.h"
+#include "environ.h"
 
 /* Default values of ICVs according to the OpenMP standard.  */
 const struct gomp_default_icv gomp_default_icv_values = {
@@ -2033,7 +2034,6 @@ startswith (const char *str, const char *prefix)
 static void __attribute__((constructor))
 initialize_env (void)
 {
-  extern char **environ;
   char **env;
   int omp_var, dev_num = 0, dev_num_len = 0, i;
   bool ignore = false;
-- 
2.24.1


Reply via email to