From patchwork Mon Oct 4 14:10:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 66682 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 0AEDAB70CC for ; Tue, 5 Oct 2010 01:10:45 +1100 (EST) Received: (qmail 14393 invoked by alias); 4 Oct 2010 14:10:35 -0000 Received: (qmail 14063 invoked by uid 22791); 4 Oct 2010 14:10:34 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Oct 2010 14:10:28 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D7137CB025E; Mon, 4 Oct 2010 16:10:26 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ey8Prj966RV5; Mon, 4 Oct 2010 16:10:26 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id C3C62CB0244; Mon, 4 Oct 2010 16:10:26 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id A75E7D9BB4; Mon, 4 Oct 2010 16:10:26 +0200 (CEST) Date: Mon, 4 Oct 2010 16:10:26 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] Recompile if ALI file newer than object file Message-ID: <20101004141026.GA8327@adacore.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i 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 When the builder gnatmake detects that an ALI file is newer than the corresponding object file, the source is recompiled. The test for this is to build an executable using gnatmake, wait for three seconds or more, touch one ALI file, then reinvoke gnatmake. The source corresponding to the ALI file shoud be recompiled. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-10-04 Vincent Celier * osint.adb (Read_Library_Info_From_Full): If object timestamp is less than ALI file timestamp, return null. Index: osint.adb =================================================================== --- osint.adb (revision 164906) +++ osint.adb (working copy) @@ -2508,6 +2508,13 @@ package body Osint is return null; end if; + + elsif Current_Full_Obj_Stamp < Current_Full_Lib_Stamp then + Close (Lib_FD, Status); + + -- No need to check the status, we return null anyway + + return null; end if; end if;