Darwin, libgfortran : Do not use environ directly from the library.
On macOS / Darwin, the environ variable can be used directly in the code of an executable, but cannot be used in the code of a shared library (i.e. libgfortran.dylib), in this case. In such cases, the function _NSGetEnviron should be called to get the address of 'environ'. libgfortran/ChangeLog: * intrinsics/execute_command_line.c (environ): Use _NSGetEnviron to get the environment pointer on Darwin.
This commit is contained in:
parent
93f1186f7d
commit
a345413076
|
@ -34,8 +34,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_POSIX_SPAWN
|
#ifdef HAVE_POSIX_SPAWN
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
|
# ifdef __APPLE__
|
||||||
|
# include <crt_externs.h>
|
||||||
|
# define environ (*_NSGetEnviron ())
|
||||||
|
# else
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
#if defined(HAVE_POSIX_SPAWN) || defined(HAVE_FORK)
|
#if defined(HAVE_POSIX_SPAWN) || defined(HAVE_FORK)
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue