GCC FDO

General FreeBASIC programming questions.
Post Reply
Provoni
Posts: 514
Joined: Jan 05, 2014 12:33
Location: Belgium

GCC FDO

Post by Provoni »

How does one get the feedback-directed optimization (FDO) flags to work with FreeBASIC programs?

The flags are:

Code: Select all

-fprofile-generate
-fprofile-use
The flag -fprofile-generate should be used first but it throws a bunch of errors:

Code: Select all

Program2.o:fake:(.text+0x15): undefined reference to `__gcov_indirect_call_profiler_v2'
Program2.o:fake:(.text+0x37): undefined reference to `__gcov_time_profiler'
Program2.o:fake:(.text+0xc6): undefined reference to `__gcov_indirect_call_profiler_v2'
...
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GCC FDO

Post by MrSwiss »

Do you have the profiler (gprof) installed?
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: GCC FDO

Post by fxm »

'gprof.exe' is in the 'bin' directory of all official releases, but not in the daily St_W build.
Provoni
Posts: 514
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: GCC FDO

Post by Provoni »

MrSwiss wrote:Do you have the profiler (gprof) installed?
Not sure what you mean with installed but gprof.exe is in the win64 bin directory.
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: GCC FDO

Post by fxm »

? :
-Wc -fprofile-generate
see Compiler Option: -Wc
Provoni
Posts: 514
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: GCC FDO

Post by Provoni »

fxm wrote:? :
-Wc -fprofile-generate
see Compiler Option: -Wc
Yes, -Wc -fprofile-generate.
Post Reply