[PATCH] [sanitizer][MIPS] Fix warnings on MIPS

Sagar Thakur Sagar.Thakur at imgtec.com
Fri Apr 10 02:06:55 PDT 2015


Hi samsonov, kcc, dvyukov,

Fixed:
- stack frame size warning.
- msse3 flag unused warning.
- GoTsanRuntimeCheck dependency warning reported by cmake.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8963

Files:
  CMakeLists.txt
  cmake/config-ix.cmake
  test/tsan/CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -238,12 +238,13 @@
 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)
Index: cmake/config-ix.cmake
===================================================================
--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -308,3 +308,10 @@
   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()
Index: test/tsan/CMakeLists.txt
===================================================================
--- test/tsan/CMakeLists.txt
+++ 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()

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8963.23468.patch
Type: text/x-patch
Size: 1813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150410/9da6889c/attachment.bin>


More information about the llvm-commits mailing list