Date: Fri, 17 Feb 2017 19:37:28 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> 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 Message-ID: <201702171937.v1HJbSwC075051@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <sys/param.h> -#include <sys/socketvar.h> -#endif #include <arpa/inet.h> #include <dirent.h> #include <errno.h> @@ -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 <unistd.h> #include <sys/mman.h> 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 + "/../"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702171937.v1HJbSwC075051>