From patchwork Sun Oct 7 11:40:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Klose X-Patchwork-Id: 189810 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]) by ozlabs.org (Postfix) with SMTP id 6CAC22C01C8 for ; Sun, 7 Oct 2012 22:44:19 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350215060; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=AUK35saOTfzflvBD19b3 oZ3vSt0=; b=gAl7S7wb8/VaCXEyG5Xp4pQ4xzcZRidafIXk0/AzlFmj323FMJ1J FroOO1w+KwAgSzINSp1vnnJ2vzwD9/FoUsOBDRE75UdXXROL4FjuqYsAnPBuOeXw KiIG/oevFEMLHUvLVHBawLiYrtzdsnFW6ipzRT47Q8N2uPOn8MsisMo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:X-Envelope-From:X-Envelope-To:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=hJVb8vnmHFbrx6g+Ga51Eilu8wvUPdaDxQLYCltCipDwIrbGu7HP2V4CKbMK/m DN35aaRX23F98Cl1JPpUB09STY2fNoCwIVWg2Ysdftplsll/HzfwNLlBv8AlushY aaV5R1K1bqbjp0dPL+tSsrdYCSq/FL0dbn5pxA/hTcBis=; Received: (qmail 10651 invoked by alias); 7 Oct 2012 11:44:16 -0000 Received: (qmail 10642 invoked by uid 22791); 7 Oct 2012 11:44:15 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from einhorn.in-berlin.de (HELO einhorn.in-berlin.de) (192.109.42.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 07 Oct 2012 11:44:10 +0000 X-Envelope-From: doko@debian.org X-Envelope-To: Received: from [192.168.42.210] (dslb-088-073-077-057.pools.arcor-ip.net [88.73.77.57]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id q97Bi7dM003592 for ; Sun, 7 Oct 2012 13:44:08 +0200 Message-ID: <50716A19.1080600@debian.org> Date: Sun, 07 Oct 2012 13:40:09 +0200 From: Matthias Klose User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [patch] fix libbacktrace build failure on arm-linux References: <5070499D.2060001@ubuntu.com> <50715316.50704@ubuntu.com> In-Reply-To: <50715316.50704@ubuntu.com> X-IsSubscribed: yes 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 On 07.10.2012 12:01, Matthias Klose wrote: > On 06.10.2012 22:46, Ian Lance Taylor wrote: >> On Sat, Oct 6, 2012 at 8:09 AM, Matthias Klose wrote: >>> current trunk fails to build on arm-linux with: >>> >>> In file included from ../../../../src/libbacktrace/backtrace.c:35:0: >>> ../libgcc/unwind.h: In function '_Unwind_decode_typeinfo_ptr': >>> ../libgcc/unwind.h:42:45: error: unused parameter 'base' [-Werror=unused-parameter] >>> _Unwind_decode_typeinfo_ptr (_Unwind_Word base, _Unwind_Word ptr) >>> ^ >>> ../libgcc/unwind.h: In function '__gnu_unwind_24bit': >>> ../libgcc/unwind.h:68:41: error: unused parameter 'context' >>> [-Werror=unused-parameter] >>> __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact) >>> ^ >>> ../libgcc/unwind.h:68:54: error: unused parameter 'data' [-Werror=unused-parameter] >>> __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact) >>> ^ >>> ../libgcc/unwind.h:68:64: error: unused parameter 'compact' >>> [-Werror=unused-parameter] >>> __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact) >>> ^ >>> cc1: all warnings being treated as errors >>> make[8]: *** [backtrace.lo] Error 1 >>> >>> the immediate fix is to mark all arguments as unused, however I don't know if >>> this function should be used by libbacktrace, if it returns _URC_FAILURE >>> unconditionally. >> >> The function is not used by libbacktrace. It's an inline function >> defined in the header file, and the warning is about the inline >> function definition. That is, this is a libgcc bug, not a >> libbacktrace bug, it just happens to show up when compiling >> libbacktrace for ARM >> >> >>> * config/arm/unwind-arm.h (__gnu_unwind_24bit): Mark parameters >>> as unused. >>> >>> >>> --- libgcc/config/arm/unwind-arm.h (revision 192162) >>> +++ libgcc/config/arm/unwind-arm.h (working copy) >>> @@ -64,8 +64,11 @@ >>> return tmp; >>> } >>> >>> +#define __unused __attribute__((unused)) >>> + >>> static inline _Unwind_Reason_Code >>> - __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact) >>> + __gnu_unwind_24bit (_Unwind_Context * context __unused, _uw data __unused, >>> + int compact __unused) >>> { >>> return _URC_FAILURE; >>> } >> >> Don't #define __unused. Just write __attribute__ ((unused)) on the >> parameters. Break the lines as needed. >> >> This is OK with that change. > > committed the following. the base parameter in _Unwind_decode_typeinfo_ptr > is unused too. > > Matthias > > 2012-10-07 Matthias Klose > > * config/arm/unwind-arm.h (__gnu_unwind_24bit): Mark parameters > as unused. > (_Unwind_decode_typeinfo_ptr): Mark base as unused. > > Index: libgcc/config/arm/unwind-arm.h > =================================================================== > --- a/src/libgcc/config/arm/unwind-arm.h (revision 192162) > +++ b/src/libgcc/config/arm/unwind-arm.h (working copy) > @@ -39,7 +39,8 @@ > #endif > /* Decode an R_ARM_TARGET2 relocation. */ > static inline _Unwind_Word > - _Unwind_decode_typeinfo_ptr (_Unwind_Word base, _Unwind_Word ptr) > + _Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__ ((unused)), > + _Unwind_Word ptr) > { > _Unwind_Word tmp; > > @@ -65,7 +66,9 @@ > } > > static inline _Unwind_Reason_Code > - __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact) > + __gnu_unwind_24bit (_Unwind_Context * context __attribute__ ((unused)), > + _Unwind_Context *_uw data __attribute__ ((unused)), > + int compact __attribute__ ((unused))) > { > return _URC_FAILURE; > } > and as a follow-up, fix the typo, committed as obvious --- config/arm/unwind-arm.h (revision 192181) +++ config/arm/unwind-arm.h (working copy) @@ -67,7 +67,7 @@ static inline _Unwind_Reason_Code __gnu_unwind_24bit (_Unwind_Context * context __attribute__ ((unused)), - _Unwind_Context *_uw data __attribute__ ((unused)), + _uw data __attribute__ ((unused)), int compact __attribute__ ((unused))) { return _URC_FAILURE;