From 739c66291db5ef5ed31f5bbd61e3e0cebcdc7b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Fri, 12 Sep 2014 18:51:02 +0000 Subject: [PATCH] ARM: first naive attempt to get gprofiling work for arm-linux. (Work-In-Progress, but at least for me it doesn't explode) git-svn-id: trunk@28645 - --- compiler/arm/cgcpu.pas | 9 +++++++++ compiler/options.pas | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/arm/cgcpu.pas b/compiler/arm/cgcpu.pas index 5492a7c7b3..d94306c9da 100644 --- a/compiler/arm/cgcpu.pas +++ b/compiler/arm/cgcpu.pas @@ -71,6 +71,8 @@ unit cgcpu; procedure g_flags2reg(list: TAsmList; size: TCgSize; const f: TResFlags; reg: TRegister); override; + procedure g_profilecode(list : TAsmList); override; + procedure g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean);override; procedure g_proc_exit(list : TAsmList;parasize : longint;nostackframe:boolean); override; procedure g_maybe_got_init(list : TAsmList); override; @@ -1796,6 +1798,13 @@ unit cgcpu; list.concat(setcondition(taicpu.op_reg_const(A_MOV,reg,0),inverse_cond(flags_to_cond(f)))); end; + procedure tbasecgarm.g_profilecode(list : TAsmList); + begin + if target_info.system = system_arm_linux then + a_call_name(list,target_info.Cprefix+'mcount',false) + else + internalerror(2014091201); + end; procedure tbasecgarm.g_proc_entry(list : TAsmList;localsize : longint;nostackframe:boolean); var diff --git a/compiler/options.pas b/compiler/options.pas index 6c8cd583d2..2eea83b443 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -112,7 +112,7 @@ var const { gprof (requires implementation of g_profilecode in the code generator) } - supported_targets_pg = [system_i386_linux,system_x86_64_linux,system_mipseb_linux,system_mipsel_linux] + supported_targets_pg = [system_i386_linux,system_x86_64_linux,system_mipseb_linux,system_mipsel_linux,system_arm_linux] + [system_i386_win32] + [system_powerpc_darwin,system_x86_64_darwin] + [system_i386_GO32V2]