aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2009-01-13 07:40:51 +0000
committerDanny Smith <dannysmith@gcc.gnu.org>2009-01-13 07:40:51 +0000
commit5d14e3d50aa995f8d37c82ace354fe41927e785c (patch)
tree3f7c5ca3e23fdea50a256e973920401af30e8d03 /gcc/gcc.c
parent2e50357552c03e8da8cdf351242d4617cd9efced (diff)
downloadgcc-5d14e3d50aa995f8d37c82ace354fe41927e785c.zip
gcc-5d14e3d50aa995f8d37c82ace354fe41927e785c.tar.gz
gcc-5d14e3d50aa995f8d37c82ace354fe41927e785c.tar.bz2
re PR bootstrap/38580 (Bootstrap broken on mingw32)
PR bootstrap/38580 * gcc.c (process_command): Replace call to execvp with calls to pex_one and exit. From-SVN: r143330
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 8e1938b..e85d25d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1,6 +1,6 @@
/* Compiler driver program that can handle many languages.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
@@ -3382,6 +3382,9 @@ process_command (int argc, const char **argv)
char **new_argv;
char *new_argv0;
int baselen;
+ int status = 0;
+ int err = 0;
+ const char *errmsg;
while (argc > 1 && argv[1][0] == '-'
&& (argv[1][1] == 'V'
@@ -3424,8 +3427,18 @@ process_command (int argc, const char **argv)
new_argv = XDUPVEC (char *, argv, argc + 1);
new_argv[0] = new_argv0;
- execvp (new_argv0, new_argv);
- fatal ("couldn't run '%s': %s", new_argv0, xstrerror (errno));
+ errmsg = pex_one (PEX_SEARCH, new_argv0, new_argv, progname, NULL,
+ NULL, &status, &err);
+
+ if (errmsg)
+ {
+ if (err == 0)
+ fatal ("couldn't run '%s': %s", new_argv0, errmsg);
+ else
+ fatal ("couldn't run '%s': %s: %s", new_argv0, errmsg,
+ xstrerror (err));
+ }
+ exit (status);
}
/* Set up the default search paths. If there is no GCC_EXEC_PREFIX,