From patchwork Thu Aug 13 12:41:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 507013 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 9B3A814028F for ; Thu, 13 Aug 2015 22:41:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=WsTLLvka; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=AXevsANbDA8/6yCY0yitfJF/UrkLlLSknurVZROgY9wvqCTOen uaqYJ5MXaYzRbpa1sHbvzA4lFa2p2s/fl2YhgkRT8osmpU+LNuZew80hu8pWKJxQ XJvacJ1bebvmNiKjdGl3T2z8SZLHkn0Ov4pvmrvgE27WQF3TAqgDXF/NM= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=Re3yGL5i7RWy73zL34n7aRsPwzc=; b=WsTLLvkak8yLVhl5WhCi DttJzl2/doYJgJxWGDX/NW+AVLIdI8rgGOOd8YFW0NoVMpacw7NB3JNrwdYm4EZi /Kq1elLeys4Uhvw2IrteojOc64LFFy5600BsOFTA5s3OGeAFpVswk7Os9HPKYY9v cayZXqyKh9dvZs3h14iS+VI= Received: (qmail 106102 invoked by alias); 13 Aug 2015 12:41:47 -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 106091 invoked by uid 89); 13 Aug 2015 12:41:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 13 Aug 2015 12:41:45 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 3F7C836B17A for ; Thu, 13 Aug 2015 12:41:44 +0000 (UTC) Received: from oldenburg.str.redhat.com (oldenburg.str.redhat.com [10.33.200.60]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7DCfgu5013799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Aug 2015 08:41:43 -0400 To: GCC Patches From: Florian Weimer Subject: [PATCH] [Ada] Make the stack non-executable in GNAT tools Message-ID: <55CC9085.4070402@redhat.com> Date: Thu, 13 Aug 2015 14:41:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-IsSubscribed: yes Due to PR67205, the deeply nested instantiations require trampolines, which in turn requires an executable stack for the GNAT tools on architectures such as x86_64. Bootstrapped on x86_64-redhat-linux-gnu, and make check-ada reports no unexpected failures. Okay for trunk? 2015-08-13 Florian Weimer * prj.adb (For_Every_Project_Imported_Context.Recursive_Check_Context): Move Name_Id_Set instantiation to the Prj package, to avoid trampolines. * prj-proc.adb (Process.Process_Expression_Variable_Decl): Move Name_Ids instantiation to the Prj.Proc package, to avoid trampolines. diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 57b88c6..3a014f1 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -72,6 +72,8 @@ package body Prj.Proc is Equal => "="); -- Stores the default values of 'Runtime names for the various languages + package Name_Ids is new Ada.Containers.Vectors (Positive, Name_Id); + procedure Add (To_Exp : in out Name_Id; Str : Name_Id); -- Concatenate two strings and returns another string if both -- arguments are not null string. @@ -2193,8 +2195,6 @@ package body Prj.Proc is if Is_Attribute and then Name = Snames.Name_Project_Path then if In_Tree.Is_Root_Tree then declare - package Name_Ids is - new Ada.Containers.Vectors (Positive, Name_Id); Val : String_List_Id := New_Value.Values; List : Name_Ids.Vector; begin diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 9da0f44..0deb39b 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -76,6 +76,9 @@ package body Prj is All_Upper_Case => All_Upper_Case_Image'Access, Mixed_Case => Mixed_Case_Image'Access); + package Name_Id_Set is + new Ada.Containers.Ordered_Sets (Element_Type => Name_Id); + procedure Free (Project : in out Project_Id); -- Free memory allocated for Project @@ -589,9 +592,6 @@ package body Prj is In_Aggregate_Lib : Boolean; From_Encapsulated_Lib : Boolean) is - package Name_Id_Set is - new Ada.Containers.Ordered_Sets (Element_Type => Name_Id); - Seen_Name : Name_Id_Set.Set; -- This set is needed to ensure that we do not handle the same -- project twice in the context of aggregate libraries.