[all-commits] [llvm/llvm-project] 0f6220: [profile] Move __llvm_profile_raw_version into a s...

Min-Yih Hsu via All-commits all-commits at lists.llvm.org
Thu Jul 16 16:02:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f6220ddd6c751ff83fa1afe464ff0737ab0bf07
      https://github.com/llvm/llvm-project/commit/0f6220ddd6c751ff83fa1afe464ff0737ab0bf07
  Author: Min-Yih Hsu <minyihh at uci.edu>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M compiler-rt/lib/profile/CMakeLists.txt
    M compiler-rt/lib/profile/InstrProfiling.c
    A compiler-rt/lib/profile/InstrProfilingVersionVar.c
    A compiler-rt/test/profile/instrprof-lto-pgogen.c

  Log Message:
  -----------
  [profile] Move __llvm_profile_raw_version into a separate file

Similar to the reason behind moving __llvm_profile_filename into a
separate file[1]. When users try to use Full LTO with BFD linker to
generate IR level PGO profile, the __llvm_profile_raw_version variable,
which is used for marking instrumentation level, generated by frontend
would somehow conflict with the weak symbol provided by profiling
runtime.

In most of the cases, BFD linkers will pick profiling runtime's weak symbol
as the real definition and thus generate the incorrect instrumentation
level metadata in the final executables.

Moving __llvm_profile_raw_version into a separate file would make
linkers not seeing the weak symbol in the archive unless the frontend
doesn't generate one.

[1] https://reviews.llvm.org/D34797

Differential Revision: https://reviews.llvm.org/D83967




More information about the All-commits mailing list