[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 6 Jan 2017 13:28:43 +0000 (14:28 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 6 Jan 2017 13:28:43 +0000 (14:28 +0100)
2017-01-06  Bob Duff  <duff@adacore.com>

* bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
"Bind_Main_Program" to "not Bind_For_Library", because otherwise
we won't generate the call to s_stalib_adafinal when the main
is not written in Ada.

2017-01-06  Bob Duff  <duff@adacore.com>

* sem_prag.adb: Minor: remove pragma Warnings.

2017-01-06  Tristan Gingold  <gingold@adacore.com>

* Makefile.rtl: Do not compile s-stchop by default.

From-SVN: r244154

gcc/ada/ChangeLog
gcc/ada/Makefile.rtl
gcc/ada/bindgen.adb
gcc/ada/sem_prag.adb

index a8d4a00..a7921c5 100644 (file)
@@ -1,3 +1,18 @@
+2017-01-06  Bob Duff  <duff@adacore.com>
+
+       * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
+       "Bind_Main_Program" to "not Bind_For_Library", because otherwise
+       we won't generate the call to s_stalib_adafinal when the main
+       is not written in Ada.
+
+2017-01-06  Bob Duff  <duff@adacore.com>
+
+       * sem_prag.adb: Minor: remove pragma Warnings.
+
+2017-01-06  Tristan Gingold  <gingold@adacore.com>
+
+       * Makefile.rtl: Do not compile s-stchop by default.
+
 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
 
        * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
index 5b49258..5f5c3a8 100644 (file)
@@ -658,7 +658,6 @@ GNATRTL_NONTASKING_OBJS= \
   s-stache$(objext) \
   s-stalib$(objext) \
   s-stausa$(objext) \
-  s-stchop$(objext) \
   s-stoele$(objext) \
   s-stopoo$(objext) \
   s-stposu$(objext) \
index 58089c5..0955b1a 100644 (file)
@@ -415,7 +415,13 @@ package body Bindgen is
    begin
       WBI ("   procedure " & Ada_Final_Name.all & " is");
 
-      if Bind_Main_Program and not CodePeer_Mode then
+      --  Call s_stalib_adafinal to await termination of tasks and so on. We
+      --  want to do this if there is a main program, either in Ada or in some
+      --  other language. (Note that Bind_Main_Program is True for Ada mains,
+      --  but False for mains in other languages.) We do not want to do this if
+      --  we're binding a library.
+
+      if not Bind_For_Library and not CodePeer_Mode then
          WBI ("      procedure s_stalib_adafinal;");
          Set_String ("      pragma Import (C, s_stalib_adafinal, ");
          Set_String ("""system__standard_library__adafinal"");");
@@ -442,7 +448,7 @@ package body Bindgen is
       --  on whether this is the main program or a library.
 
       if not CodePeer_Mode then
-         if Bind_Main_Program then
+         if not Bind_For_Library then
             WBI ("      s_stalib_adafinal;");
          elsif Lib_Final_Built then
             WBI ("      finalize_library;");
@@ -906,7 +912,7 @@ package body Bindgen is
       --  tasks are non-terminating, so we do not want library-level
       --  finalization.
 
-      elsif Bind_Main_Program
+      elsif not Bind_For_Library
         and then not Configurable_Run_Time_On_Target
         and then not Suppress_Standard_Library_On_Target
       then
index f9ffb20..608acd0 100644 (file)
@@ -19042,7 +19042,6 @@ package body Sem_Prag is
          --           [New_Name =>] IDENTIFIER,
          --           [Renamed  =>] pragma_IDENTIFIER);
 
-         pragma Warnings (Off);
          when Pragma_Rename_Pragma => Rename_Pragma : declare
             New_Name : constant Node_Id := Get_Pragma_Arg (Arg1);
             Old_Name : constant Node_Id := Get_Pragma_Arg (Arg2);
@@ -19076,7 +19075,6 @@ package body Sem_Prag is
 
             Map_Pragma_Name (From => Chars (New_Name), To => Chars (Old_Name));
          end Rename_Pragma;
-         pragma Warnings (On);
 
          -------------
          -- Polling --