Build LSan on x86_64 only if this target is supported

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182272 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/lsan/CMakeLists.txt b/lib/lsan/CMakeLists.txt
index 73b96a2..1ac0072 100644
--- a/lib/lsan/CMakeLists.txt
+++ b/lib/lsan/CMakeLists.txt
@@ -14,13 +14,17 @@
 set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 
 set(LSAN_RUNTIME_LIBRARIES)
-set(arch "x86_64")
-add_compiler_rt_static_runtime(clang_rt.lsan-${arch} ${arch}
-  SOURCES ${LSAN_SOURCES}
-          $<TARGET_OBJECTS:RTInterception.${arch}>
-          $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
-          $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
-  CFLAGS ${LSAN_CFLAGS})
-list(APPEND LSAN_RUNTIME_LIBRARIES clang_rt.lsan-${arch})
+
+# FIXME: support LSan for other arches.
+if(CAN_TARGET_x86_64)
+  set(arch "x86_64")
+  add_compiler_rt_static_runtime(clang_rt.lsan-${arch} ${arch}
+    SOURCES ${LSAN_SOURCES}
+            $<TARGET_OBJECTS:RTInterception.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
+    CFLAGS ${LSAN_CFLAGS})
+  list(APPEND LSAN_RUNTIME_LIBRARIES clang_rt.lsan-${arch})
+endif()
 
 add_subdirectory(tests)