]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Don't generate call of `System.Standard_Library.Adafinal`
authorVadim Godunko <godunko@adacore.com>
Sun, 13 Jul 2025 06:26:19 +0000 (10:26 +0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 15 Sep 2025 12:59:26 +0000 (14:59 +0200)
`adafinal` is not available on targets without standard library.

gcc/ada/ChangeLog:

* bindgen.adb (Gen_Adafinal): Don't generate call of adafinal
when use of standard library suppressed.

gcc/ada/bindgen.adb

index 14367ebe97a746e74885676010c6a48e452087c1..24cc8dfb899077a60649f3ef08ece658ae0cd32e 100644 (file)
@@ -476,7 +476,10 @@ package body Bindgen is
       --  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
+      if not Bind_For_Library
+        and not CodePeer_Mode
+        and not Suppress_Standard_Library_On_Target
+      then
          WBI ("      procedure s_stalib_adafinal;");
          Set_String ("      pragma Import (Ada, s_stalib_adafinal, ");
          Set_String ("""system__standard_library__adafinal"");");
@@ -505,7 +508,9 @@ package body Bindgen is
       --  on whether this is the main program or a library.
 
       if not CodePeer_Mode then
-         if not Bind_For_Library then
+         if not Bind_For_Library
+           and not Suppress_Standard_Library_On_Target
+         then
             WBI ("      s_stalib_adafinal;");
          elsif Lib_Final_Built then
             WBI ("      finalize_library;");