diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-09-30 03:19:20 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-30 03:19:21 +0000 |
commit | c5748954561f492fe1c4ea772e0290079af9960b (patch) | |
tree | 3a09c32395d4650ca0d8d52369889d17b578e477 /gcc-4.8 | |
parent | 05021208b41b37d068b4be95b921b3a1222cac09 (diff) | |
parent | c2bbbc54a4871d875e0f034aad73df85679206a2 (diff) | |
download | toolchain_gcc-c5748954561f492fe1c4ea772e0290079af9960b.tar.gz toolchain_gcc-c5748954561f492fe1c4ea772e0290079af9960b.tar.bz2 toolchain_gcc-c5748954561f492fe1c4ea772e0290079af9960b.zip |
Merge "[4.8] Fix darwin gcc fails with gcc-ar which calls lto plugin"
Diffstat (limited to 'gcc-4.8')
-rw-r--r-- | gcc-4.8/libiberty/pex-unix.c | 8 | ||||
-rw-r--r-- | gcc-4.8/libiberty/xmalloc.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.8/libiberty/pex-unix.c b/gcc-4.8/libiberty/pex-unix.c index addf8ee23..1b9fa113b 100644 --- a/gcc-4.8/libiberty/pex-unix.c +++ b/gcc-4.8/libiberty/pex-unix.c @@ -59,6 +59,10 @@ extern int errno; #include <process.h> #endif +#ifdef __APPLE__ +#include <crt_externs.h> +#endif + #ifdef vfork /* Autoconf may define this to fork for us. */ # define VFORK_STRING "fork" #else @@ -389,7 +393,11 @@ pex_child_error (struct pex_obj *obj, const char *executable, /* Execute a child. */ +#ifdef __APPLE__ +#define environ (*_NSGetEnviron()) +#else extern char **environ; +#endif #if defined(HAVE_SPAWNVE) && defined(HAVE_SPAWNVPE) /* Implementation of pex->exec_child using the Cygwin spawn operation. */ diff --git a/gcc-4.8/libiberty/xmalloc.c b/gcc-4.8/libiberty/xmalloc.c index 3e97aab56..726ef6427 100644 --- a/gcc-4.8/libiberty/xmalloc.c +++ b/gcc-4.8/libiberty/xmalloc.c @@ -70,6 +70,10 @@ function will be called to print an error message and terminate execution. #include <stddef.h> +#ifdef __APPLE__ +#include <crt_externs.h> +#endif + #if VMS #include <stdlib.h> #include <unixlib.h> @@ -117,7 +121,11 @@ void xmalloc_failed (size_t size) { #ifdef HAVE_SBRK +#ifdef __APPLE__ + #define environ (*_NSGetEnviron()) +#else extern char **environ; +#endif size_t allocated; if (first_break != NULL) |