From d94b1a6363b3699bb8f001b7447a162423743b8d Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 2 Apr 2012 09:25:18 +0000 Subject: [PATCH] 2012-04-02 Jose Ruiz * gnat_ugn.texi: Add some minimal documentation about how to use GNATtest for cross platforms. 2012-04-02 Vincent Celier * opt.ads (Object_Path_File_Name): New variable. * prj-attr.adb: New Compiler attribute Object_Path_Switches. * prj-nmsc.adb (Process_Compiler): Recognize new attribute Object_Path_Switches. * snames.ads-tmpl: New standard name Object_Path_Switches. * switch-c.adb (Scan_Front_End_Switches): Recognize new switch -gnateO= and put its value in Opt.Object_Path_File_Name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186072 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 15 +++++++++++++++ gcc/ada/gnat_ugn.texi | 27 +++++++++++++++++++++++++-- gcc/ada/opt.ads | 5 +++++ gcc/ada/prj-attr.adb | 3 ++- gcc/ada/prj-nmsc.adb | 6 ++++++ gcc/ada/snames.ads-tmpl | 1 + gcc/ada/switch-c.adb | 18 ++++++++++++++++++ 7 files changed, 72 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f42c041..2e4f8e5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2012-04-02 Jose Ruiz + + * gnat_ugn.texi: Add some minimal documentation about how to + use GNATtest for cross platforms. + +2012-04-02 Vincent Celier + + * opt.ads (Object_Path_File_Name): New variable. + * prj-attr.adb: New Compiler attribute Object_Path_Switches. + * prj-nmsc.adb (Process_Compiler): Recognize new attribute + Object_Path_Switches. + * snames.ads-tmpl: New standard name Object_Path_Switches. + * switch-c.adb (Scan_Front_End_Switches): Recognize new switch + -gnateO= and put its value in Opt.Object_Path_File_Name. + 2012-04-02 Hristian Kirtchev * exp_ch7.adb (Process_Declarations): Detect a case where diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 5c313ac..9ea8f7c 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -94,10 +94,12 @@ Texts. A copy of the license is included in the section entitled @ifset unw @set PLATFORM +@set TITLESUFFIX @end ifset @ifset vms @set PLATFORM OpenVMS +@set TITLESUFFIX for @value{PLATFORM} @end ifset @c @ovar(ARG) @@ -115,7 +117,7 @@ Texts. A copy of the license is included in the section entitled @c of the @ovar macro have been expanded inline. -@settitle @value{EDITION} User's Guide @value{PLATFORM} +@settitle @value{EDITION} User's Guide @value{TITLESUFFIX} @dircategory GNU Ada tools @direntry * @value{EDITION} User's Guide: (gnat_ugn). @value{PLATFORM} @@ -484,6 +486,7 @@ Creating Unit Tests Using gnattest * Tagged Types Substitutability Testing:: * Testing with Contracts:: * Additional Tests:: +* Support for other platforms/run-times:: * Current Limitations:: Other Utility Programs @@ -3077,7 +3080,7 @@ $ gnatlink ada_unit file1.o file2.o --LINK=./my_script Where CC is the name of the non-GNU C++ compiler. If the @code{zero cost} exception mechanism is used, and the platform -supports automatic registration of exception tables (e.g.@: Solaris or IRIX), +supports automatic registration of exception tables (e.g.@: Solaris), paths to more objects are required: @smallexample @@ -17988,6 +17991,7 @@ default location. * Tagged Types Substitutability Testing:: * Testing with Contracts:: * Additional Tests:: +* Support for other platforms/run-times:: * Current Limitations:: @end menu @@ -18474,6 +18478,25 @@ gnatmake -Pmixing/test_driver.gpr mixing/test_runner @end smallexample +@node Support for other platforms/run-times +@section Support for other platforms/run-times + +@noindent +@command{gnattest} can be used to generate the test harness for platforms +and run-time libraries others than the default native target with the +default full run-time. For example, when using a limited run-time library +such as Zero FootPrint (ZFP), a simplified harness is generated. + +Two variables are used to tell the underlying AUnit framework how to generate +the test harness: @code{PLATFORM}, which identifies the target, and +@code{RUNTIME}, used to determine the run-time library for which the harness +is generated. For example, the following options are used to generate the +AUnit test harness for a PowerPC ELF target using the ZFP run-time library: + +@smallexample +gnattest -Psimple.gpr -XPLATFORM=powerpc-elf -XRUNTIME=zfp +@end smallexample + @node Current Limitations @section Current Limitations diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index a1dc37c..e59e67e 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -987,6 +987,11 @@ package Opt is -- GNATMAKE -- Set to True when an object directory is specified with option -D + Object_Path_File_Name : String_Ptr := null; + -- GNAT2WHY + -- Path of the temporary file that contains a list of object directories + -- passed by -gnateO=. + One_Compilation_Per_Obj_Dir : Boolean := False; -- GNATMAKE, GPRBUILD -- Set to True with switch --single-compile-per-obj-dir. When True, there diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index ba569e1..8d3d855 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -226,6 +226,7 @@ package body Prj.Attr is "Lainclude_switches#" & "Sainclude_path#" & "Sainclude_path_file#" & + "Laobject_path_switches#" & -- package Builder diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 284f9f0..01b39c6 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -1440,6 +1440,12 @@ package body Prj.Nmsc is From_List => Element.Value.Values, In_Tree => Data.Tree); + when Name_Object_Path_Switches => + Put (Into_List => + Lang_Index.Config.Object_Path_Switches, + From_List => Element.Value.Values, + In_Tree => Data.Tree); + -- Attribute Compiler_Pic_Option () when Name_Pic_Option => diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index ed30b9b..c85fdd0 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -1199,6 +1199,7 @@ package Snames is Name_Object_File_Switches : constant Name_Id := N + $; Name_Object_Generated : constant Name_Id := N + $; Name_Object_List : constant Name_Id := N + $; + Name_Object_Path_Switches : constant Name_Id := N + $; Name_Objects_Linked : constant Name_Id := N + $; Name_Objects_Path : constant Name_Id := N + $; Name_Objects_Path_File : constant Name_Id := N + $; diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index 789fb9b..7cb0ee0 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -516,6 +516,24 @@ package body Switch.C is new String'(Switch_Chars (Ptr .. Max)); return; + -- -gnateO= (object path file) + + when 'O' => + Store_Switch := False; + Ptr := Ptr + 1; + + -- Check for '=' + + if Ptr >= Max or else Switch_Chars (Ptr) /= '=' then + Bad_Switch ("-gnateO"); + + else + Object_Path_File_Name := + new String'(Switch_Chars (Ptr + 1 .. Max)); + end if; + + return; + -- -gnatep (preprocessing data file) when 'p' => -- 2.7.4