From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29606 invoked by alias); 3 Aug 2007 15:32:20 -0000 Received: (qmail 29202 invoked by uid 22791); 3 Aug 2007 15:32:17 -0000 X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 15:32:13 +0000 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.13.7/8.13.7/ROSCH/DDB) with ESMTP id l73FVkfe028770; Fri, 3 Aug 2007 17:31:51 +0200 To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org, binutils@sourceware.org Subject: patch: libiberty pex for _WIN64 MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Kai Tietz Date: Fri, 03 Aug 2007 15:32:00 -0000 Content-Type: multipart/mixed; boundary="=_mixed 00554DD9C125732C_=" X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00051.txt.bz2 --=_mixed 00554DD9C125732C_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Content-length: 1957 SWFuLA0KDQpTb3JyeSwgSSBtaXNzZWQgdG8gYXR0YWNoIHRoZSBwYXRjaCA4 KQ0KDQpJIHByZXBhcmVkIGEgcGF0Y2ggZm9yIHBleCB1c2luZyBwaWRfdCBp bnN0ZWFkIG9mIHRoZSB0eXBlICdsb25nJyBmb3IgDQpzeXN0ZW0gaGFuZGxl cy4gVGhpcyBpcyBuZWNlc3NhcnkgZm9yIF9XSU42NCwgYmVjYXVzZSB0aGUg bG9uZyB0eXBlIGlzbid0IA0Kd2lkZSBlbm91Z3RoIHRvIGhvbGQgYSBwb2lu dGVyIGZvciB0aGlzIEFC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Ljc4MDA0LjAgLSBGYXg6ICs0OS4oMCk5NDEuNzgwMDQuNDg5 IC0gd3d3Lk9uZVZpc2lvbi5jb20NCiAgQ29tbWVyemJhbmsgUmVnZW5zYnVy ZyAtIEJMWiA3NTAgNDAwIDYyIC0gS29udG8gNjAxMTA1MA0KICBIYW5kZWxz cmVnaXN0ZXI6IEhSQSA2NzQ0LCBBbXRzZ2VyaWNodCBSZWdlbnNidXJnDQog IEtvbXBsZW1lbnTDpHJpbjogT25lVmlzaW9uIFNvZnR3YXJlIEVudHdpY2ts dW5ncyBWZXJ3YWx0dW5ncyBHbWJIDQogIERyLi1MZW8tUml0dGVyLVN0cmHD n2UgOSDigJMgOTMwNDkgUmVnZW5zYnVyZw0KICBIYW5kZWxzcmVnaXN0ZXI6 IEhSQiA4OTMyLCBBbXRzZ2VyaWNodCBSZWdlbnNidXJnIC0gR2VzY2jDpGZ0 c2bDvGhyZXI6IA0KVWxyaWtlIETDtmhsZXIsIE1hbnVlbGEgS2x1Z2VyDQoN Cg== --=_mixed 00554DD9C125732C_= Content-Type: text/plain; name="libi_pex.txt" Content-Disposition: attachment; filename="libi_pex.txt" Content-Transfer-Encoding: quoted-printable Content-length: 15214 Index: gcc/libiberty/pex-common.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/libiberty/pex-common.h +++ gcc/libiberty/pex-common.h @@ -108,7 +108,7 @@ struct pex_funcs closed in the child process. The function should handle the PEX_STDERR_TO_STDOUT flag. Return >=3D 0 on success, or -1 on error and set *ERRMSG and *ERR. */ - long (*exec_child) (struct pex_obj *, int /* flags */, + pid_t (*exec_child) (struct pex_obj *, int /* flags */, const char */* executable */, char * const * /* argv= */, char * const * /* env */, int /* in */, int /* out */, int /* errdes */, @@ -120,7 +120,7 @@ struct pex_funcs and time in *TIME (if it is not null). CHILD is from fork. DONE is 1 if this is called via pex_free. ERRMSG and ERR are as in fork. Return 0 on success, -1 on error. */ - int (*wait) (struct pex_obj *, long /* child */, int * /* status */, + int (*wait) (struct pex_obj *, pid_t /* child */, int * /* status */, struct pex_time * /* time */, int /* done */, const char ** /* errmsg */, int * /* err */); /* Create a pipe (only called if PEX_USE_PIPES is set) storing two Index: gcc/libiberty/pex-djgpp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/libiberty/pex-djgpp.c +++ gcc/libiberty/pex-djgpp.c @@ -44,12 +44,12 @@ extern int errno; =20 static int pex_djgpp_open_read (struct pex_obj *, const char *, int); static int pex_djgpp_open_write (struct pex_obj *, const char *, int); -static long pex_djgpp_exec_child (struct pex_obj *, int, const char *, +static pid_t pex_djgpp_exec_child (struct pex_obj *, int, const char *, char * const *, char * const *, int, int, int, int, const char **, int *); static int pex_djgpp_close (struct pex_obj *, int); -static int pex_djgpp_wait (struct pex_obj *, long, int *, struct pex_time = *, +static int pex_djgpp_wait (struct pex_obj *, pid_t, int *, struct pex_time= *, int, const char **, int *); =20 /* The list of functions we pass to the common routines. */ @@ -110,7 +110,7 @@ pex_djgpp_close (struct pex_obj *obj ATT =20 /* Execute a child. */ =20 -static long +static pid_t pex_djgpp_exec_child (struct pex_obj *obj, int flags, const char *executab= le, char * const * argv, char * const * env, int in, int out, int errdes, @@ -132,19 +132,19 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "dup"; - return -1; + return (pid_t) -1; } if (dup2 (in, STDIN_FILE_NO) < 0) { *err =3D errno; *errmsg =3D "dup2"; - return -1; + return (pid_t) -1; } if (close (in) < 0) { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } =20 @@ -155,19 +155,19 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "dup"; - return -1; + return (pid_t) -1; } if (dup2 (out, STDOUT_FILE_NO) < 0) { *err =3D errno; *errmsg =3D "dup2"; - return -1; + return (pid_t) -1; } if (close (out) < 0) { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } =20 @@ -179,14 +179,14 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "dup"; - return -1; + return (pid_t) -1; } if (dup2 ((flags & PEX_STDERR_TO_STDOUT) !=3D 0 ? STDOUT_FILE_NO : e= rrdes, STDERR_FILE_NO) < 0) { *err =3D errno; *errmsg =3D "dup2"; - return -1; + return (pid_t) -1; } if (errdes !=3D STDERR_FILE_NO) { @@ -194,7 +194,7 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } } @@ -218,13 +218,13 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "dup2"; - return -1; + return (pid_t) -1; } if (close (org_in) < 0) { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } =20 @@ -234,13 +234,13 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "dup2"; - return -1; + return (pid_t) -1; } if (close (org_out) < 0) { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } =20 @@ -251,13 +251,13 @@ pex_djgpp_exec_child (struct pex_obj *ob { *err =3D errno; *errmsg =3D "dup2"; - return -1; + return (pid_t) -1; } if (close (org_errdes) < 0) { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } =20 @@ -269,7 +269,7 @@ pex_djgpp_exec_child (struct pex_obj *ob statuses[obj->count] =3D status; obj->sysdep =3D (void *) statuses; =20 - return obj->count; + return (pid_t) obj->count; } =20 /* Wait for a child process to complete. Actually the child process @@ -277,7 +277,7 @@ pex_djgpp_exec_child (struct pex_obj *ob status. */ =20 static int -pex_djgpp_wait (struct pex_obj *obj, long pid, int *status, +pex_djgpp_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED, int *err ATTRIBUTE_UNUSED) Index: gcc/libiberty/pex-msdos.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/libiberty/pex-msdos.c +++ gcc/libiberty/pex-msdos.c @@ -54,12 +54,12 @@ struct pex_msdos static int pex_msdos_open (struct pex_obj *, const char *, int); static int pex_msdos_open (struct pex_obj *, const char *, int); static int pex_msdos_fdindex (struct pex_msdos *, int); -static long pex_msdos_exec_child (struct pex_obj *, int, const char *, +static pid_t pex_msdos_exec_child (struct pex_obj *, int, const char *, char * const *, char * const *, int, int, int, int, int, const char **, int *); static int pex_msdos_close (struct pex_obj *, int); -static int pex_msdos_wait (struct pex_obj *, long, int *, struct pex_time = *, +static int pex_msdos_wait (struct pex_obj *, pid_t, int *, struct pex_time= *, int, const char **, int *); static void pex_msdos_cleanup (struct pex_obj *); =20 @@ -152,7 +152,7 @@ pex_msdos_close (struct pex_obj *obj, in =20 /* Execute a child. */ =20 -static long +static pid_t pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executab= le, char * const * argv, char * const * env, int in, int out, int toclose ATTRIBUTE_UNUSED, @@ -235,7 +235,7 @@ pex_msdos_exec_child (struct pex_obj *ob free (scmd); free (rf); *errmsg =3D "cannot open temporary command file"; - return -1; + return (pid_t) -1; } =20 for (i =3D 1; argv[i] !=3D NULL; ++i) @@ -262,7 +262,7 @@ pex_msdos_exec_child (struct pex_obj *ob free (scmd); free (rf); *errmsg =3D "system"; - return -1; + return (pid_t) -1; } =20 remove (rf); @@ -275,7 +275,7 @@ pex_msdos_exec_child (struct pex_obj *ob ms->statuses =3D XRESIZEVEC(int, ms->statuses, obj->count + 1); ms->statuses[obj->count] =3D status; =20 - return obj->count; + return (pid_t) obj->count; } =20 /* Wait for a child process to complete. Actually the child process @@ -283,7 +283,7 @@ pex_msdos_exec_child (struct pex_obj *ob status. */ =20 static int -pex_msdos_wait (struct pex_obj *obj, long pid, int *status, +pex_msdos_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED, int *err ATTRIBUTE_UNUSED) Index: gcc/libiberty/pex-unix.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/libiberty/pex-unix.c +++ gcc/libiberty/pex-unix.c @@ -269,12 +269,12 @@ static void pex_child_error (struct pex_ ATTRIBUTE_NORETURN; static int pex_unix_open_read (struct pex_obj *, const char *, int); static int pex_unix_open_write (struct pex_obj *, const char *, int); -static long pex_unix_exec_child (struct pex_obj *, int, const char *, +static pid_t pex_unix_exec_child (struct pex_obj *, int, const char *, char * const *, char * const *, int, int, int, int, const char **, int *); static int pex_unix_close (struct pex_obj *, int); -static int pex_unix_wait (struct pex_obj *, long, int *, struct pex_time *, +static int pex_unix_wait (struct pex_obj *, pid_t, int *, struct pex_time = *, int, const char **, int *); static int pex_unix_pipe (struct pex_obj *, int *, int); static FILE *pex_unix_fdopenr (struct pex_obj *, int, int); @@ -355,7 +355,7 @@ pex_child_error (struct pex_obj *obj, co =20 extern char **environ; =20 -static long +static pid_t pex_unix_exec_child (struct pex_obj *obj, int flags, const char *executabl= e, char * const * argv, char * const * env, int in, int out, int errdes, @@ -384,7 +384,7 @@ pex_unix_exec_child (struct pex_obj *obj case -1: *err =3D errno; *errmsg =3D VFORK_STRING; - return -1; + return (pid_t) -1; =20 case 0: /* Child process. */ @@ -435,7 +435,7 @@ pex_unix_exec_child (struct pex_obj *obj } =20 /* NOTREACHED */ - return -1; + return (pid_t) -1; =20 default: /* Parent process. */ @@ -445,7 +445,7 @@ pex_unix_exec_child (struct pex_obj *obj { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } if (out !=3D STDOUT_FILE_NO) @@ -454,7 +454,7 @@ pex_unix_exec_child (struct pex_obj *obj { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } if (errdes !=3D STDERR_FILE_NO) @@ -463,18 +463,18 @@ pex_unix_exec_child (struct pex_obj *obj { *err =3D errno; *errmsg =3D "close"; - return -1; + return (pid_t) -1; } } =20 - return (long) pid; + return pid; } } =20 /* Wait for a child process to complete. */ =20 static int -pex_unix_wait (struct pex_obj *obj, long pid, int *status, +pex_unix_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time, int done, const char **errmsg, int *err) { Index: gcc/libiberty/pex-win32.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/libiberty/pex-win32.c +++ gcc/libiberty/pex-win32.c @@ -79,12 +79,12 @@ backslashify (char *s) =20 static int pex_win32_open_read (struct pex_obj *, const char *, int); static int pex_win32_open_write (struct pex_obj *, const char *, int); -static long pex_win32_exec_child (struct pex_obj *, int, const char *, +static pid_t pex_win32_exec_child (struct pex_obj *, int, const char *, char * const *, char * const *, int, int, int, int, const char **, int *); static int pex_win32_close (struct pex_obj *, int); -static int pex_win32_wait (struct pex_obj *, long, int *, +static int pex_win32_wait (struct pex_obj *, pid_t, int *, struct pex_time *, int, const char **, int *); static int pex_win32_pipe (struct pex_obj *, int *, int); static FILE *pex_win32_fdopenr (struct pex_obj *, int, int); @@ -522,7 +522,7 @@ env_compare (const void *a_ptr, const vo return c1 - c2; } =20 -static long +static pid_t win32_spawn (const char *executable, BOOL search, char *const *argv, @@ -597,7 +597,7 @@ win32_spawn (const char *executable, =20 free (full_executable); =20 - return -1; + return (pid_t) -1; } =20 /* Clean up. */ @@ -606,7 +606,7 @@ win32_spawn (const char *executable, if (env_block) free (env_block); =20 - return (long) pi->hProcess; + return (pid_t) pi->hProcess; =20 error: if (env_block) @@ -616,17 +616,17 @@ win32_spawn (const char *executable, if (full_executable) free (full_executable); =20 - return -1; + return (pid_t) -1; } =20 -static long +static pid_t spawn_script (const char *executable, char *const *argv, char* const *env, DWORD dwCreationFlags, LPSTARTUPINFO si, LPPROCESS_INFORMATION pi) { - int pid =3D -1; + pid_t pid =3D (pid_t) -1; int save_errno =3D errno; int fd =3D _open (executable, _O_RDONLY); =20 @@ -673,7 +673,7 @@ spawn_script (const char *executable, ch dwCreationFlags, si, pi); if (executable1 !=3D newex) free ((char *) newex); - if (pid < 0) + if ((long) pid < 0) { newex =3D msys_rootify (executable1); if (newex !=3D executable1) @@ -689,14 +689,14 @@ spawn_script (const char *executable, ch } } } - if (pid < 0) + if ((long) pid < 0) errno =3D save_errno; return pid; } =20 /* Execute a child. */ =20 -static long +static pid_t pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags, const char *executable, char * const * argv, char* const* env, @@ -705,7 +705,7 @@ pex_win32_exec_child (struct pex_obj *ob const char **errmsg, int *err) { - long pid; + pid_t pid; HANDLE stdin_handle; HANDLE stdout_handle; HANDLE stderr_handle; @@ -780,10 +780,10 @@ pex_win32_exec_child (struct pex_obj *ob /* Create the child process. */=20=20 pid =3D win32_spawn (executable, (flags & PEX_SEARCH) !=3D 0, argv, env, dwCreationFlags, &si, &pi); - if (pid =3D=3D -1) + if (pid =3D=3D (pid_t) -1) pid =3D spawn_script (executable, argv, env, dwCreationFlags, &si, &pi); - if (pid =3D=3D -1) + if (pid =3D=3D (pid_t) -1) { *err =3D ENOENT; *errmsg =3D "CreateProcess"; @@ -808,7 +808,7 @@ pex_win32_exec_child (struct pex_obj *ob macros. Note that WIFSIGNALED will never be true under CRTDLL. */ =20 static int -pex_win32_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, long pid, +pex_win32_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED, const char **errmsg, int *err) { @@ -883,7 +883,7 @@ main (int argc ATTRIBUTE_UNUSED, char ** char const *errmsg; int err; argv++; - printf ("%ld\n", pex_win32_exec_child (NULL, PEX_SEARCH, argv[0], argv, = NULL, 0, 0, 1, 2, &errmsg, &err)); + printf ("%ld\n", (long) pex_win32_exec_child (NULL, PEX_SEARCH, argv[0],= argv, NULL, 0, 0, 1, 2, &errmsg, &err)); exit (0); } #endif =3D= --=_mixed 00554DD9C125732C_=--