From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.wavenetuk.net (unknown [195.26.37.10]) by sourceware.org (Postfix) with ESMTP id B4738386100A; Sat, 21 Nov 2020 09:46:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B4738386100A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id C404C6000EB; Sat, 21 Nov 2020 09:46:52 +0000 (GMT) Content-Type: text/plain; charset=utf-8; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] Darwin, libgfortran : Do not use environ directly from the library. From: Iain Sandoe In-Reply-To: Date: Sat, 21 Nov 2020 09:46:26 +0000 Cc: Fortran List , GCC Patches Content-Transfer-Encoding: 8bit Message-Id: References: <573D3BC5-53B5-4B29-8C03-5B8D60B5B485@sandoe.co.uk> To: Thomas Koenig X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, MAY_BE_FORGED, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2020 09:46:55 -0000 Hi Thomas, Thomas Koenig via Fortran wrote: >> >> tested on a number of Darwin platforms old and new, and on >> x86_64/powerpc64-linux, >> OK for master? >> … and backports to open branches? > > One question... > >> +# ifdef __APPLE__ >> +# include >> +# define environ (*_NSGetEnviron ()) > > Is it guaranteed that crt_externs.h is present if __APPLE__ > is defined? __APPLE__ is defined by GCC when targetting macOS (actually by other compilers too, although that’s probably not important for building libgfortran). The header is present on all macOS systems supported by GCC (and at least two revisions prior to the earliest that currently builds GCC open branches). Of course, a user with -D on the command line can define it .. but then will get a build error - which is fine __APPLE__ is in the implementation namespace, the user gets what they deserve ;) We could be paranoid and write #if defined (__APPLE__) && __has_include() but that seems over the top here. > If that's the case, OK for master and backports. applied to master, will deal with the backports along with other Darwin ones. thanks Iain