[compiler-rt] r355862 - Remove esan.

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 13:23:40 PDT 2019


Author: nico
Date: Mon Mar 11 13:23:40 2019
New Revision: 355862

URL: http://llvm.org/viewvc/llvm-project?rev=355862&view=rev
Log:
Remove esan.

It hasn't seen active development in years, and it hasn't reached a
state where it was useful.

Remove the code until someone is interested in working on it again.

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

Removed:
    compiler-rt/trunk/include/sanitizer/esan_interface.h
    compiler-rt/trunk/lib/esan/
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_mips64.S
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_x86_64.S
    compiler-rt/trunk/test/esan/
Modified:
    compiler-rt/trunk/cmake/config-ix.cmake
    compiler-rt/trunk/include/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Mon Mar 11 13:23:40 2019
@@ -246,7 +246,6 @@ set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X8
     ${MIPS32} ${MIPS64} ${PPC64} ${S390X})
 set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64})
 set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64})
-set(ALL_ESAN_SUPPORTED_ARCH ${X86_64} ${MIPS64})
 set(ALL_SCUDO_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${PPC64})
 set(ALL_SCUDO_STANDALONE_SUPPORTED_ARCH ${X86} ${X86_64})
 if(APPLE)
@@ -456,9 +455,6 @@ if(APPLE)
   list_intersect(CFI_SUPPORTED_ARCH
     ALL_CFI_SUPPORTED_ARCH
     SANITIZER_COMMON_SUPPORTED_ARCH)
-  list_intersect(ESAN_SUPPORTED_ARCH
-    ALL_ESAN_SUPPORTED_ARCH
-    SANITIZER_COMMON_SUPPORTED_ARCH)
   list_intersect(SCUDO_SUPPORTED_ARCH
     ALL_SCUDO_SUPPORTED_ARCH
     SANITIZER_COMMON_SUPPORTED_ARCH)
@@ -497,7 +493,6 @@ else()
   filter_available_targets(SAFESTACK_SUPPORTED_ARCH
     ${ALL_SAFESTACK_SUPPORTED_ARCH})
   filter_available_targets(CFI_SUPPORTED_ARCH ${ALL_CFI_SUPPORTED_ARCH})
-  filter_available_targets(ESAN_SUPPORTED_ARCH ${ALL_ESAN_SUPPORTED_ARCH})
   filter_available_targets(SCUDO_SUPPORTED_ARCH ${ALL_SCUDO_SUPPORTED_ARCH})
   filter_available_targets(SCUDO_STANDALONE_SUPPORTED_ARCH ${ALL_SCUDO_STANDALONE_SUPPORTED_ARCH})
   filter_available_targets(XRAY_SUPPORTED_ARCH ${ALL_XRAY_SUPPORTED_ARCH})
@@ -530,7 +525,7 @@ else()
   set(OS_NAME "${CMAKE_SYSTEM_NAME}")
 endif()
 
-set(ALL_SANITIZERS asan;dfsan;msan;hwasan;tsan;safestack;cfi;esan;scudo;ubsan_minimal)
+set(ALL_SANITIZERS asan;dfsan;msan;hwasan;tsan;safestack;cfi;scudo;ubsan_minimal)
 set(COMPILER_RT_SANITIZERS_TO_BUILD all CACHE STRING
     "sanitizers to build if supported on the target (all;${ALL_SANITIZERS})")
 list_replace(COMPILER_RT_SANITIZERS_TO_BUILD all "${ALL_SANITIZERS}")
@@ -634,13 +629,6 @@ else()
   set(COMPILER_RT_HAS_CFI FALSE)
 endif()
 
