[PATCH] D41111: [profile] Solaris ld supports __start___llvm_prof_data etc. labels

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 07:03:54 PDT 2019


ro updated this revision to Diff 205802.
ro added a comment.
Herald added a project: LLVM.

Rebased an slightly fixed version.  Without it, man profiling tests on Solaris FAIL like

  Command Output (stderr):
  --
  Undefined                       first referenced
   symbol                             in file
  __llvm_profile_register_names_function /tmp/lit_tmp_Nqu4eh/infinite_loop-9dc638.o
  __llvm_profile_register_function    /tmp/lit_tmp_Nqu4eh/infinite_loop-9dc638.o

I don't think we need to worry about older versions of Solaris ld that don't support
`__start_SECNAME` and `stop_SECNAME` labels any longer: that feature is in
Solaris 11.4 and we already use Solaris 11.4-only features like `ld -z gnu-version-script-compat`
and fully working `.preinit_array` suport in compiler-rt.

Tested on `amd64-pc-solaris2.11`, ok for trunk now?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D41111

Files:
  lib/Transforms/Instrumentation/InstrProfiling.cpp
  test/Instrumentation/InstrProfiling/platform.ll


Index: test/Instrumentation/InstrProfiling/platform.ll
===================================================================
--- test/Instrumentation/InstrProfiling/platform.ll
+++ test/Instrumentation/InstrProfiling/platform.ll
@@ -42,19 +42,16 @@
 ; MACHO-NOT: define internal void @__llvm_profile_register_functions
 ; LINUX-NOT: define internal void @__llvm_profile_register_functions
 ; FREEBSD-NOT: define internal void @__llvm_profile_register_functions
+; SOLARIS-NOT: define internal void @__llvm_profile_register_functions
 ; PS4-NOT: define internal void @__llvm_profile_register_functions
 ; WINDOWS-NOT: define internal void @__llvm_profile_register_functions
 
 ;; PR38340: When dynamic registration is used, we had a bug where we'd register
 ;; something that's not a __profd_* variable.
 
-; SOLARIS: define internal void @__llvm_profile_register_functions
-; SOLARIS-NOT: __llvm_profile_runtime_user
-; SOLARIS: ret void
-
 ; MACHO-NOT: define internal void @__llvm_profile_init
 ; LINUX-NOT: define internal void @__llvm_profile_init
 ; FREEBSD-NOT: define internal void @__llvm_profile_init
+; SOLARIS-NOT: define internal void @__llvm_profile_init
 ; PS4-NOT: define internal void @__llvm_profile_init
 ; WINDOWS-NOT: define internal void @__llvm_profile_init
-; SOLARIS: define internal void @__llvm_profile_init
Index: lib/Transforms/Instrumentation/InstrProfiling.cpp
===================================================================
--- lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -713,7 +713,8 @@
     return false;
   // Use linker script magic to get data/cnts/name start/end.
   if (TT.isOSLinux() || TT.isOSFreeBSD() || TT.isOSNetBSD() ||
-      TT.isOSFuchsia() || TT.isPS4CPU() || TT.isOSWindows())
+      TT.isOSSolaris() || TT.isOSFuchsia() || TT.isPS4CPU() ||
+      TT.isOSWindows())
     return false;
 
   return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41111.205802.patch
Type: text/x-patch
Size: 1919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190620/9f29f24c/attachment.bin>


More information about the llvm-commits mailing list