From patchwork Wed Sep 9 00:00:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 515652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2AC0D140342 for ; Wed, 9 Sep 2015 10:01:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=G0yDWU8F; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:cc:in-reply-to:subject:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=YYC Gf6hknAgC3EQBT2z5M7QXbP5pFtIwf+4sUm9HnUkvdBJKzH0Yl5Mzh7SIYkHBXkx paS9ZFVdZ8xMdGVZu/iAN43rLr3oVLjSY7fXV6Pj2JH8wAmOHgRdoyEXt3ynSrLd 1uMm4l0m/YtPDXJpexkl7z2oJ0k1FlZdyXXv0Js0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:cc:in-reply-to:subject:mime-version :content-type:content-transfer-encoding; s=default; bh=LdAqodLWR NtQYEsXX1ln9wWX26c=; b=G0yDWU8Fs5pmc/qhfhry7bsiQITmpSfmNm+Q4cKRj 05dTAAJ7b6Du3WoSahRP/KDyRgcA/W+vFyuhLhDAf4QbP7qXWMA1X4ym/aRmylxq 9ngudxTz5D7MKIUhwaSWV+mvH342OAHco5L2Nae+XT6sU0iyU8Opnu3/sKCANA7J 5I= Received: (qmail 107414 invoked by alias); 9 Sep 2015 00:00:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107302 invoked by uid 89); 9 Sep 2015 00:00:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: bastet.se.axis.com Received: from bastet.se.axis.com (HELO bastet.se.axis.com) (195.60.68.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Sep 2015 00:00:31 +0000 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id A030E181F6; Wed, 9 Sep 2015 02:00:27 +0200 (CEST) Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id IeszMnF6Jq+j; Wed, 9 Sep 2015 02:00:26 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bastet.se.axis.com (Postfix) with ESMTP id C135D181E6; Wed, 9 Sep 2015 02:00:26 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 9FA7012D2; Wed, 9 Sep 2015 02:00:26 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id 8C159EF1; Wed, 9 Sep 2015 02:00:26 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 8869F3E049; Wed, 9 Sep 2015 02:00:26 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id t8900Q4C020756; Wed, 9 Sep 2015 02:00:26 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id t8900Qtt020752; Wed, 9 Sep 2015 02:00:26 +0200 Date: Wed, 9 Sep 2015 02:00:26 +0200 Message-Id: <201509090000.t8900Qtt020752@ignucius.se.axis.com> From: Hans-Peter Nilsson To: iant@google.com CC: gcc-patches@gcc.gnu.org In-reply-to: (message from Ian Lance Taylor on Tue, 8 Sep 2015 18:46:21 +0200) Subject: Re: libbacktrace patch committed: Graceful fallback if out of memory MIME-Version: 1.0 > From: Ian Lance Taylor > Date: Tue, 8 Sep 2015 18:46:21 +0200 > PR other/67457 > * backtrace.c: #include "internal.h". > (struct backtrace_data): Add can_alloc field. > (unwind): If can_alloc is false, don't try to get file/line > information. > (backtrace_full): Set can_alloc field in bdata. > * alloc.c (backtrace_alloc): Don't call error_callback if it is > NULL. > * mmap.c (backtrace_alloc): Likewise. > * internal.h: Update comments for backtrace_alloc and > backtrace_free. > Index: backtrace.c > =================================================================== > --- backtrace.c (revision 227528) > +++ backtrace.c (working copy) > @@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. */ > > #include "unwind.h" > #include "backtrace.h" > +#include "internal.h" > > /* The main backtrace_full routine. */ > I don't know about your environment, but for me (cross from x86_64-linux to cris-elf) that causes a: /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/tmp/hpautotest-gcc0/gcc/libbacktrace -I /tmp/hpautotest-gcc0/gcc/libbacktrace/../include -I /tmp/hpautotest-gcc0/gcc/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=backtrace.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c -o backtrace.lo /tmp/hpautotest-gcc0/gcc/libbacktrace/backtrace.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/tmp/hpautotest-gcc0/gcc/libbacktrace -I /tmp/hpautotest-gcc0/gcc/libbacktrace/../include -I /tmp/hpautotest-gcc0/gcc/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=backtrace.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /tmp/hpautotest-gcc0/gcc/libbacktrace/backtrace.c -fPIC -DPIC -o .libs/backtrace.o In file included from /tmp/hpautotest-gcc0/gcc/libbacktrace/backtrace.c:37: /tmp/hpautotest-gcc0/gcc/libbacktrace/internal.h:182: error: expected declaration specifiers or '...' before 'off_t' make[3]: *** [backtrace.lo] Error 1 make[3]: Leaving directory `/tmp/hpautotest-gcc0/cris-elf/gccobj/libbacktrace' make[2]: *** [all] Error 2 make[2]: Leaving directory `/tmp/hpautotest-gcc0/cris-elf/gccobj/libbacktrace' make[1]: *** [all-libbacktrace] Error 2 make[1]: Leaving directory `/tmp/hpautotest-gcc0/cris-elf/gccobj' make: *** [all] Error 2 I've committed the following as obvious, following the pattern of the other files including internal.h, after observing all-libbacktrace (i.e. built for the host) complete. libbacktrace: * backtrace.c: #include . brgds, H-P Index: backtrace.c =================================================================== --- backtrace.c (revision 227567) +++ backtrace.c (working copy) @@ -32,6 +32,8 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" +#include + #include "unwind.h" #include "backtrace.h" #include "internal.h"