[compiler-rt] r291734 - [sancov] moving sancov rt to sancov/ directory

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 09:57:22 PST 2017


This broke Windows ASan:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/4363

Please fix.

On Wed, Jan 11, 2017 at 5:19 PM, Mike Aizatsky via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: aizatsky
> Date: Wed Jan 11 19:19:34 2017
> New Revision: 291734
>
> URL: http://llvm.org/viewvc/llvm-project?rev=291734&view=rev
> Log:
> [sancov] moving sancov rt to sancov/ directory
>
> Subscribers: kubabrecka, mgorny
>
> Differential Revision: https://reviews.llvm.org/D28541
>
> Added:
>     compiler-rt/trunk/lib/sancov/
>     compiler-rt/trunk/lib/sancov/CMakeLists.txt
>     compiler-rt/trunk/lib/sancov/sancov_flags.cc
>       - copied, changed from r291730, compiler-rt/trunk/lib/
> sanitizer_common/sancov_flags.cc
>     compiler-rt/trunk/lib/sancov/sancov_flags.h
>       - copied, changed from r291730, compiler-rt/trunk/lib/
> sanitizer_common/sancov_flags.h
>     compiler-rt/trunk/lib/sancov/sancov_flags.inc
>       - copied, changed from r291730, compiler-rt/trunk/lib/
> sanitizer_common/sancov_flags.inc
>     compiler-rt/trunk/lib/sancov/sanitizer_coverage_libcdep.cc
>       - copied, changed from r291730, compiler-rt/trunk/lib/
> sanitizer_common/sanitizer_coverage_libcdep_new.cc
> Removed:
>     compiler-rt/trunk/lib/sanitizer_common/sancov_flags.cc
>     compiler-rt/trunk/lib/sanitizer_common/sancov_flags.h
>     compiler-rt/trunk/lib/sanitizer_common/sancov_flags.inc
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_
> coverage_libcdep_new.cc
> Modified:
>     compiler-rt/trunk/lib/CMakeLists.txt
>     compiler-rt/trunk/lib/asan/CMakeLists.txt
>     compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
>     compiler-rt/trunk/lib/cfi/CMakeLists.txt
>     compiler-rt/trunk/lib/dfsan/CMakeLists.txt
>     compiler-rt/trunk/lib/esan/CMakeLists.txt
>     compiler-rt/trunk/lib/lsan/CMakeLists.txt
>     compiler-rt/trunk/lib/msan/CMakeLists.txt
>     compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
>     compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
>     compiler-rt/trunk/lib/scudo/CMakeLists.txt
>     compiler-rt/trunk/lib/stats/CMakeLists.txt
>     compiler-rt/trunk/lib/tsan/CMakeLists.txt
>     compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
>     compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt
>     compiler-rt/trunk/lib/ubsan/CMakeLists.txt
>     compiler-rt/trunk/lib/xray/CMakeLists.txt
>
> Modified: compiler-rt/trunk/lib/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -36,6 +36,10 @@ function(compiler_rt_build_sanitizer san
>    endif()
>  endfunction()
>
> +if(COMPILER_RT_HAS_SANITIZER_COMMON)
> +  add_subdirectory(sancov)
> +endif()
> +
>  if(COMPILER_RT_BUILD_SANITIZERS)
>    compiler_rt_build_runtime(interception)
>
>
> Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> asan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/asan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -118,6 +118,7 @@ if(APPLE)
>                  RTInterception
>                  RTSanitizerCommon
>                  RTSanitizerCommonLibc
> +                RTSancovLibc
>                  RTLSanCommon
>                  RTUbsan
>      CFLAGS ${ASAN_DYNAMIC_CFLAGS}
> @@ -131,6 +132,7 @@ else()
>      RTInterception
>      RTSanitizerCommon
>      RTSanitizerCommonLibc
> +    RTSancovLibc
>      RTLSanCommon
>      RTUbsan)
>
>
> Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> asan/tests/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Wed Jan 11 19:19:34
> 2017
> @@ -281,6 +281,7 @@ macro(add_asan_tests_for_arch_and_kind a
>        $<TARGET_OBJECTS:RTInterception.osx>
>        $<TARGET_OBJECTS:RTSanitizerCommon.osx>
>        $<TARGET_OBJECTS:RTSanitizerCommonLibc.osx>
> +      $<TARGET_OBJECTS:RTSancovLibc.osx>
>        $<TARGET_OBJECTS:RTLSanCommon.osx>
>        $<TARGET_OBJECTS:RTUbsan.osx>)
>    else()
> @@ -290,6 +291,7 @@ macro(add_asan_tests_for_arch_and_kind a
>        $<TARGET_OBJECTS:RTInterception.${arch}>
>        $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>        $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +      $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>        $<TARGET_OBJECTS:RTLSanCommon.${arch}>
>        $<TARGET_OBJECTS:RTUbsan.${arch}>
>        $<TARGET_OBJECTS:RTUbsan_cxx.${arch}>)
> @@ -342,6 +344,7 @@ if(ANDROID)
>        $<TARGET_OBJECTS:RTInterception.${arch}>
>        $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>        $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +      $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>        $<TARGET_OBJECTS:RTUbsan.${arch}>
>        $<TARGET_OBJECTS:RTUbsan_cxx.${arch}>
>        ${COMPILER_RT_GTEST_SOURCE}
>
> Modified: compiler-rt/trunk/lib/cfi/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> cfi/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/cfi/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/cfi/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -20,6 +20,7 @@ foreach(arch ${CFI_SUPPORTED_ARCH})
>      OBJECT_LIBS RTInterception
>                  RTSanitizerCommon
>                  RTSanitizerCommonLibc
> +                RTSancovLibc
>      CFLAGS ${CFI_CFLAGS}
>      PARENT_TARGET cfi)
>    add_compiler_rt_runtime(clang_rt.cfi_diag
> @@ -29,6 +30,7 @@ foreach(arch ${CFI_SUPPORTED_ARCH})
>      OBJECT_LIBS RTInterception
>                  RTSanitizerCommon
>                  RTSanitizerCommonLibc
> +                RTSancovLibc
>                 RTUbsan
>      CFLAGS ${CFI_CFLAGS} ${CFI_DIAG_CFLAGS}
>      PARENT_TARGET cfi)
>
> Modified: compiler-rt/trunk/lib/dfsan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> dfsan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/dfsan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/dfsan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -23,6 +23,7 @@ foreach(arch ${DFSAN_SUPPORTED_ARCH})
>              $<TARGET_OBJECTS:RTInterception.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +            $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>      CFLAGS ${DFSAN_CFLAGS}
>      PARENT_TARGET dfsan)
>    add_sanitizer_rt_symbols(clang_rt.dfsan
>
> Modified: compiler-rt/trunk/lib/esan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> esan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/esan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/esan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -26,6 +26,7 @@ foreach (arch ${ESAN_SUPPORTED_ARCH})
>              $<TARGET_OBJECTS:RTInterception.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +            $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>      CFLAGS ${ESAN_RTL_CFLAGS})
>    add_sanitizer_rt_symbols(clang_rt.esan
>      ARCHS ${arch}
>
> Modified: compiler-rt/trunk/lib/lsan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> lsan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/lsan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/lsan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -32,6 +32,7 @@ if(COMPILER_RT_HAS_LSAN)
>                $<TARGET_OBJECTS:RTInterception.${arch}>
>                $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>                $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +              $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>                $<TARGET_OBJECTS:RTLSanCommon.${arch}>
>        CFLAGS ${LSAN_CFLAGS}
>        PARENT_TARGET lsan)
>
> Modified: compiler-rt/trunk/lib/msan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> msan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/msan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/msan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -35,6 +35,7 @@ foreach(arch ${MSAN_SUPPORTED_ARCH})
>              $<TARGET_OBJECTS:RTInterception.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +            $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>              $<TARGET_OBJECTS:RTUbsan.${arch}>
>      CFLAGS ${MSAN_RTL_CFLAGS}
>      PARENT_TARGET msan)
>
> Added: compiler-rt/trunk/lib/sancov/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sancov/CMakeLists.txt?rev=291734&view=auto
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sancov/CMakeLists.txt (added)
> +++ compiler-rt/trunk/lib/sancov/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -0,0 +1,16 @@
> +set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
> +append_rtti_flag(OFF SANITIZER_CFLAGS)
> +
> +set(SANCOV_LIBCDEP_SOURCES
> +  sancov_flags.cc
> +  sanitizer_coverage_libcdep.cc)
> +
> +add_compiler_rt_object_libraries(RTSancovLibc
> +  ${OS_OPTION}
> +  ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
> +  SOURCES ${SANCOV_LIBCDEP_SOURCES}
> +  CFLAGS ${SANITIZER_CFLAGS}
> +  DEFS ${SANITIZER_COMMON_DEFINITIONS})
> +
> +include_directories(..)
> +
>
> Copied: compiler-rt/trunk/lib/sancov/sancov_flags.cc (from r291730,
> compiler-rt/trunk/lib/sanitizer_common/sancov_flags.cc)
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sancov/sancov_flags.cc?p2=compiler-rt/trunk/lib/sancov/
> sancov_flags.cc&p1=compiler-rt/trunk/lib/sanitizer_common/
> sancov_flags.cc&r1=291730&r2=291734&rev=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sancov_flags.cc (original)
> +++ compiler-rt/trunk/lib/sancov/sancov_flags.cc Wed Jan 11 19:19:34 2017
> @@ -12,8 +12,8 @@
>  //===-------------------------------------------------------
> ---------------===//
>
>  #include "sancov_flags.h"
> -#include "sanitizer_flag_parser.h"
> -#include "sanitizer_platform.h"
> +#include "sanitizer_common/sanitizer_flag_parser.h"
> +#include "sanitizer_common/sanitizer_platform.h"
>
>  #if !SANITIZER_LINUX
>  // other platforms do not have weak symbols out of the box.
>
> Copied: compiler-rt/trunk/lib/sancov/sancov_flags.h (from r291730,
> compiler-rt/trunk/lib/sanitizer_common/sancov_flags.h)
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sancov/sancov_flags.h?p2=compiler-rt/trunk/lib/sancov/
> sancov_flags.h&p1=compiler-rt/trunk/lib/sanitizer_common/
> sancov_flags.h&r1=291730&r2=291734&rev=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sancov_flags.h (original)
> +++ compiler-rt/trunk/lib/sancov/sancov_flags.h Wed Jan 11 19:19:34 2017
> @@ -13,8 +13,8 @@
>  #ifndef SANCOV_FLAGS_H
>  #define SANCOV_FLAGS_H
>
> -#include "sanitizer_flag_parser.h"
> -#include "sanitizer_internal_defs.h"
> +#include "sanitizer_common/sanitizer_flag_parser.h"
> +#include "sanitizer_common/sanitizer_internal_defs.h"
>
>  namespace __sancov {
>
>
> Copied: compiler-rt/trunk/lib/sancov/sancov_flags.inc (from r291730,
> compiler-rt/trunk/lib/sanitizer_common/sancov_flags.inc)
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sancov/sancov_flags.inc?p2=compiler-rt/trunk/lib/sancov/
> sancov_flags.inc&p1=compiler-rt/trunk/lib/sanitizer_common/
> sancov_flags.inc&r1=291730&r2=291734&rev=291734&view=diff
> ============================================================
> ==================
>     (empty)
>
> Copied: compiler-rt/trunk/lib/sancov/sanitizer_coverage_libcdep.cc (from
> r291730, compiler-rt/trunk/lib/sanitizer_common/sanitizer_
> coverage_libcdep_new.cc)
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sancov/sanitizer_coverage_libcdep.cc?p2=compiler-rt/
> trunk/lib/sancov/sanitizer_coverage_libcdep.cc&p1=compiler-rt/trunk/lib/
> sanitizer_common/sanitizer_coverage_libcdep_new.cc&r1=
> 291730&r2=291734&rev=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
> (original)
> +++ compiler-rt/trunk/lib/sancov/sanitizer_coverage_libcdep.cc Wed Jan 11
> 19:19:34 2017
> @@ -9,10 +9,10 @@
>  // Sanitizer Coverage Controller for Trace PC Guard.
>
>  #include "sancov_flags.h"
> -#include "sanitizer_allocator_internal.h"
> -#include "sanitizer_atomic.h"
> -#include "sanitizer_common.h"
> -#include "sanitizer_symbolizer.h"
> +#include "sanitizer_common/sanitizer_allocator_internal.h"
> +#include "sanitizer_common/sanitizer_atomic.h"
> +#include "sanitizer_common/sanitizer_common.h"
> +#include "sanitizer_common/sanitizer_symbolizer.h"
>
>  using namespace __sanitizer;
>
>
> 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=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Wed Jan 11
> 19:19:34 2017
> @@ -52,9 +52,7 @@ set(SANITIZER_NOLIBC_SOURCES
>
>  set(SANITIZER_LIBCDEP_SOURCES
>    sanitizer_common_libcdep.cc
> -  sancov_flags.cc
>    sanitizer_coverage_libcdep.cc
> -  sanitizer_coverage_libcdep_new.cc
>    sanitizer_coverage_mapping_libcdep.cc
>    sanitizer_linux_libcdep.cc
>    sanitizer_posix_libcdep.cc
>
> Removed: compiler-rt/trunk/lib/sanitizer_common/sancov_flags.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/sancov_flags.cc?rev=291733&view=auto
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sancov_flags.cc (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sancov_flags.cc (removed)
> @@ -1,60 +0,0 @@
> -//===-- sancov_flags.cc -----------------------------------------*- C++
> -*-===//
> -//
> -//                     The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -//
> -// Sanitizer Coverage runtime flags.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -
> -#include "sancov_flags.h"
> -#include "sanitizer_flag_parser.h"
> -#include "sanitizer_platform.h"
> -
> -#if !SANITIZER_LINUX
> -// other platforms do not have weak symbols out of the box.
> -extern "C" const char* __sancov_default_options() { return ""; }
> -#endif
> -
> -using namespace __sanitizer;
> -
> -namespace __sancov {
> -
> -SancovFlags sancov_flags_dont_use_directly;  // use via flags();
> -
> -void SancovFlags::SetDefaults() {
> -#define SANCOV_FLAG(Type, Name, DefaultValue, Description) Name =
> DefaultValue;
> -#include "sancov_flags.inc"
> -#undef SANCOV_FLAG
> -}
> -
> -static void RegisterSancovFlags(FlagParser *parser, SancovFlags *f) {
> -#define SANCOV_FLAG(Type, Name, DefaultValue, Description) \
> -  RegisterFlag(parser, #Name, Description, &f->Name);
> -#include "sancov_flags.inc"
> -#undef SANCOV_FLAG
> -}
> -
> -static const char *MaybeCallSancovDefaultOptions() {
> -  return (&__sancov_default_options) ? __sancov_default_options() : "";
> -}
> -
> -void InitializeSancovFlags() {
> -  SancovFlags *f = sancov_flags();
> -  f->SetDefaults();
> -
> -  FlagParser parser;
> -  RegisterSancovFlags(&parser, f);
> -
> -  parser.ParseString(MaybeCallSancovDefaultOptions());
> -  parser.ParseString(GetEnv("SANCOV_OPTIONS"));
> -
> -  ReportUnrecognizedFlags();
> -  if (f->help) parser.PrintFlagDescriptions();
> -}
> -
> -}  // namespace __sancov
>
> Removed: compiler-rt/trunk/lib/sanitizer_common/sancov_flags.h
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/sancov_flags.h?rev=291733&view=auto
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sancov_flags.h (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sancov_flags.h (removed)
> @@ -1,40 +0,0 @@
> -//===-- sancov_flags.h ------------------------------------------*- C++
> -*-===//
> -//
> -//                     The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -//
> -// Sanitizer Coverage runtime flags.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -#ifndef SANCOV_FLAGS_H
> -#define SANCOV_FLAGS_H
> -
> -#include "sanitizer_flag_parser.h"
> -#include "sanitizer_internal_defs.h"
> -
> -namespace __sancov {
> -
> -struct SancovFlags {
> -#define SANCOV_FLAG(Type, Name, DefaultValue, Description) Type Name;
> -#include "sancov_flags.inc"
> -#undef SANCOV_FLAG
> -
> -  void SetDefaults();
> -};
> -
> -extern SancovFlags sancov_flags_dont_use_directly;
> -
> -inline SancovFlags* sancov_flags() { return &sancov_flags_dont_use_directly;
> }
> -
> -void InitializeSancovFlags();
> -
> -extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE const
> char*
> -__sancov_default_options();
> -
> -}  // namespace __sancov
> -
> -#endif
>
> Removed: compiler-rt/trunk/lib/sanitizer_common/sancov_flags.inc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/sancov_flags.inc?rev=291733&view=auto
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sancov_flags.inc (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sancov_flags.inc (removed)
> @@ -1,21 +0,0 @@
> -//===-- sancov_flags.inc ----------------------------------------*- C++
> -*-===//
> -//
> -//                     The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -//
> -// Sanitizer Coverage runtime flags.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -#ifndef SANCOV_FLAG
> -#error "Defnine SANCOV_FLAG prior to including this file!"
> -#endif
> -
> -SANCOV_FLAG(bool, symbolize, true,
> -            "If set, converage information will be symbolized by sancov
> tool "
> -            "after dumping.")
> -
> -SANCOV_FLAG(bool, help, false, "Print flags help.")
>
> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_
> coverage_libcdep.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/sanitizer_coverage_libcdep.cc?rev=
> 291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
> (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
> Wed Jan 11 19:19:34 2017
> @@ -954,7 +954,9 @@ SANITIZER_INTERFACE_ATTRIBUTE void __san
>  }
>  SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump() {
>    coverage_data.DumpAll();
> +#if SANITIZER_LINUX
>    __sanitizer_dump_trace_pc_guard_coverage();
> +#endif
>  }
>  SANITIZER_INTERFACE_ATTRIBUTE void
>  __sanitizer_cov_module_init(s32 *guards, uptr npcs, u8 *counters,
>
> Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_
> coverage_libcdep_new.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/sanitizer_coverage_libcdep_new.cc?rev=291733&view=auto
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
> (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
> (removed)
> @@ -1,174 +0,0 @@
> -//===-- sanitizer_coverage_libcdep_new.cc ------------------------------
> ---===//
> -//
> -//                     The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -// Sanitizer Coverage Controller for Trace PC Guard.
> -
> -#include "sancov_flags.h"
> -#include "sanitizer_allocator_internal.h"
> -#include "sanitizer_atomic.h"
> -#include "sanitizer_common.h"
> -#include "sanitizer_symbolizer.h"
> -
> -using namespace __sanitizer;
> -
> -using AddressRange = LoadedModule::AddressRange;
> -
> -namespace __sancov {
> -namespace {
> -
> -static const u64 Magic64 = 0xC0BFFFFFFFFFFF64ULL;
> -static const u64 Magic32 = 0xC0BFFFFFFFFFFF32ULL;
> -static const u64 Magic = SANITIZER_WORDSIZE == 64 ? Magic64 : Magic32;
> -
> -static fd_t OpenFile(const char* path) {
> -  error_t err;
> -  fd_t fd = OpenFile(path, WrOnly, &err);
> -  if (fd == kInvalidFd)
> -    Report("SanitizerCoverage: failed to open %s for writing (reason:
> %d)\n",
> -           path, err);
> -  return fd;
> -}
> -
> -static void GetCoverageFilename(char* path, const char* name,
> -                                const char* extension) {
> -  CHECK(name);
> -  internal_snprintf(path, kMaxPathLength, "%s/%s.%zd.%s",
> -                    common_flags()->coverage_dir, name, internal_getpid(),
> -                    extension);
> -}
> -
> -static void WriteModuleCoverage(char* file_path, const char* module_name,
> -                                const uptr* pcs, uptr len) {
> -  GetCoverageFilename(file_path, StripModuleName(module_name), "sancov");
> -  fd_t fd = OpenFile(file_path);
> -  WriteToFile(fd, &Magic, sizeof(Magic));
> -  WriteToFile(fd, pcs, len * sizeof(*pcs));
> -  CloseFile(fd);
> -  Printf("SanitizerCoverage: %s %zd PCs written\n", file_path, len);
> -}
> -
> -static void SanitizerDumpCoverage(const uptr* unsorted_pcs, uptr len) {
> -  if (!len) return;
> -
> -  char* file_path = static_cast<char*>(InternalAlloc(kMaxPathLength));
> -  char* module_name = static_cast<char*>(InternalAlloc(kMaxPathLength));
> -  uptr* pcs = static_cast<uptr*>(InternalAlloc(len * sizeof(uptr)));
> -
> -  internal_memcpy(pcs, unsorted_pcs, len * sizeof(uptr));
> -  SortArray(pcs, len);
> -
> -  bool module_found = false;
> -  uptr last_base = 0;
> -  uptr module_start_idx = 0;
> -
> -  for (uptr i = 0; i < len; ++i) {
> -    const uptr pc = pcs[i];
> -    if (!pc) continue;
> -
> -    if (!__sanitizer_get_module_and_offset_for_pc(pc, nullptr, 0,
> &pcs[i])) {
> -      Printf("ERROR: bad pc %x\n", pc);
> -      continue;
> -    }
> -    uptr module_base = pc - pcs[i];
> -
> -    if (module_base != last_base || !module_found) {
> -      if (module_found) {
> -        WriteModuleCoverage(file_path, module_name,
> &pcs[module_start_idx],
> -                            i - module_start_idx);
> -      }
> -
> -      last_base = module_base;
> -      module_start_idx = i;
> -      module_found = true;
> -      __sanitizer_get_module_and_offset_for_pc(pc, module_name,
> kMaxPathLength,
> -                                               &pcs[i]);
> -    }
> -  }
> -
> -  if (module_found) {
> -    WriteModuleCoverage(file_path, module_name, &pcs[module_start_idx],
> -                        len - module_start_idx);
> -  }
> -
> -  InternalFree(file_path);
> -  InternalFree(module_name);
> -  InternalFree(pcs);
> -
> -  if (sancov_flags()->symbolize) {
> -    Printf("TODO(aizatsky): call sancov to symbolize\n");
> -  }
> -}
> -
> -// Collects trace-pc guard coverage.
> -// This class relies on zero-initialization.
> -class TracePcGuardController {
> - public:
> -  void Initialize() {
> -    CHECK(!initialized);
> -
> -    initialized = true;
> -    InitializeSancovFlags();
> -
> -    pc_vector.Initialize(0);
> -  }
> -
> -  void InitTracePcGuard(u32* start, u32* end) {
> -    if (!initialized) Initialize();
> -    CHECK(!*start);
> -    CHECK_NE(start, end);
> -
> -    u32 i = pc_vector.size();
> -    for (u32* p = start; p < end; p++) *p = ++i;
> -    pc_vector.resize(i);
> -  }
> -
> -  void TracePcGuard(u32* guard, uptr pc) {
> -    atomic_uint32_t* guard_ptr = reinterpret_cast<atomic_
> uint32_t*>(guard);
> -    u32 idx = atomic_exchange(guard_ptr, 0, memory_order_relaxed);
> -    if (!idx) return;
> -    // we start indices from 1.
> -    pc_vector[idx - 1] = pc;
> -  }
> -
> -  void Dump() {
> -    if (!initialized || !common_flags()->coverage) return;
> -    __sanitizer_dump_coverage(pc_vector.data(), pc_vector.size());
> -  }
> -
> - private:
> -  bool initialized;
> -  InternalMmapVectorNoCtor<uptr> pc_vector;
> -};
> -
> -static TracePcGuardController pc_guard_controller;
> -
> -}  // namespace
> -}  // namespace __sancov
> -
> -extern "C" {
> -SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_coverage(  // NOLINT
> -    const uptr* pcs, uptr len) {
> -  return __sancov::SanitizerDumpCoverage(pcs, len);
> -}
> -
> -SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void
> -__sanitizer_cov_trace_pc_guard(u32* guard) {
> -  if (!*guard) return;
> -  __sancov::pc_guard_controller.TracePcGuard(guard, GET_CALLER_PC() - 1);
> -}
> -
> -SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void
> -__sanitizer_cov_trace_pc_guard_init(u32* start, u32* end) {
> -  if (start == end || *start) return;
> -  __sancov::pc_guard_controller.InitTracePcGuard(start, end);
> -}
> -
> -SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_trace_pc_guard_coverage()
> {
> -  __sancov::pc_guard_controller.Dump();
> -}
> -}  // extern "C"
>
> Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> sanitizer_common/tests/CMakeLists.txt?rev=291734&r1=
> 291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Wed Jan
> 11 19:19:34 2017
> @@ -200,7 +200,8 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT
>    if(APPLE)
>      add_sanitizer_common_lib("RTSanitizerCommon.test.osx"
>                               $<TARGET_OBJECTS:RTSanitizerCommon.osx>
> -                             $<TARGET_OBJECTS:RTSanitizerCommonLibc.osx>)
> +                             $<TARGET_OBJECTS:RTSanitizerCommonLibc.osx>
> +                             $<TARGET_OBJECTS:RTSancovLibc.osx>)
>    else()
>      if(CAN_TARGET_x86_64)
>        add_sanitizer_common_lib("RTSanitizerCommon.test.nolibc.x86_64"
> @@ -210,7 +211,8 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT
>      foreach(arch ${SANITIZER_UNITTEST_SUPPORTED_ARCH})
>        add_sanitizer_common_lib("RTSanitizerCommon.test.${arch}"
>                                 $<TARGET_OBJECTS:
> RTSanitizerCommon.${arch}>
> -                               $<TARGET_OBJECTS:
> RTSanitizerCommonLibc.${arch}>)
> +                               $<TARGET_OBJECTS:
> RTSanitizerCommonLibc.${arch}>
> +                               $<TARGET_OBJECTS:RTSancovLibc.${arch}>)
>      endforeach()
>    endif()
>    foreach(arch ${SANITIZER_UNITTEST_SUPPORTED_ARCH})
> @@ -224,7 +226,8 @@ if(ANDROID)
>        ${SANITIZER_UNITTESTS}
>        ${COMPILER_RT_GTEST_SOURCE}
>        $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
> -      $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>)
> +      $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +      $<TARGET_OBJECTS:RTSancovLibc.${arch}>)
>      set_target_compile_flags(SanitizerTest
>        ${SANITIZER_COMMON_CFLAGS}
>        ${SANITIZER_TEST_CFLAGS_COMMON})
>
> Modified: compiler-rt/trunk/lib/scudo/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> scudo/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/scudo/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/scudo/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -29,6 +29,7 @@ if(COMPILER_RT_HAS_SCUDO)
>                $<TARGET_OBJECTS:RTInterception.${arch}>
>                $<TARGET_OBJECTS:RTSanitizerCommonNoTermination.${arch}>
>                $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +              $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>        CFLAGS ${SCUDO_CFLAGS}
>        PARENT_TARGET scudo)
>    endforeach()
>
> Modified: compiler-rt/trunk/lib/stats/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> stats/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/stats/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/stats/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -22,6 +22,7 @@ add_compiler_rt_runtime(clang_rt.stats
>    SOURCES stats.cc
>    OBJECT_LIBS RTSanitizerCommon
>                RTSanitizerCommonLibc
> +              RTSancovLibc
>    CFLAGS ${SANITIZER_COMMON_CFLAGS}
>    LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
>    PARENT_TARGET stats)
>
> Modified: compiler-rt/trunk/lib/tsan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> tsan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/tsan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/tsan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -119,6 +119,7 @@ if(APPLE)
>      OBJECT_LIBS RTInterception
>                  RTSanitizerCommon
>                  RTSanitizerCommonLibc
> +                RTSancovLibc
>                  RTUbsan
>      CFLAGS ${TSAN_RTL_CFLAGS}
>      LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
> @@ -179,6 +180,7 @@ else()
>                $<TARGET_OBJECTS:RTInterception.${arch}>
>                $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>                $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +              $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>                $<TARGET_OBJECTS:RTUbsan.${arch}>
>        CFLAGS ${TSAN_RTL_CFLAGS})
>      add_compiler_rt_runtime(clang_rt.tsan_cxx
>
> Modified: compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> tsan/dd/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -26,6 +26,7 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT AP
>              $<TARGET_OBJECTS:RTInterception.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +            $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>      CFLAGS ${DD_CFLAGS}
>      PARENT_TARGET dd)
>
> @@ -40,6 +41,7 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT AP
>              $<TARGET_OBJECTS:RTInterception.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
>              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
> +            $<TARGET_OBJECTS:RTSancovLibc.${arch}>
>      LINK_LIBS ${DD_LINKLIBS}
>      PARENT_TARGET dd)
>  endif()
>
> Modified: compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> tsan/tests/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt Wed Jan 11 19:19:34
> 2017
> @@ -69,6 +69,7 @@ macro(add_tsan_unittest testname)
>            $<TARGET_OBJECTS:RTInterception.osx>
>            $<TARGET_OBJECTS:RTSanitizerCommon.osx>
>            $<TARGET_OBJECTS:RTSanitizerCommonLibc.osx>
> +          $<TARGET_OBJECTS:RTSancovLibc.osx>
>            $<TARGET_OBJECTS:RTUbsan.osx>)
>          set(TSAN_TEST_RUNTIME RTTsanTest.${testname}.${arch})
>          add_library(${TSAN_TEST_RUNTIME} STATIC
> ${TSAN_TEST_RUNTIME_OBJECTS})
>
> Modified: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> ubsan/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/ubsan/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -67,6 +67,7 @@ if(APPLE)
>                    RTUbsan_standalone
>                    RTSanitizerCommon
>                    RTSanitizerCommonLibc
> +                  RTSancovLibc
>        LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
>        PARENT_TARGET ubsan)
>    endif()
> @@ -102,6 +103,7 @@ else()
>        ARCHS ${UBSAN_SUPPORTED_ARCH}
>        OBJECT_LIBS RTSanitizerCommon
>                RTSanitizerCommonLibc
> +              RTSancovLibc
>                RTUbsan
>                RTUbsan_standalone
>        CFLAGS ${UBSAN_CFLAGS}
>
> Modified: compiler-rt/trunk/lib/xray/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> xray/CMakeLists.txt?rev=291734&r1=291733&r2=291734&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/xray/CMakeLists.txt (original)
> +++ compiler-rt/trunk/lib/xray/CMakeLists.txt Wed Jan 11 19:19:34 2017
> @@ -51,7 +51,8 @@ add_compiler_rt_component(xray-fdr)
>
>  set(XRAY_COMMON_RUNTIME_OBJECT_LIBS
>      RTSanitizerCommon
> -    RTSanitizerCommonLibc)
> +    RTSanitizerCommonLibc
> +    RTSancovLibc)
>
>  foreach(arch ${XRAY_SUPPORTED_ARCH})
>    if(CAN_TARGET_${arch})
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/a8265e45/attachment.html>


More information about the llvm-commits mailing list