From 293d5504268e4c7d44972954b2ac05f82b6a5822 Mon Sep 17 00:00:00 2001 From: Ralph Versteegen Date: Fri, 20 Mar 2020 16:53:34 +1300 Subject: [PATCH] -profile was broken, at least on Linux --- src/compiler/ast-node-proc.bas | 2 +- src/compiler/fbc.bas | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/ast-node-proc.bas b/src/compiler/ast-node-proc.bas index 445f0ba0c..563c990b5 100644 --- a/src/compiler/ast-node-proc.bas +++ b/src/compiler/ast-node-proc.bas @@ -623,7 +623,7 @@ private function hCallProfiler _ ) as ASTNODE ptr '' on all ports except dos _mcount() is just a normal call - if( env.clopt.profile ) then + if( env.clopt.profile andalso ( fbGetOption( FB_COMPOPT_BACKEND ) <> FB_BACKEND_GCC ) ) then if( env.clopt.target <> FB_COMPTARGET_DOS ) then head_node = astAddAfter( rtlProfileCall_mcount(), head_node ) end if diff --git a/src/compiler/fbc.bas b/src/compiler/fbc.bas index 600264dd5..fdcdb25e9 100644 --- a/src/compiler/fbc.bas +++ b/src/compiler/fbc.bas @@ -3636,6 +3636,10 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege ln += "-g " end if + if( fbGetOption( FB_COMPOPT_PROFILE ) ) then + ln += "-pg " + end if + if( fbGetOption( FB_COMPOPT_FPUTYPE ) = FB_FPUTYPE_SSE ) then if( fbGetOption( FB_COMPOPT_TARGET ) = FB_COMPTARGET_ANDROID ) then '' Guaranteed to be present