From 4bf08947a12887ce368a9ec399c26b35ae8137f9 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 10 Apr 2015 09:45:22 +0000 Subject: [PATCH] [sanitizer][MIPS] Fix warnings on MIPS Fixed: - stack frame size warning. - msse3 flag unused warning. - GoTsanRuntimeCheck dependency warning reported by cmake. Change by Sagar Thakur Reviewed in http://reviews.llvm.org/D8963 llvm-svn: 234579 --- compiler-rt/CMakeLists.txt | 5 +++-- compiler-rt/cmake/config-ix.cmake | 7 +++++++ compiler-rt/test/tsan/CMakeLists.txt | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index a205a2002ff9..0d8a88080460 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -238,12 +238,13 @@ if(NOT COMPILER_RT_DEBUG AND NOT MSVC) endif() # Determine if we should restrict stack frame sizes. -# Stack frames on PowerPC and in debug biuld can be much larger than +# Stack frames on PowerPC and Mips and in debug biuld can be much larger than # anticipated. # FIXME: Fix all sanitizers and add -Wframe-larger-than to # SANITIZER_COMMON_FLAGS if(COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG AND NOT COMPILER_RT_DEBUG - AND NOT ${LLVM_NATIVE_ARCH} STREQUAL "PowerPC") + AND NOT ${LLVM_NATIVE_ARCH} STREQUAL "PowerPC" + AND NOT ${LLVM_NATIVE_ARCH} STREQUAL "Mips") set(SANITIZER_LIMIT_FRAME_SIZE TRUE) else() set(SANITIZER_LIMIT_FRAME_SIZE FALSE) diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index c23ff0551885..28f27615ab3b 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -308,3 +308,10 @@ else() set(COMPILER_RT_HAS_UBSAN FALSE) endif() +# -msse3 flag is not valid for Mips therefore clang gives a warning +# message with -msse3. But check_c_compiler_flags() checks only for +# compiler error messages. Therefore COMPILER_RT_HAS_MSSE3_FLAG turns out to be +# true on Mips. So we make it false here. +if("${LLVM_NATIVE_ARCH}" STREQUAL "Mips") + set(COMPILER_RT_HAS_MSSE3_FLAG FALSE) +endif() diff --git a/compiler-rt/test/tsan/CMakeLists.txt b/compiler-rt/test/tsan/CMakeLists.txt index 5a9542fd76fc..2996c1d80fbd 100644 --- a/compiler-rt/test/tsan/CMakeLists.txt +++ b/compiler-rt/test/tsan/CMakeLists.txt @@ -1,5 +1,7 @@ set(TSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) -list(APPEND TSAN_TEST_DEPS GotsanRuntimeCheck) +if(NOT ${LLVM_NATIVE_ARCH} STREQUAL "Mips") + list(APPEND TSAN_TEST_DEPS GotsanRuntimeCheck) +endif() if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TSAN_TEST_DEPS tsan) endif()