llvm.org GIT mirror llvm / 8f6eb8b
[profile] Solaris ld supports __start___llvm_prof_data etc. labels Currently, many 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 Solaris 11.4 ld supports the non-standard GNU ld extension of adding __start_SECNAME and __stop_SECNAME labels to sections whose names are valid as C identifiers. Given that we already use Solaris 11.4-only features like ld -z gnu-version-script-compat and fully working .preinit_array support in compiler-rt, we don't need to worry about older versions of Solaris ld. The patch documents that support (although the comment in lib/Transforms/Instrumentation/InstrProfiling.cpp (needsRuntimeRegistrationOfSectionRange) is quite cryptic what it's actually about), and adapts the affected testcase not to expect the alternativeq __llvm_profile_register_functions and __llvm_profile_init. It fixes all affected tests. Tested on amd64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D41111 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363984 91177308-0d34-0410-b5e6-96231b3b80d8 Rainer Orth 3 months ago
2 changed file(s) with 4 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
712712 return false;
713713 // Use linker script magic to get data/cnts/name start/end.
714714 if (TT.isOSLinux() || TT.isOSFreeBSD() || TT.isOSNetBSD() ||
715 TT.isOSFuchsia() || TT.isPS4CPU() || TT.isOSWindows())
715 TT.isOSSolaris() || TT.isOSFuchsia() || TT.isPS4CPU() ||
716 TT.isOSWindows())
716717 return false;
717718
718719 return true;
4141 ; MACHO-NOT: define internal void @__llvm_profile_register_functions
4242 ; LINUX-NOT: define internal void @__llvm_profile_register_functions
4343 ; FREEBSD-NOT: define internal void @__llvm_profile_register_functions
44 ; SOLARIS-NOT: define internal void @__llvm_profile_register_functions
4445 ; PS4-NOT: define internal void @__llvm_profile_register_functions
4546 ; WINDOWS-NOT: define internal void @__llvm_profile_register_functions
4647
4748 ;; PR38340: When dynamic registration is used, we had a bug where we'd register
4849 ;; something that's not a __profd_* variable.
4950
50 ; SOLARIS: define internal void @__llvm_profile_register_functions
51 ; SOLARIS-NOT: __llvm_profile_runtime_user
52 ; SOLARIS: ret void
53
5451 ; MACHO-NOT: define internal void @__llvm_profile_init
5552 ; LINUX-NOT: define internal void @__llvm_profile_init
5653 ; FREEBSD-NOT: define internal void @__llvm_profile_init
54 ; SOLARIS-NOT: define internal void @__llvm_profile_init
5755 ; PS4-NOT: define internal void @__llvm_profile_init
5856 ; WINDOWS-NOT: define internal void @__llvm_profile_init
59 ; SOLARIS: define internal void @__llvm_profile_init