[Ada] Bindgen: protect reference to System.Parameters with Sec_Stack_Used
authorArnaud Charlet <charlet@adacore.com>
Mon, 11 Jun 2018 09:16:59 +0000 (09:16 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 11 Jun 2018 09:16:59 +0000 (09:16 +0000)
2018-06-11  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/
* bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
with Sec_Stack_Used.

From-SVN: r261401

gcc/ada/ChangeLog
gcc/ada/bindgen.adb

index 0f51c439308cc6fcd2cac3c9c4743bc6732e7354..a2624b895348834c14cf7cb572f7dc7385643961 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-11  Arnaud Charlet  <charlet@adacore.com>
+
+       * bindgen.adb (Gen_Adainit): Protect reference to System.Parameters
+       with Sec_Stack_Used.
+
 2018-06-11  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_ch8.adb (Find_Direct_Name): Mode the declaration of
index 3950dc7a8edb3fd1d09105741b65e4ce24cbc0be..4b4e2bb77b80d9c3997343b908348d9165a3ed1e 100644 (file)
@@ -745,10 +745,14 @@ package body Bindgen is
          WBI ("      Default_Stack_Size : Integer;");
          WBI ("      pragma Import (C, Default_Stack_Size, " &
               """__gl_default_stack_size"");");
-         WBI ("      Default_Secondary_Stack_Size : " &
-              "System.Parameters.Size_Type;");
-         WBI ("      pragma Import (C, Default_Secondary_Stack_Size, " &
-              """__gnat_default_ss_size"");");
+
+         if Sec_Stack_Used then
+            WBI ("      Default_Secondary_Stack_Size : " &
+                 "System.Parameters.Size_Type;");
+            WBI ("      pragma Import (C, Default_Secondary_Stack_Size, " &
+                 """__gnat_default_ss_size"");");
+         end if;
+
          WBI ("      Leap_Seconds_Support : Integer;");
          WBI ("      pragma Import (C, Leap_Seconds_Support, " &
               """__gl_leap_seconds_support"");");