From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id F3CFE3858429 for ; Fri, 9 Sep 2022 22:13:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F3CFE3858429 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 67761 invoked from network); 9 Sep 2022 22:13:52 -0000 X-APM-Out-ID: 16627616326775 X-APM-Authkey: 257869/1(257869/1) 5 Received: from unknown (HELO ?192.168.1.95?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 9 Sep 2022 22:13:52 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] OpenMP, libgomp: Environment variable syntax extension. From: Iain Sandoe In-Reply-To: Date: Fri, 9 Sep 2022 23:13:52 +0100 Cc: Rainer Orth , GCC Patches , Marcel Vollweiler Content-Transfer-Encoding: quoted-printable Message-Id: References: <392c847d-e798-2be3-a808-6888de6c90cd@codesourcery.com> <73621930-22ce-c3f1-61e0-f15683f8b281@codesourcery.com> <055f7cfb-2849-ba5a-a161-13333e19e538@codesourcery.com> <7dc0eaf0-a3ed-8145-c43a-e9bb063f6acd@codesourcery.com> To: Jakub Jelinek X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On 9 Sep 2022, at 23:08, Jakub Jelinek wrote: >=20 > On Fri, Sep 09, 2022 at 10:50:19PM +0200, Rainer Orth wrote: >> Hi Jakub, >>=20 >>> On Wed, Aug 31, 2022 at 12:56:25PM +0200, Marcel Vollweiler wrote: >>>> libgomp/ChangeLog: >> [...] >>>> (initialize_env): Extended to parse the new syntax of = environment >>>> variables. >>=20 >> this patch broke Darwin bootstrap: >>=20 >> Undefined symbols for architecture x86_64: >> "_environ", referenced from: >> _initialize_env in env.o >> ld: symbol(s) not found for architecture x86_64 >> collect2: error: ld returned 1 exit status >> make[5]: *** [libgomp.la] Error 1 >>=20 >> This is documented in environ(7): >>=20 >> Shared libraries and bundles don't have direct access to environ, = which >> is only available to the loader ld(1) when a complete program is = being >> linked. The environment routines can still be used, but if = direct access >> to environ is needed, the _NSGetEnviron() routine, defined in >> , can be used to retrieve the address of environ = at run- >> time. >>=20 >> The following patch/hack, taken from >> libgfortran/intrinsics/execute_command_line.c, allows the link to >> succeed. Bootstrap still running... >=20 > My preference would be to introduce some new header for this, which = would > say define get_environ inline function, and define it as > static inline char ** > get_environ (void) > { > extern char **environ; > return environ; > } > in libgomp/config/posix/env.h > and to that > #include >=20 > static inline char ** > get_environ (void) > { > return *_NSGetEnviron (); > } > in libgomp/config/darwin/env.h > That way it is easier to override it for other platforms if needed. We already have such a header =E2=80=A6 include/environ.h Iain