[compiler-rt] 467c719 - [profile] Change linkage type of a compiler-rt func

Gulfem Savrun Yeniceri via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 11:22:30 PDT 2021


Author: Gulfem Savrun Yeniceri
Date: 2021-07-21T18:22:05Z
New Revision: 467c7191249b76abff33853b1692a77f327c2422

URL: https://github.com/llvm/llvm-project/commit/467c7191249b76abff33853b1692a77f327c2422
DIFF: https://github.com/llvm/llvm-project/commit/467c7191249b76abff33853b1692a77f327c2422.diff

LOG: [profile] Change linkage type of a compiler-rt func

This patch changes the linkage type of a compiler-rt func
(__llvm_write_binary_ids) to fix the sanitizer-windows bot
build issue introduced in change f984ac271.

The issue is as the following:
C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\profile\InstrProfilingInternal.h(201):
error C2496: '__llvm_write_binary_ids': 'selectany' can only be applied
to data items with external linkage

Added: 
    

Modified: 
    compiler-rt/lib/profile/InstrProfilingInternal.c
    compiler-rt/lib/profile/InstrProfilingInternal.h
    compiler-rt/lib/profile/InstrProfilingPlatformLinux.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/InstrProfilingInternal.c b/compiler-rt/lib/profile/InstrProfilingInternal.c
index c14f9f83fcb2..1911fcc10a2e 100644
--- a/compiler-rt/lib/profile/InstrProfilingInternal.c
+++ b/compiler-rt/lib/profile/InstrProfilingInternal.c
@@ -37,8 +37,7 @@ COMPILER_RT_VISIBILITY void lprofSetRuntimeCounterRelocation(unsigned Value) {
  * The runtime provides the default definition of this function
  * for the platforms that do not support binary id.
  */
-COMPILER_RT_VISIBILITY COMPILER_RT_WEAK int
-__llvm_write_binary_ids(ProfDataWriter *Writer) {
+COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) {
   return 0;
 }
 

diff  --git a/compiler-rt/lib/profile/InstrProfilingInternal.h b/compiler-rt/lib/profile/InstrProfilingInternal.h
index 51454b7a83e5..bb725294ae8c 100644
--- a/compiler-rt/lib/profile/InstrProfilingInternal.h
+++ b/compiler-rt/lib/profile/InstrProfilingInternal.h
@@ -197,7 +197,6 @@ extern void (*VPMergeHook)(struct ValueProfData *, __llvm_profile_data *);
  * Write binary ids into profiles if writer is given.
  * Return -1 if an error occurs, otherwise, return total size of binary ids.
  */
-COMPILER_RT_VISIBILITY COMPILER_RT_WEAK int
-__llvm_write_binary_ids(ProfDataWriter *Writer);
+COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer);
 
 #endif

diff  --git a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
index 7e2e5d6e581e..508624a80cd6 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
@@ -157,8 +157,7 @@ int WriteBinaryIds(ProfDataWriter *Writer, const ElfW(Nhdr) * Note,
  * Return the total size of binary ids.
  * If an error happens while writing, return -1.
  */
-COMPILER_RT_VISIBILITY COMPILER_RT_WEAK int
-__llvm_write_binary_ids(ProfDataWriter *Writer) {
+COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) {
   extern const ElfW(Ehdr) __ehdr_start __attribute__((visibility("hidden")));
   const ElfW(Ehdr) *ElfHeader = &__ehdr_start;
   const ElfW(Phdr) *ProgramHeader =


        


More information about the llvm-commits mailing list