From 76ca11dcce7f2754776a80a39521edbc21a8643a Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 8 Feb 2017 20:43:39 +0000 Subject: build: repair cross-compilation with clang When building for Windows, we would check if we were using MSVC rather than WIN32. This resulted in needed targets not being defined by sanitizer_common. Fix the conditional. When registering the objects libraries for ASAN, we would multiply register for all targets as we were creating them inside a loop over all architectures. Only define the target per architecture. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@294510 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/asan/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/asan/CMakeLists.txt') diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt index aec11dff7..78a504cfa 100644 --- a/lib/asan/CMakeLists.txt +++ b/lib/asan/CMakeLists.txt @@ -180,7 +180,7 @@ else() if (MSVC) add_compiler_rt_object_libraries(AsanWeakInterception ${SANITIZER_COMMON_SUPPORTED_OS} - ARCHS ${ASAN_SUPPORTED_ARCH} + ARCHS ${arch} SOURCES asan_win_weak_interception.cc CFLAGS ${ASAN_CFLAGS} -DSANITIZER_DYNAMIC DEFS ${ASAN_COMMON_DEFINITIONS}) @@ -223,7 +223,7 @@ else() if (WIN32) add_compiler_rt_object_libraries(AsanDllThunk ${SANITIZER_COMMON_SUPPORTED_OS} - ARCHS ${ASAN_SUPPORTED_ARCH} + ARCHS ${arch} SOURCES asan_globals_win.cc asan_win_dll_thunk.cc CFLAGS ${ASAN_CFLAGS} -DSANITIZER_DLL_THUNK @@ -248,7 +248,7 @@ else() add_compiler_rt_object_libraries(AsanDynamicRuntimeThunk ${SANITIZER_COMMON_SUPPORTED_OS} - ARCHS ${ASAN_SUPPORTED_ARCH} + ARCHS ${arch} SOURCES asan_globals_win.cc asan_win_dynamic_runtime_thunk.cc CFLAGS ${ASAN_CFLAGS} ${DYNAMIC_RUNTIME_THUNK_CFLAGS} -- cgit v1.2.3