From patchwork Tue Mar 4 12:51:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 326275 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 8FFC02C00C4 for ; Tue, 4 Mar 2014 23:52:48 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=SapvO2z2fYAldTYz 5khbEc8Q7CYDTzG9JfjkXF2ZKivR/XqMIM1RGv74EZ7LG8Z19LkP7N0gd3E7efj/ pToarj5HfD5V/w9lzL3AeWJy7oN9vT2Y1+MEBMtbVaqDNWGrxy94u0PqIeDulypL Jeu0cMFYHVIWHh2EmvAyPjravdI= 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 :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=gPW1wbRlAE3HbiZ+2kfjwh FtwvY=; b=sQC5k24cPNpVlIgobyPiZg2fNh1SN1M//voAtj4r5+gAbUqZR8bz6i 3De+b52oRmKNtTNWFkl+XFbss8D4aEbS4UlEjFMc0wx+mntlO2gNEiyCvxXjIsRb mStC7BCmCym+ntnWPBTsKBNXYabdlBwtNPpfs7Yos3PrZrV0gj2B0= Received: (qmail 3523 invoked by alias); 4 Mar 2014 12:52:42 -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 3509 invoked by uid 89); 4 Mar 2014 12:52:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 04 Mar 2014 12:52:38 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DFE607501B; Tue, 4 Mar 2014 12:52:35 +0000 (UTC) Date: Tue, 4 Mar 2014 13:51:27 +0100 (CET) From: Richard Biener To: Jan-Benedict Glaw cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Properly do the LTO bytecode version check In-Reply-To: Message-ID: References: <20140304123910.GE21053@lug-owl.de> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 On Tue, 4 Mar 2014, Richard Biener wrote: > On Tue, 4 Mar 2014, Jan-Benedict Glaw wrote: > > > On Tue, 2014-03-04 12:22:12 +0100, Richard Biener wrote: > > > > > > We're doing the LTO bytecode version check only for two section > > > types at the moment - specifically _not_ for the first section > > > we read. Which causes us to crash instead of reporting a > > > version mismatch ... > > > > > > Fixed by doing the version check in the most appropriate place. > > > > > > LTO bootstrapped on x86_64-unknown-linux-gnu, applied. > > > > > > Richard. > > > > > > 2014-03-04 Richard Biener > > > > > > PR lto/60405 > > > * lto-streamer-in.c (lto_read_body): Remove LTO bytecode version > > > check. > > > (lto_input_toplevel_asms): Likewise. > > > * lto-section-in.c (lto_get_section_data): Instead do it here > > > for every section. > > > > Breaks for the Build Robot with g++ (GCC) 4.9.0 20131121 like this: > > > > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -o lto-section-in.o -MT lto-section-in.o -MMD -MP -MF ./.deps/lto-section-in.TPo ../../../gcc/gcc/lto-section-in.c > > ../../../gcc/gcc/lto-section-in.c: In function ‘const char* lto_get_section_data(lto_file_decl_data*, lto_section_type, const char*, size_t*)’: > > ../../../gcc/gcc/lto-section-in.c:177:37: error: cast from type ‘const char*’ to type ‘lto_header*’ casts away qualifiers [-Werror=cast-qual] > > lto_check_version (((lto_header *)data)->major_version, > > ^ > > ../../../gcc/gcc/lto-section-in.c:178:23: error: cast from type ‘const char*’ to type ‘lto_header*’ casts away qualifiers [-Werror=cast-qual] > > ((lto_header *)data)->minor_version); > > ^ > > cc1plus: all warnings being treated as errors > > make[2]: *** [lto-section-in.o] Error 1 > > > > > > See eg. > > http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=156703 > > --> http://toolchain.lug-owl.de/buildbot/deliver_artifact.php?mode=view&id=1152984 > > > > MfG, JBG > > Bah - I committed the wrong version ... Fixed like so (what was actually tested). Richard. 2014-03-04 Richard Biener * lto-section-in.c (lto_get_section_data): Fix const cast. Index: gcc/lto-section-in.c =================================================================== --- gcc/lto-section-in.c (revision 208314) +++ gcc/lto-section-in.c (working copy) @@ -174,8 +174,8 @@ lto_get_section_data (struct lto_file_de data = buffer.data + header_length; } - lto_check_version (((lto_header *)data)->major_version, - ((lto_header *)data)->minor_version); + lto_check_version (((const lto_header *)data)->major_version, + ((const lto_header *)data)->minor_version); return data; }