> On 09 Jan 2015, at 00:42, Iain Sandoe <i...@codesourcery.com> wrote:
> 
> 
> On 8 Jan 2015, at 13:52, Tristan Gingold wrote:
> 
>> 
>>> On 08 Jan 2015, at 13:49, Iain Sandoe <i...@codesourcery.com> wrote:
>>> 
>>> Hi Tristan,
>>> 
>>> On 7 Jan 2015, at 10:15, Arnaud Charlet wrote:
>>> 
>>>> Use _NSGetEnviron to get environment.
>>>> 
>>>> Tested on x86_64-pc-linux-gnu, committed on trunk
>>>> 
>>>> 2015-01-07  Tristan Gingold  <ging...@adacore.com>
>>>> 
>>>>    PR ada/64349
>>>>    * env.c (__gnat_environ): Adjust for darwin9/darwin10.
>>>> 
>>>> <difs.txt>
>>> 
>>> So my original patch assumed that, while it was not legal to use environ 
>>> from a shlib, it is legal to use _NSGetEnviron () from an application ...
>>> 
>>> .. and, OK fine, I see the point about ! defined (__arm__) .. but a few 
>>> other comments.
>>> 
>>> ISTM that there's a partial implementation to distinguish between IN_RTS 
>>> and application?
>> 
>> Yes you're right.  The added code should have been added after the #endif 
>> for IN_RTS.
> 
> How about this?
> It uses the interface where needed, avoids it for main exes and gets rid of 
> the negative conditional (which IMO makes the code a little more readable).
> 
> Iain
> 
> P.S. this is not Darwin9/10 - specific the only reason it doesn't fail on 
> Darwin >= 11 is because they default to -undefined dynamic_lookup .. and so 
> find the symbol from the exe.

Sorry for the late answer.  We did something slightly different: always 
#include crt_externs.h on no-arm Darwin.

Tristan.

Reply via email to