public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tobias Burnus <burnus@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-12] libgomp: Use libiberty environ.h to declare the environment pointer.
Date: Mon, 12 Sep 2022 07:22:27 +0000 (GMT)	[thread overview]
Message-ID: <20220912072227.66F16385022A@sourceware.org> (raw)

https://gcc.gnu.org/g:7fbe23803a00cfb714073a25a095db645c61a405

commit 7fbe23803a00cfb714073a25a095db645c61a405
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon Sep 12 09:18:58 2022 +0200

    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 <iain@sandoe.co.uk>
    
    libgomp/ChangeLog:
    
            * env.c (initialize_env): Include libiberty environ.h.
    
    (cherry picked from commit 7d37c7f67c1bb75f85ad0c07bfff51ca579e1476)

Diff:
---
 libgomp/ChangeLog.omp | 7 +++++++
 libgomp/env.c         | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 4eb6cfaf1b1..e25a9ad8c49 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,10 @@
+2022-09-12  Tobias Burnus  <tobias@codesourcery.com>
+
+	Backport from mainline:
+	2022-09-10  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* env.c (initialize_env): Include libiberty environ.h.
+
 2022-09-12  Tobias Burnus  <tobias@codesourcery.com>
 
 	Backport from mainline:
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;

                 reply	other threads:[~2022-09-12  7:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220912072227.66F16385022A@sourceware.org \
    --to=burnus@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).