diff options
-rw-r--r-- | translate/grt/grt-signals.adb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/translate/grt/grt-signals.adb b/translate/grt/grt-signals.adb index 13842d2..fd99e43 100644 --- a/translate/grt/grt-signals.adb +++ b/translate/grt/grt-signals.adb @@ -1737,7 +1737,6 @@ package body Grt.Signals is -- return Length; -- end Get_Nbr_Non_Null_Source; - type Resolver_Acc is access procedure (Instance : System.Address; Val : System.Address; @@ -1746,6 +1745,20 @@ package body Grt.Signals is Nbr_Drv : Ghdl_Index_Type; Nbr_Ports : Ghdl_Index_Type); + -- On some platforms, GNAT use a descriptor (instead of a trampoline) for + -- nested subprograms. This descriptor contains the address of the + -- subprogram and the address of the chain. An unaligned pointer to this + -- descriptor (address + 1) is then used for 'Access, and every indirect + -- call check for unaligned address. + -- + -- Disable this feature (as a resolver is never a nested subprogram), so + -- code generated by ghdl is compatible with ghdl runtimes built with + -- gnat. + -- + -- If your compiler doesn't understand this pragma, you could safely + -- remove the pragma. + pragma Favor_Top_Level (Resolver_Acc); + function To_Resolver_Acc is new Ada.Unchecked_Conversion (Source => System.Address, Target => Resolver_Acc); |