[COMMITTED,04/27] ada: Fix code generation when there is no No_Finalization restiction

Message ID 20250915130135.2720894-4-poulhies@adacore.com
State Committed
Commit 90997ddd7b8764741e57bee52bcd3712afb3ea8d
Headers
Series [COMMITTED,01/27] ada: Fix documentation of Is_Ancestor_Package |

Commit Message

Marc Poulhiès Sept. 15, 2025, 1:01 p.m. UTC
  From: Vadim Godunko <godunko@adacore.com>

Check whether library is elaborated is not generated when there is not
standard library available on target.

gcc/ada/ChangeLog:

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

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/bindgen.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index cb39af67f9a5..14367ebe97a7 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -490,7 +490,9 @@  package body Bindgen is
       WBI ("");
       WBI ("   begin");
 
-      if not CodePeer_Mode then
+      if not CodePeer_Mode
+        and not Suppress_Standard_Library_On_Target
+      then
          WBI ("      if not Is_Elaborated then");
          WBI ("         return;");
          WBI ("      end if;");