aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatbind.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-06-20 14:25:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-06-20 14:25:44 +0200
commit2f8d7dfe21740d1066912f2f99b83096ebf2962b (patch)
treeb5fde2e52c699b7ea7fe5aefa2230ad7902ef393 /gcc/ada/gnatbind.adb
parent61f17a5c5a8565c5ebfcdbe78f16b56c52b285dd (diff)
downloadgcc-2f8d7dfe21740d1066912f2f99b83096ebf2962b.zip
gcc-2f8d7dfe21740d1066912f2f99b83096ebf2962b.tar.gz
gcc-2f8d7dfe21740d1066912f2f99b83096ebf2962b.tar.bz2
[multiple changes]
2016-06-20 Hristian Kirtchev <kirtchev@adacore.com> * s-regpat.adb, sem_prag.adb, pprint.adb, sem_ch13.adb: Minor reformatting. 2016-06-20 Tristan Gingold <gingold@adacore.com> * make.adb (Check_Standard_Library): Consider system.ads if s-stalib.adb is not available. * gnatbind.adb (Add_Artificial_ALI_File): New procedure extracted from gnatbind. 2016-06-20 Thomas Quinot <quinot@adacore.com> * g-socket.adb (Is_IP_Address): A string consisting in digits only is not a dotted quad. 2016-06-20 Arnaud Charlet <charlet@adacore.com> * exp_ch7.adb (Build_Invariant_Procedure_Body): decorate invariant procedure body with typical properties of procedure entityes. 2016-06-20 Arnaud Charlet <charlet@adacore.com> * a-exetim-darwin.adb: New file. From-SVN: r237598
Diffstat (limited to 'gcc/ada/gnatbind.adb')
-rw-r--r--gcc/ada/gnatbind.adb57
1 files changed, 35 insertions, 22 deletions
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index 3a4ec53..1fa489a 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, 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- --
@@ -89,6 +89,9 @@ procedure Gnatbind is
-- Table to record the sources in the closure, to avoid duplications. Used
-- only with switch -R.
+ procedure Add_Artificial_ALI_File (Name : String);
+ -- Artificially add ALI file Name in the closure.
+
function Gnatbind_Supports_Auto_Init return Boolean;
-- Indicates if automatic initialization of elaboration procedure
-- through the constructor mechanism is possible on the platform.
@@ -113,6 +116,30 @@ procedure Gnatbind is
function Is_Cross_Compiler return Boolean;
-- Returns True iff this is a cross-compiler
+ -----------------------------
+ -- Add_Artificial_ALI_File --
+ -----------------------------
+
+ procedure Add_Artificial_ALI_File (Name : String) is
+ Id : ALI_Id;
+ pragma Warnings (Off, Id);
+ begin
+ Name_Len := Name'Length;
+ Name_Buffer (1 .. Name_Len) := Name;
+ Std_Lib_File := Name_Find;
+ Text := Read_Library_Info (Std_Lib_File, True);
+
+ Id :=
+ Scan_ALI
+ (F => Std_Lib_File,
+ T => Text,
+ Ignore_ED => False,
+ Err => False,
+ Ignore_Errors => Debug_Flag_I);
+
+ Free (Text);
+ end Add_Artificial_ALI_File;
+
---------------------------------
-- Gnatbind_Supports_Auto_Init --
---------------------------------
@@ -740,29 +767,15 @@ begin
-- Add System.Standard_Library to list to ensure that these files are
-- included in the bind, even if not directly referenced from Ada code
- -- This is suppressed if the appropriate targparm switch is set.
+ -- This is suppressed if the appropriate targparm switch is set. Be sure
+ -- in any case that System is in the closure, as it may contains linker
+ -- options. Note that it will be automatically added if s-stalib is
+ -- added.
if not Suppress_Standard_Library_On_Target then
- Name_Buffer (1 .. 12) := "s-stalib.ali";
- Name_Len := 12;
- Std_Lib_File := Name_Find;
- Text := Read_Library_Info (Std_Lib_File, True);
-
- declare
- Id : ALI_Id;
- pragma Warnings (Off, Id);
-
- begin
- Id :=
- Scan_ALI
- (F => Std_Lib_File,
- T => Text,
- Ignore_ED => False,
- Err => False,
- Ignore_Errors => Debug_Flag_I);
- end;
-
- Free (Text);
+ Add_Artificial_ALI_File ("s-stalib.ali");
+ else
+ Add_Artificial_ALI_File ("system.ali");
end if;
-- Load ALIs for all dependent units