From patchwork Thu May 24 21:32:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 161219 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 E94BBB6F62 for ; Fri, 25 May 2012 07:33:36 +1000 (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=1338500017; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=fr/YlvbZ3jit3Oty1MG6hzluHq8=; b=G1pB3oBa5yw+/v9 DtoJVn3gcCo/NBP5XeZNhaQKojsieDPJeA+dkV9eQZM0JgsC5VHekxeS1Qz8FHjA Zjpm4dUGdthn+O27cQqKzXPUBkylfU+QBWT1ri9c4EiaOMTpdio8oJK+/Pwo4c8w Z11gJU2kBuwuwKtwQL/Dy+m3uEl4= 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:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jVUCEc+xf7odwrziJCuRZkpUS/237fblBZRU7xNGyGfekHvJrkr9aIYaW7keZv hrL6Gc6FC7P29yDjlBb0sRCVqlFnJBb3U0uWJXpgx5s2MBK4qAnq5mfk3T+tNvag V07KbD0HJkAVSSDn0/XBmzORyd+kzhkJgtd+8xAIJu8wk=; Received: (qmail 5296 invoked by alias); 24 May 2012 21:33:33 -0000 Received: (qmail 5288 invoked by uid 22791); 24 May 2012 21:33:32 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_BJ, TW_JC X-Spam-Check-By: sourceware.org Received: from mail-qc0-f175.google.com (HELO mail-qc0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 May 2012 21:33:00 +0000 Received: by qcso7 with SMTP id o7so236427qcs.20 for ; Thu, 24 May 2012 14:32:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.33.8 with SMTP id f8mr3979904qad.11.1337895179770; Thu, 24 May 2012 14:32:59 -0700 (PDT) Received: by 10.229.169.130 with HTTP; Thu, 24 May 2012 14:32:59 -0700 (PDT) In-Reply-To: References: <20120524140119.GA27160@intel.com> <4FBE472E.1040202@gnu.org> Date: Thu, 24 May 2012 14:32:59 -0700 Message-ID: Subject: Re: PATCH: PR bootstrap/53472: contrib/compare-debug should strip out .comment section From: "H.J. Lu" To: Paolo Bonzini Cc: gcc-patches@gcc.gnu.org, Richard Guenther 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 Thu, May 24, 2012 at 9:53 AM, H.J. Lu wrote: > On Thu, May 24, 2012 at 7:43 AM, H.J. Lu wrote: >> On Thu, May 24, 2012 at 7:35 AM, Paolo Bonzini wrote: >>> Il 24/05/2012 16:01, H.J. Lu ha scritto: >>>> configure checks if contrib/compare-debug actually works for comparing a >>>> debug and non-debug .o file before enabling bootstrap-debug.  But some >>>> compilers encode some command line options (among them -g) into a special >>>> .comment section.  This patch removes .comment section before comparing >>>> debug and non-debug files.  OK for trunk? >>> >>> Ok. >> >> Hi Richard, >> >> Before I check it in,  can you verify it enables bootstrap-debug on SuSE? >> > > It doesn't work since the comment section name may be > .comment.SUSE.OPTs > This patch works on openSUSE 12.1. OK to install? Thanks. diff --git a/contrib/compare-debug b/contrib/compare-debug index 010d17f..2468899 100755 --- a/contrib/compare-debug +++ b/contrib/compare-debug @@ -73,6 +73,27 @@ Darwin) ;; esac +remove_comment () +{ + file=$1 + opts= + for s in `objdump --section-headers "$file" | awk '{ print $2 }'`; do + case "$s" in + .comment*) + opts="$opts --remove-section $s" + ;; + esac + done + [ -n "$opts" ] && objcopy $opts $file +} + +# Also remove any .comment sections. +if (objcopy -v) 2>&1 | grep ' --remove-section' > /dev/null \ + && (objdump --help) 2>&1 | grep ' --\[*section-\]*headers' > /dev/null; then + remove_comment "$1.$suf1" + remove_comment "$2.$suf2" +fi + if cmp "$1.$suf1" "$2.$suf2"; then status=0 else