From owner-svn-src-all@freebsd.org Fri Feb 17 19:37:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BECCCE32D1; Fri, 17 Feb 2017 19:37:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB601398; Fri, 17 Feb 2017 19:37:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HJbSJV075058; Fri, 17 Feb 2017 19:37:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HJbSwC075051; Fri, 17 Feb 2017 19:37:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201702171937.v1HJbSwC075051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 17 Feb 2017 19:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r313885 - in vendor/compiler-rt/dist: lib/builtins/arm lib/sanitizer_common test/builtins/Unit test/lsan test/lsan/TestCases X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 19:37:30 -0000 Author: dim Date: Fri Feb 17 19:37:28 2017 New Revision: 313885 URL: https://svnweb.freebsd.org/changeset/base/313885 Log: Vendor import of compiler-rt release_40 branch r295380: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_40@295380 Modified: vendor/compiler-rt/dist/lib/builtins/arm/subsf3vfp.S vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc vendor/compiler-rt/dist/test/builtins/Unit/clear_cache_test.c vendor/compiler-rt/dist/test/builtins/Unit/fixunsdfdi_test.c vendor/compiler-rt/dist/test/builtins/Unit/fixunssfdi_test.c vendor/compiler-rt/dist/test/lsan/TestCases/strace_test.cc vendor/compiler-rt/dist/test/lsan/lit.common.cfg Modified: vendor/compiler-rt/dist/lib/builtins/arm/subsf3vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/subsf3vfp.S Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/lib/builtins/arm/subsf3vfp.S Fri Feb 17 19:37:28 2017 (r313885) @@ -21,7 +21,7 @@ DEFINE_COMPILERRT_FUNCTION(__subsf3vfp) #if defined(COMPILER_RT_ARMHF_TARGET) vsub.f32 s0, s0, s1 -#elsee +#else vmov s14, r0 // move first param from r0 into float register vmov s15, r1 // move second param from r1 into float register vsub.f32 s14, s14, s15 Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc Fri Feb 17 19:37:28 2017 (r313885) @@ -23,11 +23,6 @@ #ifdef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS #endif -#if SANITIZER_FREEBSD -#define _WANT_RTENTRY -#include -#include -#endif #include #include #include @@ -433,6 +428,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo); unsigned struct_input_id_sz = sizeof(struct input_id); unsigned struct_mtpos_sz = sizeof(struct mtpos); + unsigned struct_rtentry_sz = sizeof(struct rtentry); unsigned struct_termio_sz = sizeof(struct termio); unsigned struct_vt_consize_sz = sizeof(struct vt_consize); unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes); @@ -452,7 +448,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El unsigned struct_midi_info_sz = sizeof(struct midi_info); unsigned struct_mtget_sz = sizeof(struct mtget); unsigned struct_mtop_sz = sizeof(struct mtop); - unsigned struct_rtentry_sz = sizeof(struct rtentry); unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument); unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec); unsigned struct_synth_info_sz = sizeof(struct synth_info); Modified: vendor/compiler-rt/dist/test/builtins/Unit/clear_cache_test.c ============================================================================== --- vendor/compiler-rt/dist/test/builtins/Unit/clear_cache_test.c Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/test/builtins/Unit/clear_cache_test.c Fri Feb 17 19:37:28 2017 (r313885) @@ -18,9 +18,20 @@ void __clear_cache(void* start, void* en if (!FlushInstructionCache(GetCurrentProcess(), start, end-start)) exit(1); } + +static uintptr_t get_page_size() { + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +} #else +#include #include extern void __clear_cache(void* start, void* end); + +static uintptr_t get_page_size() { + return sysconf(_SC_PAGE_SIZE); +} #endif @@ -56,8 +67,9 @@ unsigned char execution_buffer[128]; int main() { // make executable the page containing execution_buffer - char* start = (char*)((uintptr_t)execution_buffer & (-4095)); - char* end = (char*)((uintptr_t)(&execution_buffer[128+4096]) & (-4095)); + uintptr_t page_size = get_page_size(); + char* start = (char*)((uintptr_t)execution_buffer & (-page_size)); + char* end = (char*)((uintptr_t)(&execution_buffer[128+page_size]) & (-page_size)); #if defined(_WIN32) DWORD dummy_oldProt; MEMORY_BASIC_INFORMATION b; Modified: vendor/compiler-rt/dist/test/builtins/Unit/fixunsdfdi_test.c ============================================================================== --- vendor/compiler-rt/dist/test/builtins/Unit/fixunsdfdi_test.c Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/test/builtins/Unit/fixunsdfdi_test.c Fri Feb 17 19:37:28 2017 (r313885) @@ -95,9 +95,6 @@ int main() if (test__fixunsdfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL)) return 1; - if (test__fixunsdfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFFLL)) - return 1; - #if !TARGET_LIBGCC if (test__fixunsdfdi(-0x1.FFFFFFFFFFFFFp+62, 0)) return 1; Modified: vendor/compiler-rt/dist/test/builtins/Unit/fixunssfdi_test.c ============================================================================== --- vendor/compiler-rt/dist/test/builtins/Unit/fixunssfdi_test.c Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/test/builtins/Unit/fixunssfdi_test.c Fri Feb 17 19:37:28 2017 (r313885) @@ -79,8 +79,6 @@ int main() return 1; if (test__fixunssfdi(0x1.000000p+63F, 0x8000000000000000LL)) return 1; - if (test__fixunssfdi(0x1.000000p+64F, 0xFFFFFFFFFFFFFFFFLL)) - return 1; if (test__fixunssfdi(0x1.FFFFFEp+62F, 0x7FFFFF8000000000LL)) return 1; if (test__fixunssfdi(0x1.FFFFFCp+62F, 0x7FFFFF0000000000LL)) Modified: vendor/compiler-rt/dist/test/lsan/TestCases/strace_test.cc ============================================================================== --- vendor/compiler-rt/dist/test/lsan/TestCases/strace_test.cc Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/test/lsan/TestCases/strace_test.cc Fri Feb 17 19:37:28 2017 (r313885) @@ -1,4 +1,5 @@ // Test that lsan reports a proper error when running under strace. +// REQUIRES: strace // RUN: %clangxx_lsan %s -o %t // RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s Modified: vendor/compiler-rt/dist/test/lsan/lit.common.cfg ============================================================================== --- vendor/compiler-rt/dist/test/lsan/lit.common.cfg Fri Feb 17 19:36:54 2017 (r313884) +++ vendor/compiler-rt/dist/test/lsan/lit.common.cfg Fri Feb 17 19:37:28 2017 (r313885) @@ -4,6 +4,8 @@ import os +import lit.util + def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: @@ -29,6 +31,9 @@ else: lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode) config.name += config.name_suffix +if lit.util.which('strace'): + config.available_features.add('strace') + clang_cflags = ["-O0", config.target_cflags] + config.debug_info_flags clang_cxxflags = config.cxx_mode_flags + clang_cflags lsan_incdir = config.test_source_root + "/../"