From b3af75af77c55d0858432052c04bc40bfff56090 Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Tue, 27 May 2008 10:50:22 +0200 Subject: [PATCH] prj-attr.adb: Add new project level attribute Map_File_Option 2008-05-27 Vincent Celier * prj-attr.adb: Add new project level attribute Map_File_Option * prj-nmsc.adb (Process_Linker): Process new attribute Map_File_Option * prj.ads: Minor reformatting and comment update (Project_Configuration): New component Map_File_Option * snames.adb: New standard name Map_File_Option * snames.ads: New standard name Map_File_Option From-SVN: r135981 --- gcc/ada/prj-attr.adb | 1 + gcc/ada/prj-nmsc.adb | 10 ++-- gcc/ada/prj.ads | 136 ++++++++++++++++++++++--------------------- gcc/ada/snames.adb | 1 + gcc/ada/snames.ads | 91 +++++++++++++++-------------- 5 files changed, 122 insertions(+), 117 deletions(-) diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index e2b1fbc936b..6f6c888b4e6 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -231,6 +231,7 @@ package body Prj.Attr is "Ladefault_switches#" & "Lcswitches#" & "LVlinker_options#" & + "SVmap_file_option#" & -- Configuration - Linking diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 179609aaab9..b04ce2603bf 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -1831,9 +1831,7 @@ package body Prj.Nmsc is Data.Config.Linker := Path_Name_Type (Attribute.Value.Value); - elsif - Attribute.Name = Name_Required_Switches - then + elsif Attribute.Name = Name_Required_Switches then -- Attribute Required_Switches: the minimum -- options to use when invoking the linker @@ -1843,6 +1841,8 @@ package body Prj.Nmsc is From_List => Attribute.Value.Values, In_Tree => In_Tree); + elsif Attribute.Name = Name_Map_File_Option then + Data.Config.Map_File_Option := Attribute.Value.Value; end if; end if; @@ -3854,8 +3854,8 @@ package body Prj.Nmsc is Error_Msg (Project, In_Tree, Continuation.all & - "library project %% cannot extend project %% " & - "that is not a library project", + "shared library project %% cannot extend " & + "project %% that is not a library project", Data.Location); Continuation := Continuation_String'Access; diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 4c2af09c85c..a27e3a31f81 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -1125,104 +1125,106 @@ package Prj is -- The table that contains the lists of project files type Project_Configuration is record - Run_Path_Option : Name_List_Index := No_Name_List; - -- The option to use when linking to specify the path where to look - -- for libraries. + Run_Path_Option : Name_List_Index := No_Name_List; + -- The option to use when linking to specify the path where to look for + -- libraries. - Executable_Suffix : Name_Id := No_Name; - -- The suffix of executables, when specified in the configuration - -- or in package Builder of the main project. When this is not - -- specified, the executable suffix is the default for the platform. + Executable_Suffix : Name_Id := No_Name; + -- The suffix of executables, when specified in the configuration or in + -- package Builder of the main project. When this is not specified, the + -- executable suffix is the default for the platform. - -- Linking + -- Linking - Linker : Path_Name_Type := No_Path; - -- Path name of the linker driver. Specified in the configuration - -- or in the package Builder of the main project. + Linker : Path_Name_Type := No_Path; + -- Path name of the linker driver. Specified in the configuration or in + -- the package Builder of the main project. - Minimum_Linker_Options : Name_List_Index := No_Name_List; - -- The minimum options for the linker driver. Specified in the - -- configuration. + Map_File_Option : Name_Id := No_Name; + -- Option to use when invoking the linker to build a map file - Linker_Executable_Option : Name_List_Index := No_Name_List; - -- The option(s) to indicate the name of the executable in the - -- linker command. Specified in the configuration. When not - -- specified, default to -o . + Minimum_Linker_Options : Name_List_Index := No_Name_List; + -- The minimum options for the linker driver. Specified in the + -- configuration. - Linker_Lib_Dir_Option : Name_Id := No_Name; - -- The option to specify where to find a library for linking. - -- Specified in the configuration. When not specified, defaults to - -- "-L". + Linker_Executable_Option : Name_List_Index := No_Name_List; + -- The option(s) to indicate the name of the executable in the linker + -- command. Specified in the configuration. When not specified, default + -- to -o . - Linker_Lib_Name_Option : Name_Id := No_Name; - -- The option to specify the name of a library for linking. Specified - -- in the configuration. When not specified, defaults to "-l". + Linker_Lib_Dir_Option : Name_Id := No_Name; + -- The option to specify where to find a library for linking. Specified + -- in the configuration. When not specified, defaults to "-L". - -- Libraries + Linker_Lib_Name_Option : Name_Id := No_Name; + -- The option to specify the name of a library for linking. Specified in + -- the configuration. When not specified, defaults to "-l". - Library_Builder : Path_Name_Type := No_Path; - -- The executable to build library (specified in the configuration) + -- Libraries - Lib_Support : Library_Support := None; - -- The level of library support. Specified in the configuration. - -- Support is none, static libraries only or both static and shared - -- libraries. + Library_Builder : Path_Name_Type := No_Path; + -- The executable to build library (specified in the configuration) - -- Archives + Lib_Support : Library_Support := None; + -- The level of library support. Specified in the configuration. Support + -- is none, static libraries only or both static and shared libraries. - Archive_Builder : Name_List_Index := No_Name_List; - -- The name of the executable to build archives, with the minimum - -- switches. Specified in the configuration. + Archive_Builder : Name_List_Index := No_Name_List; + -- The name of the executable to build archives, with the minimum + -- switches. Specified in the configuration. - Archive_Builder_Append_Option : Name_List_Index := No_Name_List; - -- The options to append object files to an archive + Archive_Builder_Append_Option : Name_List_Index := No_Name_List; + -- The options to append object files to an archive - Archive_Indexer : Name_List_Index := No_Name_List; - -- The name of the executable to index archives, with the minimum - -- switches. Specified in the configuration. + Archive_Indexer : Name_List_Index := No_Name_List; + -- The name of the executable to index archives, with the minimum + -- switches. Specified in the configuration. - Archive_Suffix : File_Name_Type := No_File; - -- The suffix of archives. Specified in the configuration. When not - -- specified, defaults to ".a". + Archive_Suffix : File_Name_Type := No_File; + -- The suffix of archives. Specified in the configuration. When not + -- specified, defaults to ".a". - Lib_Partial_Linker : Name_List_Index := No_Name_List; + Lib_Partial_Linker : Name_List_Index := No_Name_List; - -- Shared libraries + -- Shared libraries - Shared_Lib_Driver : File_Name_Type := No_File; - -- The driver to link shared libraries. Set with attribute - -- Library_GCC. Default to gcc. + Shared_Lib_Driver : File_Name_Type := No_File; + -- The driver to link shared libraries. Set with attribute Library_GCC. + -- Default to gcc. - Shared_Lib_Prefix : File_Name_Type := No_File; - -- Part of a shared library file name that precedes the name of the - -- library. Specified in the configuration. When not specified, - -- defaults to "lib". + Shared_Lib_Prefix : File_Name_Type := No_File; + -- Part of a shared library file name that precedes the name of the + -- library. Specified in the configuration. When not specified, defaults + -- to "lib". - Shared_Lib_Suffix : File_Name_Type := No_File; - -- Suffix of shared libraries, after the library name in the shared - -- library name. Specified in the configuration. When not specified, - -- default to ".so". + Shared_Lib_Suffix : File_Name_Type := No_File; + -- Suffix of shared libraries, after the library name in the shared + -- library name. Specified in the configuration. When not specified, + -- default to ".so". - Shared_Lib_Min_Options : Name_List_Index := No_Name_List; - -- Comment ??? + Shared_Lib_Min_Options : Name_List_Index := No_Name_List; + -- The minimum options to use when building a shared library - Lib_Version_Options : Name_List_Index := No_Name_List; - -- Comment ??? + Lib_Version_Options : Name_List_Index := No_Name_List; + -- The options to use to specify a library version - Symbolic_Link_Supported : Boolean := False; - -- Comment ??? + Symbolic_Link_Supported : Boolean := False; + -- True if the platform supports symbolic link files - Lib_Maj_Min_Id_Supported : Boolean := False; - -- Comment ??? + Lib_Maj_Min_Id_Supported : Boolean := False; + -- True if platform supports library major and minor options, such as + -- libname.so -> libname.so.2 -> libname.so.2.4 - Auto_Init_Supported : Boolean := False; - -- Comment ??? + Auto_Init_Supported : Boolean := False; + -- True if automatic initialisation is supported for shared stand-alone + -- libraries. end record; Default_Project_Config : constant Project_Configuration := (Run_Path_Option => No_Name_List, Executable_Suffix => No_Name, Linker => No_Path, + Map_File_Option => No_Name, Minimum_Linker_Options => No_Name_List, Linker_Executable_Option => No_Name_List, Linker_Lib_Dir_Option => No_Name, diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb index 84b24d26a4c..7d4cdddc479 100644 --- a/gcc/ada/snames.adb +++ b/gcc/ada/snames.adb @@ -767,6 +767,7 @@ package body Snames is "local_config_file#" & "local_configuration_pragmas#" & "locally_removed_files#" & + "map_file_option#" & "mapping_file_switches#" & "mapping_spec_suffix#" & "mapping_body_suffix#" & diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads index 0b247e7f462..c2001e68aa4 100644 --- a/gcc/ada/snames.ads +++ b/gcc/ada/snames.ads @@ -1088,63 +1088,64 @@ package Snames is Name_Local_Config_File : constant Name_Id := N + 706; Name_Local_Configuration_Pragmas : constant Name_Id := N + 707; Name_Locally_Removed_Files : constant Name_Id := N + 708; - Name_Mapping_File_Switches : constant Name_Id := N + 709; - Name_Mapping_Spec_Suffix : constant Name_Id := N + 710; - Name_Mapping_Body_Suffix : constant Name_Id := N + 711; - Name_Metrics : constant Name_Id := N + 712; - Name_Naming : constant Name_Id := N + 713; - Name_Object_Generated : constant Name_Id := N + 714; - Name_Objects_Linked : constant Name_Id := N + 715; - Name_Objects_Path : constant Name_Id := N + 716; - Name_Objects_Path_File : constant Name_Id := N + 717; - Name_Object_Dir : constant Name_Id := N + 718; - Name_Pic_Option : constant Name_Id := N + 719; - Name_Pretty_Printer : constant Name_Id := N + 720; - Name_Prefix : constant Name_Id := N + 721; - Name_Project : constant Name_Id := N + 722; - Name_Roots : constant Name_Id := N + 723; - Name_Required_Switches : constant Name_Id := N + 724; - Name_Run_Path_Option : constant Name_Id := N + 725; - Name_Runtime_Project : constant Name_Id := N + 726; - Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 727; - Name_Shared_Library_Prefix : constant Name_Id := N + 728; - Name_Shared_Library_Suffix : constant Name_Id := N + 729; - Name_Separate_Suffix : constant Name_Id := N + 730; - Name_Source_Dirs : constant Name_Id := N + 731; - Name_Source_Files : constant Name_Id := N + 732; - Name_Source_List_File : constant Name_Id := N + 733; - Name_Spec : constant Name_Id := N + 734; - Name_Spec_Suffix : constant Name_Id := N + 735; - Name_Specification : constant Name_Id := N + 736; - Name_Specification_Exceptions : constant Name_Id := N + 737; - Name_Specification_Suffix : constant Name_Id := N + 738; - Name_Stack : constant Name_Id := N + 739; - Name_Switches : constant Name_Id := N + 740; - Name_Symbolic_Link_Supported : constant Name_Id := N + 741; - Name_Sync : constant Name_Id := N + 742; - Name_Synchronize : constant Name_Id := N + 743; - Name_Toolchain_Description : constant Name_Id := N + 744; - Name_Toolchain_Version : constant Name_Id := N + 745; - Name_Runtime_Library_Dir : constant Name_Id := N + 746; + Name_Map_File_Option : constant Name_Id := N + 709; + Name_Mapping_File_Switches : constant Name_Id := N + 710; + Name_Mapping_Spec_Suffix : constant Name_Id := N + 711; + Name_Mapping_Body_Suffix : constant Name_Id := N + 712; + Name_Metrics : constant Name_Id := N + 713; + Name_Naming : constant Name_Id := N + 714; + Name_Object_Generated : constant Name_Id := N + 715; + Name_Objects_Linked : constant Name_Id := N + 716; + Name_Objects_Path : constant Name_Id := N + 717; + Name_Objects_Path_File : constant Name_Id := N + 718; + Name_Object_Dir : constant Name_Id := N + 719; + Name_Pic_Option : constant Name_Id := N + 720; + Name_Pretty_Printer : constant Name_Id := N + 721; + Name_Prefix : constant Name_Id := N + 722; + Name_Project : constant Name_Id := N + 723; + Name_Roots : constant Name_Id := N + 724; + Name_Required_Switches : constant Name_Id := N + 725; + Name_Run_Path_Option : constant Name_Id := N + 726; + Name_Runtime_Project : constant Name_Id := N + 727; + Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 728; + Name_Shared_Library_Prefix : constant Name_Id := N + 729; + Name_Shared_Library_Suffix : constant Name_Id := N + 730; + Name_Separate_Suffix : constant Name_Id := N + 731; + Name_Source_Dirs : constant Name_Id := N + 732; + Name_Source_Files : constant Name_Id := N + 733; + Name_Source_List_File : constant Name_Id := N + 734; + Name_Spec : constant Name_Id := N + 735; + Name_Spec_Suffix : constant Name_Id := N + 736; + Name_Specification : constant Name_Id := N + 737; + Name_Specification_Exceptions : constant Name_Id := N + 738; + Name_Specification_Suffix : constant Name_Id := N + 739; + Name_Stack : constant Name_Id := N + 740; + Name_Switches : constant Name_Id := N + 741; + Name_Symbolic_Link_Supported : constant Name_Id := N + 742; + Name_Sync : constant Name_Id := N + 743; + Name_Synchronize : constant Name_Id := N + 744; + Name_Toolchain_Description : constant Name_Id := N + 745; + Name_Toolchain_Version : constant Name_Id := N + 746; + Name_Runtime_Library_Dir : constant Name_Id := N + 747; -- Other miscellaneous names used in front end - Name_Unaligned_Valid : constant Name_Id := N + 747; + Name_Unaligned_Valid : constant Name_Id := N + 748; -- Ada 2005 reserved words - First_2005_Reserved_Word : constant Name_Id := N + 748; - Name_Interface : constant Name_Id := N + 748; - Name_Overriding : constant Name_Id := N + 749; - Name_Synchronized : constant Name_Id := N + 750; - Last_2005_Reserved_Word : constant Name_Id := N + 750; + First_2005_Reserved_Word : constant Name_Id := N + 749; + Name_Interface : constant Name_Id := N + 749; + Name_Overriding : constant Name_Id := N + 750; + Name_Synchronized : constant Name_Id := N + 751; + Last_2005_Reserved_Word : constant Name_Id := N + 751; subtype Ada_2005_Reserved_Words is Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word; -- Mark last defined name for consistency check in Snames body - Last_Predefined_Name : constant Name_Id := N + 750; + Last_Predefined_Name : constant Name_Id := N + 751; --------------------------------------- -- Subtypes Defining Name Categories -- -- 2.30.2