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]

Import John David Anglin's patch to collect2.c onto gcc 3.3 branch


Hi Guys,

  I am going to apply the patch below to the gcc 3.3 branch.  It
  imports the patch created by John David Anglin to make sure that
  when collect2 waits on a PID it waits on the right one.  This should
  fix bootstrapping problems on HPUX platforms and possibly others as
  well.

Cheers
        Nick
        
2003-10-01  Nick Clifton  <nickc@redhat.com>

	* Import this patch from mainline:
	
	2003-02-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* collect2.c (pexecute_pid): Rename to pid.
	(collect_wait, collect_execute, scan_prog_file, scan_libraries): Use
	pid.

Index: gcc/collect2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/collect2.c,v
retrieving revision 1.142.4.1
diff -c -3 -p -r1.142.4.1 collect2.c
*** gcc/collect2.c	31 Mar 2003 01:12:20 -0000	1.142.4.1
--- gcc/collect2.c	1 Oct 2003 14:03:08 -0000
*************** struct obstack temporary_obstack;
*** 234,240 ****
  char * temporary_firstobj;
  
  /* Holds the return value of pexecute.  */
! int pexecute_pid;
  
  /* Structure to hold all the directories in which to search for files to
     execute.  */
--- 234,240 ----
  char * temporary_firstobj;
  
  /* Holds the return value of pexecute.  */
! int pid;
  
  /* Structure to hold all the directories in which to search for files to
     execute.  */
*************** collect_wait (prog)
*** 1499,1505 ****
  {
    int status;
  
!   pwait (pexecute_pid, &status, 0);
    if (status)
      {
        if (WIFSIGNALED (status))
--- 1499,1505 ----
  {
    int status;
  
!   pwait (pid, &status, 0);
    if (status)
      {
        if (WIFSIGNALED (status))
*************** collect_execute (prog, argv, redir)
*** 1588,1596 ****
        dup2 (redir_handle, STDERR_FILENO);
      }
  
!   pexecute_pid = pexecute (argv[0], argv, argv[0], NULL,
! 			   &errmsg_fmt, &errmsg_arg,
! 			   (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH));
  
    if (redir)
      {
--- 1588,1596 ----
        dup2 (redir_handle, STDERR_FILENO);
      }
  
!   pid = pexecute (argv[0], argv, argv[0], NULL,
! 		  &errmsg_fmt, &errmsg_arg,
! 		  (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH));
  
    if (redir)
      {
*************** collect_execute (prog, argv, redir)
*** 1602,1608 ****
        close (redir_handle);
      }
  
!  if (pexecute_pid == -1)
     fatal_perror (errmsg_fmt, errmsg_arg);
  }
  
--- 1602,1608 ----
        close (redir_handle);
      }
  
!  if (pid == -1)
     fatal_perror (errmsg_fmt, errmsg_arg);
  }
  
*************** scan_prog_file (prog_name, which_pass)
*** 2069,2075 ****
    void (*quit_handler) PARAMS ((int));
    char *real_nm_argv[4];
    const char **nm_argv = (const char **) real_nm_argv;
-   int pid;
    int argc = 0;
    int pipe_fd[2];
    char *p, buf[1024];
--- 2069,2074 ----
*************** scan_libraries (prog_name)
*** 2514,2520 ****
    void (*quit_handler) PARAMS ((int));
    char *real_ldd_argv[4];
    const char **ldd_argv = (const char **) real_ldd_argv;
-   int pid;
    int argc = 0;
    int pipe_fd[2];
    char buf[1024];
--- 2513,2518 ----
        


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