I’ve updated the original patch, which was built against 5.1.0 on x64_64-apple-darwin13, this patch is against 6.0.0-20151101 on x86_64-apple-darwin15. -------------- If the RTS in use is "configurable" (I believe this is the same in this context as "restricted") and includes finalization, gnatbind generates binder code that won't compile. This situation arises, for example, with an embedded RTS that incorporates the Ada 2012 generalized container iterators. I note that in the last 3 hunks of the attached patch there may be overkill; the original code checks whether the No_Finalization restriction doesn’t occur, and I’ve added a check that Configurable_Run_Time_On_Target isn’t set; I suspect, given other areas of the code, that the No_Finalization check is actually intended as a way of determining that this is a restricted runtime, and that the Configurable_Run_Time_On_Target check could replace it. The attached patch was bootstrapped/regression tested (make check-ada) against 6.0.0 on x86_64-apple-darwin15 (which confirms that the patch hasn't broken builds against the standard RTS). arm-eabi-gnatbind was successful against both an RTS with finalization and one without. gcc/ada/Changelog: 2015-11-11 Simon Wright PR ada/66205 * bindgen.adb (Gen_Adafinal): if Configurable_Run_Time_On_Target is true, generate a null body. (Gen_Main): if Configurable_Run_Time_On_Target is true, then - don't import __gnat_initialize or __gnat_finalize (as Initialize, Finalize rsp). - don't call Initialize or Finalize.