Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 76ca11d

Browse files
committed
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
1 parent 8be6460 commit 76ca11d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/asan/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ else()
180180
if (MSVC)
181181
add_compiler_rt_object_libraries(AsanWeakInterception
182182
${SANITIZER_COMMON_SUPPORTED_OS}
183-
ARCHS ${ASAN_SUPPORTED_ARCH}
183+
ARCHS ${arch}
184184
SOURCES asan_win_weak_interception.cc
185185
CFLAGS ${ASAN_CFLAGS} -DSANITIZER_DYNAMIC
186186
DEFS ${ASAN_COMMON_DEFINITIONS})
@@ -223,7 +223,7 @@ else()
223223
if (WIN32)
224224
add_compiler_rt_object_libraries(AsanDllThunk
225225
${SANITIZER_COMMON_SUPPORTED_OS}
226-
ARCHS ${ASAN_SUPPORTED_ARCH}
226+
ARCHS ${arch}
227227
SOURCES asan_globals_win.cc
228228
asan_win_dll_thunk.cc
229229
CFLAGS ${ASAN_CFLAGS} -DSANITIZER_DLL_THUNK
@@ -248,7 +248,7 @@ else()
248248

249249
add_compiler_rt_object_libraries(AsanDynamicRuntimeThunk
250250
${SANITIZER_COMMON_SUPPORTED_OS}
251-
ARCHS ${ASAN_SUPPORTED_ARCH}
251+
ARCHS ${arch}
252252
SOURCES asan_globals_win.cc
253253
asan_win_dynamic_runtime_thunk.cc
254254
CFLAGS ${ASAN_CFLAGS} ${DYNAMIC_RUNTIME_THUNK_CFLAGS}

lib/sanitizer_common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ add_compiler_rt_object_libraries(RTSanitizerCommonLibc
188188
CFLAGS ${SANITIZER_CFLAGS}
189189
DEFS ${SANITIZER_COMMON_DEFINITIONS})
190190

191-
if(MSVC)
191+
if(WIN32)
192192
add_compiler_rt_object_libraries(SanitizerCommonWeakInterception
193193
${SANITIZER_COMMON_SUPPORTED_OS}
194194
ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}

0 commit comments

Comments
 (0)