From: Vadim Godunko <[email protected]>
`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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/bindgen.adb | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index 14367ebe97a7..24cc8dfb8990 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -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;");
--
2.43.0