This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[csl-arm] PATCH: Fix -pipe when linking


Using -pipe when linking caused a crash on the csl-arm-branch, due to
a bug in the code that was added to allow GCC to run natively on
Windows.  Fixed thusly, and applied on the csl-arm-branch.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

 2005-01-31  Mark Mitchell <mark@codesourcery.com>

	* libiberty/pex-unix.c (pexecute): Set last_pipe_input to -1 at
	the end of the pipeline.

Index: libiberty/pex-unix.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/pex-unix.c,v
retrieving revision 1.1.20.1
diff -c -5 -p -r1.1.20.1 pex-unix.c
*** libiberty/pex-unix.c	23 Dec 2003 21:43:48 -0000	1.1.20.1
--- libiberty/pex-unix.c	1 Feb 2005 05:43:47 -0000
*************** pexecute (program, argv, this_pname, tem
*** 186,199 ****
  
    int pid;
    int pdesc[2];
    int serrno;
    int child_stdin = -2, child_stdout = -2;
- #if 0
- FILE* P = fopen("/dev/pts/1", "w");
- printf(P, "pex-unix.c:pexecute called with program %s\n", program);
- #endif
    /* If this is the first process, last_pipe_input ought to be -1.  */
    if (flags & PEXECUTE_FIRST)
      if (last_pipe_input != -1)
        abort ();
  
--- 186,195 ----
*************** printf(P, "pex-unix.c:pexecute called wi
*** 227,236 ****
--- 223,235 ----
    /* To prevent a file descriptor leak, close last_pipe_input if pexec
       failed.  */
    if (pid == -1)
      xclose (last_pipe_input);
  
+   if (flags & PEXECUTE_LAST)
+     last_pipe_input = -1;
+ 
    errno = serrno;
  
    if (pid == -1)
      {
        *errmsg_fmt = "fork";


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]