remove old arm-elf scripts

This commit is contained in:
Dave Murphy 2006-07-02 23:20:45 +00:00
parent c610e2dc59
commit 5f07728304
2 changed files with 65 additions and 78 deletions

View File

@ -6,14 +6,12 @@
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# specify some urls to download the source packages from # specify some urls to download the source packages from
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
NEWLIB_VER=1.14.0
LIBOGC_VER=20050812 LIBOGC_VER=20050812
LIBGBA_VER=20060601 LIBGBA_VER=20060601
LIBNDS_VER=20060601 LIBNDS_VER=20060601
LIBMIRKO_VER=0.9.6 LIBMIRKO_VER=0.9.6
ELF2FLT_VER=20060506 ELF2FLT_VER=20060506
NEWLIB="newlib-$NEWLIB_VER.tar.gz"
LIBOGC="libogc-src-$LIBOGC_VER.tar.bz2" LIBOGC="libogc-src-$LIBOGC_VER.tar.bz2"
LIBGBA="libgba-src-$LIBGBA_VER.tar.bz2" LIBGBA="libgba-src-$LIBGBA_VER.tar.bz2"
LIBNDS="libnds-src-$LIBNDS_VER.tar.bz2" LIBNDS="libnds-src-$LIBNDS_VER.tar.bz2"
@ -26,8 +24,17 @@ LIBGBA_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$LIBGBA"
LIBNDS_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$LIBNDS" LIBNDS_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$LIBNDS"
LIBMIRKO_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$LIBMIRKO" LIBMIRKO_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$LIBMIRKO"
ELF2FLT_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$ELF2FLT" ELF2FLT_URL="http://$SFMIRROR.dl.sourceforge.net/sourceforge/devkitpro/$ELF2FLT"
NEWLIB_VER=1.14.0
NEWLIB="newlib-$NEWLIB_VER.tar.gz"
NEWLIB_URL="ftp://sources.redhat.com/pub/newlib/$NEWLIB" NEWLIB_URL="ftp://sources.redhat.com/pub/newlib/$NEWLIB"
BINUTILS_VER=2.17
BINUTILS="binutils-$BINUTILS_VER.tar.bz2"
BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/$BINUTILS"
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# Ask whether to download the source packages or not # Ask whether to download the source packages or not
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -42,10 +49,9 @@ do
echo "1: build devkitARM (gba gp32 ds)" echo "1: build devkitARM (gba gp32 ds)"
echo "2: build devkitPPC (gamecube)" echo "2: build devkitPPC (gamecube)"
echo "3: build devkitPSP (PSP)" echo "3: build devkitPSP (PSP)"
echo "4: build devkitARM eabi (gba gp32 ds)"
read VERSION read VERSION
if [ "$VERSION" -ne 1 -a "$VERSION" -ne 2 -a "$VERSION" -ne 3 -a "$VERSION" -ne 4 ] if [ "$VERSION" -ne 1 -a "$VERSION" -ne 2 -a "$VERSION" -ne 3 ]
then then
VERSION=0 VERSION=0
fi fi
@ -63,24 +69,14 @@ GCC_GPP="gcc-g++-$GCC_VER.tar.bz2"
GCC_CORE_URL="http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/$GCC_CORE" GCC_CORE_URL="http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/$GCC_CORE"
GCC_GPP_URL="http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/$GCC_GPP" GCC_GPP_URL="http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/$GCC_GPP"
if [ $VERSION -eq 4 ]
then
BINUTILS_VER=2.16.93
BINUTILS="binutils-$BINUTILS_VER.tar.bz2"
BINUTILS_URL="ftp://sourceware.org/pub/binutils/snapshots/$BINUTILS"
else
BINUTILS_VER=2.16.1
BINUTILS="binutils-$BINUTILS_VER.tar.bz2"
BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/$BINUTILS"
fi
if [ $VERSION -eq 1 ] if [ $VERSION -eq 1 ]
then then
basedir='dkarm' basedir='dkarm-eabi'
package=devkitARM package=devkitARM
builddir=arm-elf builddir=arm-eabi
target=arm-elf target=arm-eabi
toolchain=DEVKITARM toolchain=DEVKITARM
fi fi
@ -110,15 +106,6 @@ then
fi fi
fi fi
if [ $VERSION -eq 4 ]
then
basedir='dkarm-eabi'
package=devkitARM
builddir=arm-eabi
target=arm-eabi
toolchain=DEVKITARM
fi
DOWNLOAD=0 DOWNLOAD=0
while [ $DOWNLOAD -eq 0 ] while [ $DOWNLOAD -eq 0 ]
@ -202,7 +189,7 @@ then
FOUND=1 FOUND=1
fi fi
if [ $VERSION -eq 1 -o $VERSION -eq 4 ] if [ $VERSION -eq 1 ]
then then
if [ ! -f $SRCDIR/$LIBGBA ] if [ ! -f $SRCDIR/$LIBGBA ]
then then
@ -264,7 +251,7 @@ else
fi fi
if [ $VERSION -eq 1 -o $VERSION -eq 4 ] if [ $VERSION -eq 1 ]
then then
$WGET -c $LIBNDS_URL || { echo "Error: Failed to download "$LIBNDS; exit; } $WGET -c $LIBNDS_URL || { echo "Error: Failed to download "$LIBNDS; exit; }
$WGET -c $LIBGBA_URL || { echo "Error: Failed to download "$LIBGBA; exit; } $WGET -c $LIBGBA_URL || { echo "Error: Failed to download "$LIBGBA; exit; }
@ -340,7 +327,7 @@ then
fi fi
if [ $VERSION -eq 1 -o $VERSION -eq 4 ] if [ $VERSION -eq 1 ]
then then
echo "Extracting $LIBNDS" echo "Extracting $LIBNDS"
mkdir -p $LIBNDS_SRCDIR mkdir -p $LIBNDS_SRCDIR
@ -401,7 +388,7 @@ rm -fr $BINUTILS_SRCDIR
rm -fr $NEWLIB_SRCDIR rm -fr $NEWLIB_SRCDIR
rm -fr $GCC_SRCDIR rm -fr $GCC_SRCDIR
if [ $VERSION -eq 1 -o $VERSION -eq 4 ] if [ $VERSION -eq 1 ]
then then
rm -fr $LIBOGC_SRCDIR $LIBGBA_SRCDIR $LIBNDS_SRCDIR $LIBMIRKO_SRCDIR rm -fr $LIBOGC_SRCDIR $LIBGBA_SRCDIR $LIBNDS_SRCDIR $LIBMIRKO_SRCDIR
fi fi

