From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6843 invoked by alias); 25 Mar 2003 03:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6755 invoked by uid 71); 25 Mar 2003 03:16:01 -0000 Date: Tue, 25 Mar 2003 05:16:00 -0000 Message-ID: <20030325031601.6731.qmail@sources.redhat.com> To: ghazi@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Kaveh R. Ghazi" Subject: Re: other/6955: collect2 says "core dumped" when there is no core Reply-To: "Kaveh R. Ghazi" X-SW-Source: 2003-03/txt/msg01673.txt.bz2 List-Id: The following reply was made to PR other/6955; it has been noted by GNATS. From: "Kaveh R. Ghazi" To: bangerth@dealii.org, bruno@clisp.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org, gcc-prs@gcc.gnu.org, ghazi@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: other/6955: collect2 says "core dumped" when there is no core Date: Mon, 24 Mar 2003 22:15:46 -0500 (EST) > From: bangerth@dealii.org > > Kaveh, you inserted the lines in question in this PR some > 3.5 years ago. Would you mind to take a brief look at this > report and its 1-line patch? > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6955 Eh? I don't recall filing or modifying this PR. How did you determine I was responsible? Anyway, the patch (or suggested change) in there looks technically correct to me. But I would instead do something like the patch below. (I'm not sure how to test it since I don't have code any handy that causes ld to crash.) --Kaveh 2003-03-24 Kaveh R. Ghazi PR other/6955 * collect2.c (collect_wait): Use WCOREDUMP and fix output message. * system.h (WCOREDUMP, WCOREFLG): Define if necessary. diff -rup orig/egcc-3.2-CVS20030323/gcc/collect2.c egcc-3.2-CVS20030323/gcc/collect2.c --- orig/egcc-3.2-CVS20030323/gcc/collect2.c Fri Aug 16 16:02:01 2002 +++ egcc-3.2-CVS20030323/gcc/collect2.c Mon Mar 24 22:02:35 2003 @@ -1522,7 +1522,7 @@ collect_wait (prog) int sig = WTERMSIG (status); error ("%s terminated with signal %d [%s]%s", prog, sig, strsignal(sig), - status & 0200 ? "" : ", core dumped"); + WCOREDUMP(status) ? ", core dumped" : ""); collect_exit (FATAL_EXIT_CODE); } diff -rup orig/egcc-3.2-CVS20030323/gcc/system.h egcc-3.2-CVS20030323/gcc/system.h --- orig/egcc-3.2-CVS20030323/gcc/system.h Tue May 21 19:44:39 2002 +++ egcc-3.2-CVS20030323/gcc/system.h Mon Mar 24 21:59:44 2003 @@ -266,6 +266,12 @@ extern int errno; #ifndef WSTOPSIG #define WSTOPSIG WEXITSTATUS #endif +#ifndef WCOREDUMP +#define WCOREDUMP(S) ((S) & WCOREFLG) +#endif +#ifndef WCOREFLG +#define WCOREFLG 0200 +#endif /* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they are defined to 0 then we must provide the relevant declaration