Skip to content

Commit

Permalink
-profile was broken, at least on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
rversteegen authored and jayrm committed Jan 2, 2024
1 parent a1ffde6 commit 293d550
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/ast-node-proc.bas
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/fbc.bas
Expand Up @@ -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
Expand Down

0 comments on commit 293d550

Please sign in to comment.