View File

@ -3,7 +3,7 @@ diff -Nbaur gcc-4.1.1/gcc/c-incpath.c gcc-4.1.1-arm/gcc/c-incpath.c
+++ gcc-4.1.1-arm/gcc/c-incpath.c Mon Jun 5 06:58:56 2006 +++ gcc-4.1.1-arm/gcc/c-incpath.c Mon Jun 5 06:58:56 2006
@@ -331,13 +331,18 @@ @@ -331,13 +331,18 @@
cpp_dir *p; cpp_dir *p;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Convert all backslashes to slashes. The native CRT stat() - /* Convert all backslashes to slashes. The native CRT stat()
- function does not recognize a directory that ends in a backslash - function does not recognize a directory that ends in a backslash
@ -21,11 +21,11 @@ diff -Nbaur gcc-4.1.1/gcc/c-incpath.c gcc-4.1.1-arm/gcc/c-incpath.c
+ char* end = path + pathlen - 1; + char* end = path + pathlen - 1;
+ /* Preserve the lead '/' or lead "c:/". */ + /* Preserve the lead '/' or lead "c:/". */
+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); + char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1);
+ +
+ for (; end > start && IS_DIR_SEPARATOR (*end); end--) + for (; end > start && IS_DIR_SEPARATOR (*end); end--)
+ *end = 0; + *end = 0;
#endif #endif
p = xmalloc (sizeof (cpp_dir)); p = xmalloc (sizeof (cpp_dir));
diff -Nbaur gcc-4.1.1/gcc/gcc.c gcc-4.1.1-arm/gcc/gcc.c diff -Nbaur gcc-4.1.1/gcc/gcc.c gcc-4.1.1-arm/gcc/gcc.c
--- gcc-4.1.1/gcc/gcc.c Wed May 17 19:38:58 2006 --- gcc-4.1.1/gcc/gcc.c Wed May 17 19:38:58 2006
@ -40,20 +40,20 @@ diff -Nbaur gcc-4.1.1/gcc/gcc.c gcc-4.1.1-arm/gcc/gcc.c
else else
gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix, gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix,
@@ -6148,10 +6146,21 @@ @@ -6148,10 +6146,21 @@
/* We need to check standard_exec_prefix/just_machine_suffix/specs /* We need to check standard_exec_prefix/just_machine_suffix/specs
for any override of as, ld and libraries. */ for any override of as, ld and libraries. */
+ if ( gcc_exec_prefix ) + if ( gcc_exec_prefix )
+ { + {
+ specs_file = alloca (strlen (gcc_exec_prefix) + specs_file = alloca (strlen (gcc_exec_prefix)
+ + strlen (just_machine_suffix) + sizeof ("specs")); + + strlen (just_machine_suffix) + sizeof ("specs"));
+ +
+ strcpy (specs_file, gcc_exec_prefix); + strcpy (specs_file, gcc_exec_prefix);
+ } else { + } else {
+ +
specs_file = alloca (strlen (standard_exec_prefix) specs_file = alloca (strlen (standard_exec_prefix)
+ strlen (just_machine_suffix) + sizeof ("specs")); + strlen (just_machine_suffix) + sizeof ("specs"));
strcpy (specs_file, standard_exec_prefix); strcpy (specs_file, standard_exec_prefix);
+ +
+ } + }
@ -67,7 +67,7 @@ diff -Nbaur gcc-4.1.1/gcc/prefix.c gcc-4.1.1-arm/gcc/prefix.c
@@ -246,13 +246,16 @@ @@ -246,13 +246,16 @@
The returned string is always malloc-ed, and the caller is The returned string is always malloc-ed, and the caller is
responsible for freeing it. */ responsible for freeing it. */
+ +
+static const char *old_prefix = PREFIX; +static const char *old_prefix = PREFIX;
+ +
@ -77,7 +77,7 @@ diff -Nbaur gcc-4.1.1/gcc/prefix.c gcc-4.1.1-arm/gcc/prefix.c
char *result, *p; char *result, *p;
- const int len = strlen (std_prefix); - const int len = strlen (std_prefix);
+ const int len = strlen (old_prefix); + const int len = strlen (old_prefix);
- if (! strncmp (path, std_prefix, len) - if (! strncmp (path, std_prefix, len)
+ if (! strncmp (path, old_prefix, len) + if (! strncmp (path, old_prefix, len)
&& (IS_DIR_SEPARATOR(path[len]) && (IS_DIR_SEPARATOR(path[len])
@ -98,39 +98,39 @@ diff -Nbaur gcc-4.1.1/gcc/toplev.c gcc-4.1.1-arm/gcc/toplev.c
#include "alloc-pool.h" #include "alloc-pool.h"
#include "tree-mudflap.h" #include "tree-mudflap.h"
+#include "prefix.h" +#include "prefix.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO) #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h" #include "dwarf2out.h"
@@ -1434,6 +1435,10 @@ @@ -1434,6 +1435,10 @@
progname = p; progname = p;
xmalloc_set_program_name (progname); xmalloc_set_program_name (progname);
+ +
+ p = getenv("GCC_EXEC_PREFIX"); + p = getenv("GCC_EXEC_PREFIX");
+ if (p && strlen(p)) set_std_prefix (p, strlen(p)); + if (p && strlen(p)) set_std_prefix (p, strlen(p));
+ +
hex_init (); hex_init ();
diff -Nbaur gcc-4.1.1/gcc/version.c gcc-4.1.1-arm/gcc/version.c diff -Nbaur gcc-4.1.1/gcc/version.c gcc-4.1.1-arm/gcc/version.c
--- gcc-4.1.1/gcc/version.c Wed Mar 16 06:04:10 2005 --- gcc-4.1.1/gcc/version.c Wed Mar 16 06:04:10 2005
+++ gcc-4.1.1-arm/gcc/version.c Wed Jun 7 16:14:31 2006 +++ gcc-4.1.1-arm/gcc/version.c Wed Jun 7 16:14:31 2006
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
in parentheses. You may also wish to include a number indicating in parentheses. You may also wish to include a number indicating
the revision of your modified compiler. */ the revision of your modified compiler. */
-#define VERSUFFIX "" -#define VERSUFFIX ""
+#define VERSUFFIX " (devkitARM release 19a)" +#define VERSUFFIX " (devkitARM release 20)"
/* This is the location of the online document giving instructions for /* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC, reporting bugs. If you distribute a modified version of GCC,
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
forward us bugs reported to you, if you determine that they are forward us bugs reported to you, if you determine that they are
not bugs in your modifications.) */ not bugs in your modifications.) */
-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>"; -const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
+const char bug_report_url[] = "<URL:http://devkitpro.sourceforge.net/bugs.shtml>"; +const char bug_report_url[] = "<URL:http://devkitpro.sourceforge.net/bugs.shtml>";
/* The complete version string, assembled from several pieces. /* The complete version string, assembled from several pieces.
BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
@ -141,13 +141,13 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
#include <signal.h> #include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
+#include <errno.h> +#include <errno.h>
/* mingw32 headers may not define the following. */ /* mingw32 headers may not define the following. */
@@ -72,115 +73,6 @@ @@ -72,115 +73,6 @@
return; return;
} }
-/* This is a kludge to get around the Microsoft C spawn functions' propensity -/* This is a kludge to get around the Microsoft C spawn functions' propensity
- to remove the outermost set of double quotes from all arguments. */ - to remove the outermost set of double quotes from all arguments. */
- -
@ -263,7 +263,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
@@ -422,8 +314,225 @@ @@ -422,8 +314,225 @@
} }
#endif #endif
+/* Return a Windows command-line from ARGV. It is the caller's +/* Return a Windows command-line from ARGV. It is the caller's
+ responsibility to free the string returned. */ + responsibility to free the string returned. */
+ +
@ -448,9 +448,9 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ cmdline = argv_to_cmdline (argv); + cmdline = argv_to_cmdline (argv);
+ if (!cmdline) + if (!cmdline)
+ goto error; + goto error;
+ +
+ /* Create the child process. */ + /* Create the child process. */
+ if (!CreateProcess (full_executable, cmdline, + if (!CreateProcess (full_executable, cmdline,
+ /*lpProcessAttributes=*/NULL, + /*lpProcessAttributes=*/NULL,
+ /*lpThreadAttributes=*/NULL, + /*lpThreadAttributes=*/NULL,
+ /*bInheritHandles=*/TRUE, + /*bInheritHandles=*/TRUE,
@ -492,23 +492,23 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
if (!executable) if (!executable)
executable = executable1; executable = executable1;
- pid = _spawnvp (_P_NOWAIT, executable, argv); - pid = _spawnvp (_P_NOWAIT, executable, argv);
+ pid = win32_spawn (executable, TRUE, argv, + pid = win32_spawn (executable, TRUE, argv,
+ dwCreationFlags, si, pi); + dwCreationFlags, si, pi);
#else #else
if (strchr (executable1, '\\') == NULL) if (strchr (executable1, '\\') == NULL)
- pid = _spawnvp (_P_NOWAIT, executable1, argv); - pid = _spawnvp (_P_NOWAIT, executable1, argv);
+ pid = win32_spawn (executable1, TRUE, argv, + pid = win32_spawn (executable1, TRUE, argv,
+ dwCreationFlags, si, pi); + dwCreationFlags, si, pi);
else if (executable1[0] != '\\') else if (executable1[0] != '\\')
- pid = _spawnv (_P_NOWAIT, executable1, argv); - pid = _spawnv (_P_NOWAIT, executable1, argv);
+ pid = win32_spawn (executable1, FALSE, argv, + pid = win32_spawn (executable1, FALSE, argv,
+ dwCreationFlags, si, pi); + dwCreationFlags, si, pi);
else else
{ {
const char *newex = mingw_rootify (executable1); const char *newex = mingw_rootify (executable1);
*avhere = newex; *avhere = newex;
- pid = _spawnv (_P_NOWAIT, newex, argv); - pid = _spawnv (_P_NOWAIT, newex, argv);
+ pid = win32_spawn (newex, FALSE, argv, + pid = win32_spawn (newex, FALSE, argv,
+ dwCreationFlags, si, pi); + dwCreationFlags, si, pi);
if (executable1 != newex) if (executable1 != newex)
free ((char *) newex); free ((char *) newex);
@ -518,7 +518,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
{ {
*avhere = newex; *avhere = newex;
- pid = _spawnv (_P_NOWAIT, newex, argv); - pid = _spawnv (_P_NOWAIT, newex, argv);
+ pid = win32_spawn (newex, FALSE, argv, + pid = win32_spawn (newex, FALSE, argv,
+ dwCreationFlags, si, pi); + dwCreationFlags, si, pi);
free ((char *) newex); free ((char *) newex);
} }
@ -575,7 +575,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ stderr_handle = (HANDLE) _get_osfhandle (errdes); + stderr_handle = (HANDLE) _get_osfhandle (errdes);
+ else + else
+ stderr_handle = stdout_handle; + stderr_handle = stdout_handle;
- if (out != STDOUT_FILE_NO) - if (out != STDOUT_FILE_NO)
- { - {
- org_out = _dup (STDOUT_FILE_NO); - org_out = _dup (STDOUT_FILE_NO);
@ -593,7 +593,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
- } - }
- if (_close (out) < 0) - if (_close (out) < 0)
+ /* Determine the version of Windows we are running on. */ + /* Determine the version of Windows we are running on. */
+ version_info.dwOSVersionInfoSize = sizeof (version_info); + version_info.dwOSVersionInfoSize = sizeof (version_info);
+ GetVersionEx (&version_info); + GetVersionEx (&version_info);
+ if (version_info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + if (version_info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
+ /* On Windows 95/98/ME the CREATE_NO_WINDOW flag is not + /* On Windows 95/98/ME the CREATE_NO_WINDOW flag is not
@ -607,7 +607,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
- } - }
- } - }
+ HANDLE conout_handle; + HANDLE conout_handle;
- if (errdes != STDERR_FILE_NO - if (errdes != STDERR_FILE_NO
- || (flags & PEX_STDERR_TO_STDOUT) != 0) - || (flags & PEX_STDERR_TO_STDOUT) != 0)
- { - {
@ -629,7 +629,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
- { - {
- if (_close (errdes) < 0) - if (_close (errdes) < 0)
+ /* Determine whether or not we have an associated console. */ + /* Determine whether or not we have an associated console. */
+ conout_handle = CreateFile("CONOUT$", + conout_handle = CreateFile("CONOUT$",
+ GENERIC_WRITE, + GENERIC_WRITE,
+ FILE_SHARE_WRITE, + FILE_SHARE_WRITE,
+ /*lpSecurityAttributes=*/NULL, + /*lpSecurityAttributes=*/NULL,
@ -641,9 +641,9 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ the child is a console process, the OS would normally + the child is a console process, the OS would normally
+ create a new console Window for the child. Since we'll be + create a new console Window for the child. Since we'll be
+ redirecting the child's standard streams, we do not need + redirecting the child's standard streams, we do not need
+ the console window. */ + the console window. */
+ dwCreationFlags = CREATE_NO_WINDOW; + dwCreationFlags = CREATE_NO_WINDOW;
+ else + else
{ {
- *err = errno; - *err = errno;
- *errmsg = "_close"; - *errmsg = "_close";
@ -659,7 +659,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ dwCreationFlags = 0; + dwCreationFlags = 0;
} }
} }
- newargv = fix_argv (argv); - newargv = fix_argv (argv);
- pid = (((flags & PEX_SEARCH) != 0 ? _spawnvp : _spawnv) - pid = (((flags & PEX_SEARCH) != 0 ? _spawnvp : _spawnv)
- (_P_NOWAIT, executable, newargv)); - (_P_NOWAIT, executable, newargv));
@ -677,7 +677,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ si.hStdOutput = stdout_handle; + si.hStdOutput = stdout_handle;
+ si.hStdError = stderr_handle; + si.hStdError = stderr_handle;
+ +
+ /* Create the child process. */ + /* Create the child process. */
+ pid = win32_spawn (executable, (flags & PEX_SEARCH) != 0, + pid = win32_spawn (executable, (flags & PEX_SEARCH) != 0,
+ argv, dwCreationFlags, &si, &pi); + argv, dwCreationFlags, &si, &pi);
if (pid == -1) if (pid == -1)
@ -723,7 +723,7 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ *err = ENOENT; + *err = ENOENT;
+ *errmsg = "CreateProcess"; + *errmsg = "CreateProcess";
} }
- if (errdes != STDERR_FILE_NO - if (errdes != STDERR_FILE_NO
- || (flags & PEX_STDERR_TO_STDOUT) != 0) - || (flags & PEX_STDERR_TO_STDOUT) != 0)
- { - {
@ -741,12 +741,12 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
- } - }
- } - }
+ /* Close the standard output and standard error handles in the + /* Close the standard output and standard error handles in the
+ parent. */ + parent. */
+ if (out != STDOUT_FILENO) + if (out != STDOUT_FILENO)
+ obj->funcs->close (obj, out); + obj->funcs->close (obj, out);
+ if (errdes != STDERR_FILENO) + if (errdes != STDERR_FILENO)
+ obj->funcs->close (obj, errdes); + obj->funcs->close (obj, errdes);
return pid; return pid;
} }
@@ -656,30 +716,34 @@ @@ -656,30 +716,34 @@
@ -756,10 +756,10 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
- int termstat; - int termstat;
+ DWORD termstat; + DWORD termstat;
+ HANDLE h; + HANDLE h;
if (time != NULL) if (time != NULL)
memset (time, 0, sizeof *time); memset (time, 0, sizeof *time);
+ h = (HANDLE) pid; + h = (HANDLE) pid;
+ +
/* FIXME: If done is non-zero, we should probably try to kill the /* FIXME: If done is non-zero, we should probably try to kill the
@ -775,14 +775,14 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
+ *errmsg = "WaitForSingleObject"; + *errmsg = "WaitForSingleObject";
return -1; return -1;
} }
- /* cwait returns the child process exit code in termstat. A value - /* cwait returns the child process exit code in termstat. A value
- of 3 indicates that the child caught a signal, but not which one. - of 3 indicates that the child caught a signal, but not which one.
- Since only SIGABRT, SIGFPE and SIGINT do anything, we report - Since only SIGABRT, SIGFPE and SIGINT do anything, we report
- SIGABRT. */ - SIGABRT. */
+ GetExitCodeProcess (h, &termstat); + GetExitCodeProcess (h, &termstat);
+ CloseHandle (h); + CloseHandle (h);
+ /* A value of 3 indicates that the child caught a signal, but not + /* A value of 3 indicates that the child caught a signal, but not
+ which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we + which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we
+ report SIGABRT. */ + report SIGABRT. */
@ -791,6 +791,6 @@ diff -Nbaur gcc-4.1.1/libiberty/pex-win32.c gcc-4.1.1-arm/libiberty/pex-win32.c
else else
- *status = ((termstat & 0xff) << 8); - *status = ((termstat & 0xff) << 8);
+ *status = (termstat & 0xff) << 8; + *status = (termstat & 0xff) << 8;
return 0; return 0;
} }