[PATCH] D75499: [cmake] By default do not build compiler-rt with PGO instrumentation or use

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 14:49:35 PST 2020


xur added a comment.

The problem here is libclang_rt.fuzzer-x86_64.a is instrumented and contains calls to profile runtime functions like __llvm_profile_instrument_target.
When building with fuzzing, libclang_rt.fuzzer-x86_64.a is linked in. We also have the definition of __llvm_profile_instrument_target in the compiler.
But I don't think the compiler knows how to resolve this symbol to itself.

I think this could happen to any library, not just compiler runtime.

It seems to me if one builds an library with instrumentation, one needs to link the profile-runtime library manually.
For this case, if I add -fprofile-generate to the fuzzer, the build would pass.

Do you have to build compiler_rt in instrumentation build? Is it a way to avoid?

If not, this patch certainly would help. Especially this is under an option and sets to false by default.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75499/new/

https://reviews.llvm.org/D75499





More information about the llvm-commits mailing list