diff --git a/compiler/ncginl.pas b/compiler/ncginl.pas index 415ac24780..3851542145 100644 --- a/compiler/ncginl.pas +++ b/compiler/ncginl.pas @@ -694,14 +694,14 @@ implementation procedure Tcginlinenode.second_get_frame; begin -{$ifdef x86} +{$if defined(x86) or defined(arm)} if current_procinfo.framepointer=NR_STACK_POINTER_REG then begin location_reset(location,LOC_CONSTANT,OS_ADDR); location.value:=0; end else -{$endif x86} +{$endif defined(x86) or defined(arm)} begin location_reset(location,LOC_CREGISTER,OS_ADDR); location.register:=current_procinfo.framepointer; diff --git a/compiler/options.pas b/compiler/options.pas index bc3644abd9..d3b27ada96 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -1924,7 +1924,7 @@ begin def_system_macro('FPC_HAS_VALGRINDBOOL'); def_system_macro('FPC_HAS_STR_CURRENCY'); def_system_macro('FPC_REAL2REAL_FIXED'); -{$ifdef x86} +{$if defined(x86) or defined(arm)} def_system_macro('INTERNAL_BACKTRACE'); {$endif} def_system_macro('STR_CONCAT_PROCS'); diff --git a/compiler/psystem.pas b/compiler/psystem.pas index 92987e163c..9a7f63e974 100644 --- a/compiler/psystem.pas +++ b/compiler/psystem.pas @@ -94,9 +94,9 @@ implementation systemunit.insert(tsyssym.create('Length',in_length_x)); systemunit.insert(tsyssym.create('New',in_new_x)); systemunit.insert(tsyssym.create('Dispose',in_dispose_x)); -{$ifdef x86} +{$if defined(x86) or defined(arm)} systemunit.insert(tsyssym.create('Get_Frame',in_get_frame)); -{$endif x86} +{$endif defined(x86) or defined(arm)} {$ifdef SUPPORT_UNALIGNED} systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x)); {$endif SUPPORT_UNALIGNED} diff --git a/rtl/arm/arm.inc b/rtl/arm/arm.inc index 41c4ee4c30..f049bb4507 100644 --- a/rtl/arm/arm.inc +++ b/rtl/arm/arm.inc @@ -33,12 +33,13 @@ end; stack frame related stuff ****************************************************************************} +{$IFNDEF INTERNAL_BACKTRACE} {$define FPC_SYSTEM_HAS_GET_FRAME} function get_frame:pointer;assembler;nostackframe;{$ifdef SYSTEMINLINE}inline;{$endif} asm mov r0,r11 end ['R0']; - +{$ENDIF not INTERNAL_BACKTRACE} {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR} function get_caller_addr(framebp:pointer):pointer;assembler;{$ifdef SYSTEMINLINE}inline;{$endif}