-if (COMPILER_RT_HAS_SANITIZER_COMMON AND ESAN_SUPPORTED_ARCH AND
-    OS_NAME MATCHES "Linux|FreeBSD")
-  set(COMPILER_RT_HAS_ESAN TRUE)
-else()
-  set(COMPILER_RT_HAS_ESAN FALSE)
-endif()
-
 #TODO(kostyak): add back Android & Fuchsia when the code settles a bit.
 if (SCUDO_STANDALONE_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux")
   set(COMPILER_RT_HAS_SCUDO_STANDALONE TRUE)

Modified: compiler-rt/trunk/include/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/CMakeLists.txt?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/include/CMakeLists.txt (original)
+++ compiler-rt/trunk/include/CMakeLists.txt Mon Mar 11 13:23:40 2019
@@ -5,7 +5,6 @@ if (COMPILER_RT_BUILD_SANITIZERS)
     sanitizer/common_interface_defs.h
     sanitizer/coverage_interface.h
     sanitizer/dfsan_interface.h
-    sanitizer/esan_interface.h
     sanitizer/hwasan_interface.h
     sanitizer/linux_syscall_hooks.h
     sanitizer/lsan_interface.h

Removed: compiler-rt/trunk/include/sanitizer/esan_interface.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/esan_interface.h?rev=355861&view=auto
==============================================================================
--- compiler-rt/trunk/include/sanitizer/esan_interface.h (original)
+++ compiler-rt/trunk/include/sanitizer/esan_interface.h (removed)
@@ -1,49 +0,0 @@
-//===-- sanitizer/esan_interface.h ------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file is a part of EfficiencySanitizer, a family of performance tuners.
-//
-// Public interface header.
-//===----------------------------------------------------------------------===//
-#ifndef SANITIZER_ESAN_INTERFACE_H
-#define SANITIZER_ESAN_INTERFACE_H
-
-#include <sanitizer/common_interface_defs.h>
-
-// We declare our interface routines as weak to allow the user to avoid
-// ifdefs and instead use this pattern to allow building the same sources
-// with and without our runtime library:
-//     if (__esan_report)
-//       __esan_report();
-#ifdef _MSC_VER
-/* selectany is as close to weak as we'll get. */
-#define COMPILER_RT_WEAK __declspec(selectany)
-#elif __GNUC__
-#define COMPILER_RT_WEAK __attribute__((weak))
-#else
-#define COMPILER_RT_WEAK
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// This function can be called mid-run (or at the end of a run for
-// a server process that doesn't shut down normally) to request that
-// data for that point in the run be reported from the tool.
-void COMPILER_RT_WEAK __esan_report(void);
-
-// This function returns the number of samples that the esan tool has collected
-// to this point.  This is useful for testing.
-unsigned int COMPILER_RT_WEAK __esan_get_sample_count(void);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // SANITIZER_ESAN_INTERFACE_H

Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Mon Mar 11 13:23:40 2019
@@ -42,13 +42,6 @@ set(SANITIZER_SOURCES_NOTERMINATION
   sanitizer_win.cc
   )
 
-if(UNIX AND NOT APPLE AND NOT OS_NAME MATCHES "SunOS")
-  list(APPEND SANITIZER_SOURCES_NOTERMINATION
-    sanitizer_linux_x86_64.S)
-  list(APPEND SANITIZER_SOURCES_NOTERMINATION
-    sanitizer_linux_mips64.S)
-endif()
-
 set(SANITIZER_SOURCES
   ${SANITIZER_SOURCES_NOTERMINATION} sanitizer_termination.cc)
 
@@ -210,19 +203,6 @@ append_list_if(SANITIZER_LIMIT_FRAME_SIZ
 append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
                SANITIZER_CFLAGS)
 
-if (LLVM_ENABLE_PEDANTIC AND UNIX AND NOT APPLE)
-  # With -pedantic, our .S files raise warnings about empty macro arguments
-  # from __USER_LABEL_PREFIX__ being an empty arg to GLUE().  Unfortunately,
-  # there is no simple way to test for an empty define, nor to disable just
-  # that warning or to disable -pedantic.  There is also no simple way to
-  # remove -pedantic from just this file (we'd have to remove from
-  # CMAKE_C*_FLAGS and re-add as a source property to all the non-.S files).
-  set_source_files_properties(sanitizer_linux_x86_64.S
-    PROPERTIES COMPILE_FLAGS "-w")
-  set_source_files_properties(sanitizer_linux_mips64.S
-    PROPERTIES COMPILE_FLAGS "-w")
-endif ()
-
 if(APPLE)
   set(OS_OPTION OS ${SANITIZER_COMMON_SUPPORTED_OS})
 endif()

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Mon Mar 11 13:23:40 2019
@@ -238,7 +238,6 @@ char **GetArgv();
 char **GetEnviron();
 void PrintCmdline();
 bool StackSizeIsUnlimited();
-uptr GetStackSizeLimitInBytes();
 void SetStackSizeLimitInBytes(uptr limit);
 bool AddressSpaceIsUnlimited();
 void SetAddressSpaceUnlimited();

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h Mon Mar 11 13:23:40 2019
@@ -422,7 +422,6 @@ inline void Trap() {
 namespace __asan  { using namespace __sanitizer; }  // NOLINT
 namespace __dsan  { using namespace __sanitizer; }  // NOLINT
 namespace __dfsan { using namespace __sanitizer; }  // NOLINT
-namespace __esan  { using namespace __sanitizer; }  // NOLINT
 namespace __lsan  { using namespace __sanitizer; }  // NOLINT
 namespace __msan  { using namespace __sanitizer; }  // NOLINT
 namespace __hwasan  { using namespace __sanitizer; }  // NOLINT

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Mon Mar 11 13:23:40 2019
@@ -128,12 +128,6 @@ const int FUTEX_WAKE_PRIVATE = FUTEX_WAK
 # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 0
 #endif
 
-#if defined(__x86_64__) || SANITIZER_MIPS64
-extern "C" {
-extern void internal_sigreturn();
-}
-#endif
-
 // Note : FreeBSD had implemented both
 // Linux and OpenBSD apis, available from
 // future 12.x version most likely
@@ -837,24 +831,6 @@ int internal_sigaction_norestorer(int si
   }
   return result;
 }
-
-// Invokes sigaction via a raw syscall with a restorer, but does not support
-// all platforms yet.
-// We disable for Go simply because we have not yet added to buildgo.sh.
-#if (defined(__x86_64__) || SANITIZER_MIPS64) && !SANITIZER_GO
-int internal_sigaction_syscall(int signum, const void *act, void *oldact) {
-  if (act == nullptr)
-    return internal_sigaction_norestorer(signum, act, oldact);
-  __sanitizer_sigaction u_adjust;
-  internal_memcpy(&u_adjust, act, sizeof(u_adjust));
-#if !SANITIZER_ANDROID || !SANITIZER_MIPS32
-  if (u_adjust.sa_restorer == nullptr) {
-    u_adjust.sa_restorer = internal_sigreturn;
-  }
-#endif
-  return internal_sigaction_norestorer(signum, (const void *)&u_adjust, oldact);
-}
-#endif  // defined(__x86_64__) && !SANITIZER_GO
 #endif  // SANITIZER_LINUX
 
 uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h Mon Mar 11 13:23:40 2019
@@ -58,10 +58,6 @@ uptr internal_prctl(int option, uptr arg
 // (like the process-wide error reporting SEGV handler) must use
 // internal_sigaction instead.
 int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
-#if (defined(__x86_64__) || SANITIZER_MIPS64) && !SANITIZER_GO
-// Uses a raw system call to avoid interceptors.
-int internal_sigaction_syscall(int signum, const void *act, void *oldact);
-#endif
 void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
 #if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) \
   || defined(__powerpc64__) || defined(__s390__) || defined(__i386__) \

Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_mips64.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_mips64.S?rev=355861&view=auto
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_mips64.S (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_mips64.S (removed)
@@ -1,24 +0,0 @@
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-#include "sanitizer_common/sanitizer_asm.h"
-
-// Avoid being marked as needing an executable stack:
-NO_EXEC_STACK_DIRECTIVE
-
-// Further contents are mips64 only:
-#if defined(__linux__) && defined(__mips64)
-
-.section .text
-.set noreorder
-.globl internal_sigreturn
-.type internal_sigreturn, @function
-internal_sigreturn:
-
-        li $v0,5211 // #5211 is for SYS_rt_sigreturn
-        syscall
-
-.size internal_sigreturn, .-internal_sigreturn
-
-#endif // defined(__linux__) && defined(__mips64)

Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_x86_64.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_x86_64.S?rev=355861&view=auto
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_x86_64.S (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_x86_64.S (removed)
@@ -1,26 +0,0 @@
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-#include "sanitizer_common/sanitizer_asm.h"
-
-// Avoid being marked as needing an executable stack:
-NO_EXEC_STACK_DIRECTIVE
-
-// Further contents are x86_64-only:
-#if defined(__linux__) && defined(__x86_64__)
-
-#include "../builtins/assembly.h"
-
-// If the "naked" function attribute were supported for x86 we could
-// do this via inline asm.
-.text
-.balign 4
-DEFINE_COMPILERRT_FUNCTION(internal_sigreturn)
-        mov           $0xf,             %eax    // 0xf == SYS_rt_sigreturn
-        mov           %rcx,             %r10
-        syscall
-        ret                                     // Won't normally reach here.
-END_COMPILERRT_FUNCTION(internal_sigreturn)
-
-#endif // defined(__linux__) && defined(__x86_64__)

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc?rev=355862&r1=355861&r2=355862&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc Mon Mar 11 13:23:40 2019
@@ -116,10 +116,6 @@ bool StackSizeIsUnlimited() {
   return (stack_size == RLIM_INFINITY);
 }
 
-uptr GetStackSizeLimitInBytes() {
-  return (uptr)getlim(RLIMIT_STACK);
-}
-
 void SetStackSizeLimitInBytes(uptr limit) {
   setlim(RLIMIT_STACK, (rlim_t)limit);
   CHECK(!StackSizeIsUnlimited());




More information about the llvm-commits mailing list