[PATCH] D63601: [Sanitizers] Remove clang_rt.sancov_{begin,end} on Solaris

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


ro created this revision.
ro added a reviewer: alekseyshl.
Herald added subscribers: Sanitizers, fedor.sergeev, mgorny, kubamracek, jyknight.
Herald added projects: LLVM, Sanitizers.

There's no point to manually create the `__start___sancov_guards` and `__stop___sancov_guards`
sections and labels on Solaris any longer.  They were originally introduced in
https://reviews.llvm.org/D40899 and https://reviews.llvm.org/D40903.

- The Solaris 11.4 ld supports creating them out of the box.
- We already unconditionally use Solaris 11.4 features like the `ld -z gnu-version-script-compat` option and fully working `.preinit_array` support in compiler-rt.
- The current files don't assemble on SPARC because the assembler syntax may be different between /bin/as and GNU as.

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


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D63601

Files:
  lib/sanitizer_common/CMakeLists.txt
  lib/sanitizer_common/sancov_begin.S
  lib/sanitizer_common/sancov_end.S


Index: lib/sanitizer_common/sancov_end.S
===================================================================
--- lib/sanitizer_common/sancov_end.S
+++ /dev/null
@@ -1,5 +0,0 @@
-	.type		__stop___sancov_guards, at object
-	.globl		__stop___sancov_guards
-        .section        __sancov_guards,"aw", at progbits
-        .p2align        2
-__stop___sancov_guards:
Index: lib/sanitizer_common/sancov_begin.S
===================================================================
--- lib/sanitizer_common/sancov_begin.S
+++ /dev/null
@@ -1,5 +0,0 @@
-	.type		__start___sancov_guards, at object
-	.globl		__start___sancov_guards
-        .section        __sancov_guards,"aw", at progbits
-        .p2align        2
-__start___sancov_guards:
Index: lib/sanitizer_common/CMakeLists.txt
===================================================================
--- lib/sanitizer_common/CMakeLists.txt
+++ lib/sanitizer_common/CMakeLists.txt
@@ -273,38 +273,6 @@
   CFLAGS ${SANITIZER_NO_WEAK_HOOKS_CFLAGS}
   DEFS ${SANITIZER_COMMON_DEFINITIONS})
 
-if(OS_NAME MATCHES "SunOS")
-  # Solaris ld doesn't support the non-standard GNU ld extension of adding
-  # __start_SECNAME and __stop_SECNAME labels to sections whose names are
-  # valid C identifiers.  Instead we add our own definitions for the
-  # __sancov_guards section.
-  add_compiler_rt_object_libraries(SancovBegin
-    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
-    SOURCES sancov_begin.S
-    CFLAGS ${SANITIZER_CFLAGS}
-    DEFS ${SANITIZER_COMMON_DEFINITIONS})
-
-  add_compiler_rt_runtime(clang_rt.sancov_begin
-    STATIC
-    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
-    OBJECT_LIBS SancovBegin
-    CFLAGS ${SANITIZER_CFLAGS}
-    DEFS ${SANITIZER_COMMON_DEFINITIONS})
-
-  add_compiler_rt_object_libraries(SancovEnd
-    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
-    SOURCES sancov_end.S
-    CFLAGS ${SANITIZER_CFLAGS}
-    DEFS ${SANITIZER_COMMON_DEFINITIONS})
-
-  add_compiler_rt_runtime(clang_rt.sancov_end
-    STATIC
-    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
-    OBJECT_LIBS SancovEnd
-    CFLAGS ${SANITIZER_CFLAGS}
-    DEFS ${SANITIZER_COMMON_DEFINITIONS})
-endif()
-
 if(WIN32)
   add_compiler_rt_object_libraries(SanitizerCommonWeakInterception
     ${SANITIZER_COMMON_SUPPORTED_OS}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63601.205806.patch
Type: text/x-patch
Size: 2244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190620/ef0a136c/attachment.bin>


More information about the llvm-commits mailing list