From patchwork Thu Nov 14 10:09:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 291166 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1C96B2C00BA for ; Thu, 14 Nov 2013 21:11:02 +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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=TR49Lh//38Da6zsrRI 5adEziH+LI3vk3kr70GbcrD0yRj4mLRIVptSMQYKu6gbi94EnitCB+7sxqz3Brzh nCFEcjzuhFMiRGr91IaaMYxacFGTqo8CsrHsDsyTFD9R3dzyHH6rgzUyvS2CWmf6 X/VFiL1zq738v1ERYFf7NFG8A= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=9tyxfo55qGneKw/qp6lIN79K OXA=; b=X47GOMcxq2Yq6E4EjXdslkTbC4iiXnDocRcULLkG6ff1RtmgWNEJmI4U TW3coY1GTMkYH/PtCulK5ALBaHO6OdV3EyFQe+O9rHOLY5sSzDZXBz6N8hr96qVV cYqr4lZUjJ1iODGQN+f3bggwIi7aeedlmM4znos9+Dtx7EB6MqQ= Received: (qmail 16294 invoked by alias); 14 Nov 2013 10:09:38 -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 16267 invoked by uid 89); 14 Nov 2013 10:09:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-ob0-f182.google.com Received: from Unknown (HELO mail-ob0-f182.google.com) (209.85.214.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 14 Nov 2013 10:09:37 +0000 Received: by mail-ob0-f182.google.com with SMTP id wp18so1896400obc.41 for ; Thu, 14 Nov 2013 02:09:29 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.143.103 with SMTP id sd7mr559876obb.70.1384423769499; Thu, 14 Nov 2013 02:09:29 -0800 (PST) Received: by 10.76.83.233 with HTTP; Thu, 14 Nov 2013 02:09:29 -0800 (PST) In-Reply-To: <20131114100216.GD19827@adacore.com> References: <20131113203213.GA1176@intel.com> <20131114083820.GA27428@adacore.com> <20131114100216.GD19827@adacore.com> Date: Thu, 14 Nov 2013 02:09:29 -0800 Message-ID: Subject: Re: [PATCH] PR ada/54040: [x32] Incorrect timeval and timespec From: "H.J. Lu" To: Arnaud Charlet Cc: GCC Patches , Eric Botcazou X-IsSubscribed: yes On Thu, Nov 14, 2013 at 2:02 AM, Arnaud Charlet wrote: >> > No, introducing all these extra/almost duplicated files is not OK, you'd >> > need to find a way to share the existing files instead, thanks. >> >> I am not familiar with Ada. Can you recommend how to fix it? > > Can you send a diff between the *-linux files and your new files? This > should help giving some options. > This is the total diff. Thanks. --- s-osinte-linux.ads 2013-11-13 09:34:14.214149918 -0800 +++ s-osinte-linux-x32.ads 2013-11-13 15:23:14.710394049 -0800 @@ -596,11 +596,11 @@ private type pid_t is new int; - type time_t is new long; + type time_t is new Long_Long_Integer; type timespec is record tv_sec : time_t; - tv_nsec : long; + tv_nsec : Long_Long_Integer; end record; pragma Convention (C, timespec); --- s-osinte-posix.adb 2011-10-14 10:59:25.705507873 -0700 +++ s-osinte-linux-x32.adb 2013-11-13 15:23:14.709394072 -0800 @@ -104,7 +104,7 @@ package body System.OS_Interface is end if; return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); + tv_nsec => Long_Long_Integer (F * 10#1#E9)); end To_Timespec; end System.OS_Interface; --- s-osprim-posix.adb 2010-02-22 14:11:20.000000000 -0800 +++ s-osprim-linux-x32.adb 2013-11-13 15:23:14.710394049 -0800 @@ -38,11 +38,11 @@ package body System.OS_Primitives is -- these declarations in System.OS_Interface and move these ones in -- the spec. - type time_t is new Long_Integer; + type time_t is new Long_Long_Integer; type timespec is record tv_sec : time_t; - tv_nsec : Long_Integer; + tv_nsec : Long_Long_Integer; end record; pragma Convention (C, timespec); @@ -54,7 +54,7 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - type timeval is array (1 .. 2) of Long_Integer; + type timeval is array (1 .. 2) of Long_Long_Integer; procedure timeval_to_duration (T : not null access timeval; @@ -118,7 +118,7 @@ package body System.OS_Primitives is return timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); + tv_nsec => Long_Long_Integer (F * 10#1#E9)); end To_Timespec; ----------------- --- s-taprop-linux.adb 2013-11-13 09:34:14.220149775 -0800 +++ s-taprop-linux-x32.adb 2013-11-13 15:23:14.710394049 -0800 @@ -627,7 +627,7 @@ package body System.Task_Primitives.Oper function Monotonic_Clock return Duration is use Interfaces; - type timeval is array (1 .. 2) of C.long; + type timeval is array (1 .. 2) of Long_Long_Integer; procedure timeval_to_duration (T : not null access timeval;