aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-10-10 14:43:38 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-10-10 14:43:38 +0200
commit3cd4a210696acc25b7bc0e338200edaf51112b88 (patch)
tree99e0d694578fa01b6d7d3d62fac6366d9edd538f /gcc/ada/lib-writ.adb
parent882eadaf20ec8237cf91cd46fea4d856dda0b3c6 (diff)
downloadgcc-3cd4a210696acc25b7bc0e338200edaf51112b88.zip
gcc-3cd4a210696acc25b7bc0e338200edaf51112b88.tar.gz
gcc-3cd4a210696acc25b7bc0e338200edaf51112b88.tar.bz2
[multiple changes]
2013-10-10 Robert Dewar <dewar@adacore.com> * lib-writ.adb (Write_Unit_Information): Fatal error if linker options are detected in a predefined generic unit. 2013-10-10 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c (CLOCK_REALTIME): Always define, possibly using a dummy placeholder value. (NEED_PTHREAD_CONDATTR_SETCLOCK): Remove, not needed anymore. * thread.c: Adjust #if test accordingly. 2013-10-10 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Consequence_Error): Generate an implicit if statement. (Expand_Contract_Cases): Generate an implicit if statement. (Process_Contract_Cases): Do not expand Contract_Cases when no code is being generated. 2013-10-10 Robert Dewar <dewar@adacore.com> * sem_attr.adb (Address_Checks): New procedure. 2013-10-10 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New Node Freeze_Generic_Entity, to trigger semantic actions at the proper point for entities that previously had no explicit freeze point. * freeze.adb (Freeze_Generic_Entities): generate new nodes to indicate the point at which semantic checks can be performed on entities declared in generic packages. * sem_ch13.ads, sem_ch13.adb: New procedure Analyze_Freeze_Generic_Entity. * exp_util.adb (Insert_Actions): Treat new node like Freeze_Entity. * sem.adb (Analyze): Call Analyze_Freeze_Generic_Entity. * sprint.adb (Sprint_Node): display Analyze_Freeze_Generic_Entity. * gcc-interface/trans.c: Ignore Analyze_Freeze_Generic_Entity. * gcc-interface/Make-lang.in: Update dependencies. From-SVN: r203367
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index c95b9dc..afc83d9 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -38,6 +38,7 @@ with Gnatvsn; use Gnatvsn;
with Opt; use Opt;
with Osint; use Osint;
with Osint.C; use Osint.C;
+with Output; use Output;
with Par;
with Par_SCO; use Par_SCO;
with Restrict; use Restrict;
@@ -615,9 +616,27 @@ package body Lib.Writ is
Write_With_Lines;
- -- Output linker option lines
+ -- Generate the linker option lines
for J in 1 .. Linker_Option_Lines.Last loop
+
+ -- Pragma Linker_Options is not allowed in predefined generic
+ -- units. This is because they won't be read, due to the fact that
+ -- with lines for generic units lack the file name and lib name
+ -- parameters (see Lib_Writ spec for an explanation).
+
+ if Is_Generic_Unit (Cunit_Entity (Main_Unit))
+ and then
+ Is_Predefined_File_Name (Unit_File_Name (Current_Sem_Unit))
+ then
+ Set_Standard_Error;
+ Write_Line
+ ("linker options not allowed in predefined generic unit");
+ raise Unrecoverable_Error;
+ end if;
+
+ -- Output one linker option line
+
declare
S : Linker_Option_Entry renames Linker_Option_Lines.Table (J);
begin