From 3dfdcbdf6f1f1ecb2acd9c1fb600d5ebf11219e7 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 29 Jan 2017 20:58:54 +0000 Subject: Vendor import of compiler-rt release_40 branch r293443: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_40@293443 --- lib/builtins/arm/comparesf2.S | 2 +- lib/xray/xray_arm.cc | 7 ++++++- test/xray/lit.cfg | 8 +++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/builtins/arm/comparesf2.S b/lib/builtins/arm/comparesf2.S index e8095650e4fb..a5b7e36487d6 100644 --- a/lib/builtins/arm/comparesf2.S +++ b/lib/builtins/arm/comparesf2.S @@ -283,7 +283,7 @@ DEFINE_COMPILERRT_FUNCTION(__unordsf2) END_COMPILERRT_FUNCTION(__unordsf2) #if defined(COMPILER_RT_ARMHF_TARGET) -DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmpum): +DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmpum) vmov s0, r0 vmov s1, r1 b SYMBOL_NAME(__unordsf2) diff --git a/lib/xray/xray_arm.cc b/lib/xray/xray_arm.cc index d89322e833e5..f5e2cd2a93c2 100644 --- a/lib/xray/xray_arm.cc +++ b/lib/xray/xray_arm.cc @@ -19,6 +19,8 @@ #include #include +extern "C" void __clear_cache(void* start, void* end); + namespace __xray { uint64_t cycleFrequency() XRAY_NEVER_INSTRUMENT { @@ -116,8 +118,8 @@ inline static bool patchSled(const bool Enable, const uint32_t FuncId, // B #20 uint32_t *FirstAddress = reinterpret_cast(Sled.Address); + uint32_t *CurAddress = FirstAddress + 1; if (Enable) { - uint32_t *CurAddress = FirstAddress + 1; CurAddress = Write32bitLoadR0(CurAddress, reinterpret_cast(FuncId)); CurAddress = @@ -125,6 +127,7 @@ inline static bool patchSled(const bool Enable, const uint32_t FuncId, *CurAddress = uint32_t(PatchOpcodes::PO_BlxIp); CurAddress++; *CurAddress = uint32_t(PatchOpcodes::PO_PopR0Lr); + CurAddress++; std::atomic_store_explicit( reinterpret_cast *>(FirstAddress), uint32_t(PatchOpcodes::PO_PushR0Lr), std::memory_order_release); @@ -133,6 +136,8 @@ inline static bool patchSled(const bool Enable, const uint32_t FuncId, reinterpret_cast *>(FirstAddress), uint32_t(PatchOpcodes::PO_B20), std::memory_order_release); } + __clear_cache(reinterpret_cast(FirstAddress), + reinterpret_cast(CurAddress)); return true; } diff --git a/test/xray/lit.cfg b/test/xray/lit.cfg index 5d030e101452..9142ad13618c 100644 --- a/test/xray/lit.cfg +++ b/test/xray/lit.cfg @@ -30,8 +30,14 @@ config.substitutions.append( # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] -if config.host_os not in ['Linux'] or config.host_arch.find('64') == -1: +if config.host_os not in ['Linux']: config.unsupported = True +elif '64' not in config.host_arch: + if 'arm' in config.host_arch: + if '-mthumb' in config.target_cflags: + config.unsupported = True + else: + config.unsupported = True # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL # e.g. because the test sometimes passes, sometimes fails. -- cgit v1.3