From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A1E5384B11C; Wed, 24 Apr 2024 17:19:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A1E5384B11C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713979152; bh=YgUMxv95K6hpdODWuSsdRAe77WZAY3XJ3dxHh/IMF0E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DycUKtLgwi42a9LOmNa83vbi5R3TCxB4qCejjQ3Zd/ri71kgwbn/0So/bcUDZx/jB ktVRe0MUrCExKKtzW/uiZ2wniIxNlpf355jZM6SzzhKU+YAZGHeNnEAbltqhufpgFI q5u+lBQkXReunWZZklegaLPOGPFlNr+59jOV4llg= From: "nicolas at debian dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/114065] gnat build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 fails on 32bit archs Date: Wed, 24 Apr 2024 17:19:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nicolas at debian dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114065 Nicolas Boulenguez changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57926|0 |1 is obsolete| | --- Comment #22 from Nicolas Boulenguez --- Created attachment 58028 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58028&action=3Dedit merge all definitions and conversions for timeval and timespec Hello. Moving the definitions into System.CRTL was a bad idea because they are nee= ded before the target libgnat is built. The attached version 6 creates a new System.C_Time unit. It also adds a script testing the C_Time functions against handwritten resu= lts on 32 combinations of type sizes for Duration, time_t and suseconds_t. With the first four patches applied, gcc-13.2.0 (with Debian patches) build= s on x86_64-linux-gnu and arm-linux-gnueabihf. The following program then gives the correct date on x86_64-linux-gnu but random dates or Time_Error on arm-linux-gnueabihf. So the original issue remains. -- with Ada.Calendar, Ada.Text_IO; procedure Demo is Y : Ada.Calendar.Year_Number; M : Ada.Calendar.Month_Number; D : Ada.Calendar.Day_Number; S : Duration; H, Min : Integer; begin Ada.Calendar.Split (Ada.Calendar.Clock, Y, M, D, S); H :=3D Integer ((S / 3_600) - 0.5); S :=3D S - 3600 * Duration (H); Min :=3D Integer ((S / 60) - 0.5); S :=3D S - 60 * Duration (Min); Ada.Text_IO.Put_Line (Y'Img & M'Img & D'Img & H'Img & Min'Img & S'Img); end Demo; -- The commits are rebased on the trunk, with only trivial changes but unteste= d.=