getsolus / ypkg

Modern, declarative, structured build format
https://getsol.us
GNU General Public License v3.0
22 stars 11 forks source link

Profile instrumentation flags must also be added to LDFLAGS #10

Closed joebonrichie closed 2 years ago

joebonrichie commented 5 years ago

Both GCC and Clang documentation states that instrumentation flags must be used both when compiling and linking with instrumentation. Previously some packages failed to build with PGO with errors similar to this;

undefined reference to `__gcov_time_profiler_counter'

A poor workaround was to add -lgcov to LDFLAGS, however, this was much slower and gave poorer optimization than by simply passing instrumentation flags to the linker.

It is not neccessary pass PGO use flags to the linker.

This fixes PGO'ing: R, chromium, notepadqq and a bunch of other packages.

Signed-off-by: Joey Riches josephriches@gmail.com