From patchwork Wed Feb 22 10:05:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 142429 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 A51D6B6FA2 for ; Wed, 22 Feb 2012 21:05:37 +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=1330509940; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:MIME-Version:Received:Received:In-Reply-To: References:Date:Message-ID:Subject:From:To:Cc:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=Z8U2ISYvS7waC6Osz+4I /po8zYY=; b=LYwzw2ZgKzrobT0N7HFA35JdPFh5Cbpz2tVNuNiKKzaczbal+kFu qKV4QsO5xLqBMfLZNJwWTzZwKnia/jzjmBAzT1FKCN453yeY8PRfkAAoWymakW86 3P2ZyIINFew28kJIbbbPi0vSqWErznMkohkIAdzxhrOPHyf11sYcp84= 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:Received-SPF:Authentication-Results:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=MwqWFIGw37fh8JtUczVtPmrH5P7jJ7yYZJg2IPx22GONDF5DmrG71mqdSaJ9r1 x4IUlsOiYpGlxfGcKmiu1YjF7W64O2nudEwNOUZgPphyPeBzb+qAi/o0wuOscikX YlTB4TTcWKwdieUDYDne9lJINQxkex7KdwhtJOJuJy4sM=; Received: (qmail 28632 invoked by alias); 22 Feb 2012 10:05:31 -0000 Received: (qmail 28623 invoked by uid 22791); 22 Feb 2012 10:05:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Feb 2012 10:05:17 +0000 Received: by obhx4 with SMTP id x4so10206460obh.20 for ; Wed, 22 Feb 2012 02:05:17 -0800 (PST) Received-SPF: pass (google.com: domain of ktietz70@googlemail.com designates 10.182.1.4 as permitted sender) client-ip=10.182.1.4; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ktietz70@googlemail.com designates 10.182.1.4 as permitted sender) smtp.mail=ktietz70@googlemail.com; dkim=pass header.i=ktietz70@googlemail.com Received: from mr.google.com ([10.182.1.4]) by 10.182.1.4 with SMTP id 4mr17521861obi.67.1329905117245 (num_hops = 1); Wed, 22 Feb 2012 02:05:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.1.4 with SMTP id 4mr14925232obi.67.1329905117178; Wed, 22 Feb 2012 02:05:17 -0800 (PST) Received: by 10.182.33.103 with HTTP; Wed, 22 Feb 2012 02:05:17 -0800 (PST) In-Reply-To: References: Date: Wed, 22 Feb 2012 11:05:17 +0100 Message-ID: Subject: Re: [patch lto-plugin]: Fix pr 50616 From: Kai Tietz To: Richard Guenther Cc: GCC Patches 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 Here is revised patch. Sadly inttypes.h can't be used here. So we need local check for this. ChangeLog 2012-02-22 Kai Tietz PR lto/50616 * lto-plugin.c (PRI_LL): New macro. (dump_symtab): Use PRI_LL instead of ll in print. (process_symtab): Use PRI_LL instead of ll in scan. Tested for i686-w64-mingw32, x86_64-w64-mingw32, and for x86_64-unknown-linux-gnu. Ok for apply? Regards, Kai Index: lto-plugin.c =================================================================== --- lto-plugin.c (revision 184426) +++ lto-plugin.c (working copy) @@ -62,6 +62,14 @@ #include "simple-object.h" #include "plugin-api.h" +/* We need to use I64 instead of ll width-specifier on native Windows. + The reason for this is that older MS-runtimes don't support the ll. */ +#ifdef __MINGW32__ +#define PRI_LL "I64" +#else +#define PRI_LL "ll" +#endif + /* Handle opening elf files on hosts, such as Windows, that may use text file handling that will break binary access. */ #ifndef O_BINARY @@ -360,7 +368,7 @@ assert (resolution != LDPR_UNKNOWN); - fprintf (f, "%u %llx %s %s\n", + fprintf (f, "%u %" PRI_LL "x %s %s\n", (unsigned int) slot, symtab->aux[j].id, lto_resolution_str[resolution], symtab->syms[j].name); @@ -816,7 +824,7 @@ s = strrchr (name, '.'); if (s) - sscanf (s, ".%llx", &obj->out->id); + sscanf (s, ".%" PRI_LL "x", &obj->out->id); secdata = xmalloc (length); offset += obj->file->offset; if (offset != lseek (obj->file->fd, offset, SEEK_SET)