@@ -38,40 +38,9 @@ if (NOT WIN32 AND NOT APPLE)
38
38
)
39
39
endif ()
40
40
41
- if (WIN32 )
42
- set (ASAN_CXX_SOURCES asan_win_new_delete.cpp )
43
- else ()
44
- set (ASAN_CXX_SOURCES asan_new_delete.cpp )
45
- endif ()
46
-
47
- if (APPLE )
48
- set (ASAN_SOURCES ASAN_CXX_SOURCES )
49
- endif ()
50
-
51
- if (WIN32 )
52
- set (ASAN_STATIC_IMPLIB_SOURCES
53
- asan_win_delete_array_thunk.cpp
54
- asan_win_delete_array_align_thunk.cpp
55
- asan_win_delete_array_align_nothrow_thunk.cpp
56
- asan_win_delete_array_nothrow_thunk.cpp
57
- asan_win_delete_array_size_thunk.cpp
58
- asan_win_delete_array_size_align_thunk.cpp
59
- asan_win_delete_scalar_thunk.cpp
60
- asan_win_delete_scalar_align_thunk.cpp
61
- asan_win_delete_scalar_align_nothrow_thunk.cpp
62
- asan_win_delete_scalar_nothrow_thunk.cpp
63
- asan_win_delete_scalar_size_thunk.cpp
64
- asan_win_delete_scalar_size_align_thunk.cpp
65
- asan_win_new_array_thunk.cpp
66
- asan_win_new_array_align_thunk.cpp
67
- asan_win_new_array_align_nothrow_thunk.cpp
68
- asan_win_new_array_nothrow_thunk.cpp
69
- asan_win_new_scalar_thunk.cpp
70
- asan_win_new_scalar_align_thunk.cpp
71
- asan_win_new_scalar_align_nothrow_thunk.cpp
72
- asan_win_new_scalar_nothrow_thunk.cpp
73
- )
74
- endif ()
41
+ set (ASAN_CXX_SOURCES
42
+ asan_new_delete.cpp
43
+ )
75
44
76
45
set (ASAN_STATIC_SOURCES
77
46
asan_rtl_static.cpp
@@ -114,20 +83,12 @@ SET(ASAN_HEADERS
114
83
asan_thread.h
115
84
)
116
85
117
- if (WIN32 )
118
- list (APPEND ASAN_HEADERS
119
- asan_win_new_delete_thunk_common.h
120
- asan_win_thunk_common.h
121
- )
122
- endif ()
123
-
124
86
include_directories (.. )
125
87
126
88
set (ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS} )
127
89
set (ASAN_COMMON_DEFINITIONS ${COMPILER_RT_ASAN_SHADOW_SCALE_DEFINITION} )
128
90
129
91
append_rtti_flag (OFF ASAN_CFLAGS )
130
- append_list_if (MSVC /EHsc ASAN_CFLAGS )
131
92
132
93
# Silence warnings in system headers with MSVC.
133
94
if (NOT CLANG_CL )
@@ -178,15 +139,6 @@ add_compiler_rt_object_libraries(RTAsan_dynamic
178
139
CFLAGS ${ASAN_DYNAMIC_CFLAGS}
179
140
DEFS ${ASAN_DYNAMIC_DEFINITIONS} )
180
141
181
- if (WIN32 )
182
- add_compiler_rt_object_libraries (RTAsan_static_implib
183
- ARCHS ${ASAN_SUPPORTED_ARCH}
184
- SOURCES ${ASAN_STATIC_IMPLIB_SOURCES}
185
- ADDITIONAL_HEADERS ${ASAN_HEADERS}
186
- CFLAGS ${ASAN_CFLAGS} ${NO_DEFAULT_LIBS_OPTION}
187
- DEFS ${ASAN_COMMON_DEFINITIONS} )
188
- endif ()
189
-
190
142
if (NOT APPLE )
191
143
add_compiler_rt_object_libraries (RTAsan
192
144
ARCHS ${ASAN_SUPPORTED_ARCH}
@@ -287,24 +239,13 @@ else()
287
239
DEFS ${ASAN_COMMON_DEFINITIONS}
288
240
PARENT_TARGET asan )
289
241
290
- if (WIN32 )
291
242
add_compiler_rt_runtime (clang_rt.asan_static
292
243
STATIC
293
244
ARCHS ${ASAN_SUPPORTED_ARCH}
294
245
OBJECT_LIBS RTAsan_static
295
- RTAsan_static_implib
296
246
CFLAGS ${ASAN_CFLAGS}
297
247
DEFS ${ASAN_COMMON_DEFINITIONS}
298
248
PARENT_TARGET asan )
299
- else ()
300
- add_compiler_rt_runtime (clang_rt.asan_static
301
- STATIC
302
- ARCHS ${ASAN_SUPPORTED_ARCH}
303
- OBJECT_LIBS RTAsan_static
304
- CFLAGS ${ASAN_CFLAGS}
305
- DEFS ${ASAN_COMMON_DEFINITIONS}
306
- PARENT_TARGET asan )
307
- endif ()
308
249
309
250
add_compiler_rt_runtime (clang_rt.asan-preinit
310
251
STATIC
@@ -314,13 +255,6 @@ endif()
314
255
DEFS ${ASAN_COMMON_DEFINITIONS}
315
256
PARENT_TARGET asan )
316
257
317
-
318
- if (MSVC AND COMPILER_RT_DEBUG )
319
- set (MSVC_DBG_SUFFIX _dbg )
320
- else ()
321
- set (MSVC_DBG_SUFFIX )
322
- endif ()
323
-
324
258
foreach (arch ${ASAN_SUPPORTED_ARCH} )
325
259
if (COMPILER_RT_HAS_VERSION_SCRIPT )
326
260
add_sanitizer_rt_version_list (clang_rt.asan-dynamic-${arch}
@@ -377,27 +311,6 @@ endif()
377
311
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
378
312
PARENT_TARGET asan )
379
313
380
- if (WIN32 )
381
- set_target_properties (clang_rt.asan${MSVC_DBG_SUFFIX}-dynamic-${arch}
382
- PROPERTIES ARCHIVE_OUTPUT_NAME clang_rt.asan_dynamic-${arch}_implib
383
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} " )
384
-
385
- add_library (clang_rt.asan-${arch}_implib STATIC )
386
- target_link_libraries (clang_rt.asan-${arch}_implib RTAsan_static_implib.${arch} )
387
- add_dependencies (asan clang_rt.asan-${arch}_implib )
388
- add_dependencies (clang_rt.asan-${arch}_implib clang_rt.asan${MSVC_DBG_SUFFIX}-dynamic-${arch} )
389
- get_compiler_rt_output_dir (${arch} IMPLIB_OUTPUT_DIR )
390
- set_target_properties (clang_rt.asan-${arch}_implib
391
- PROPERTIES ARCHIVE_OUTPUT_NAME clang_rt.asan${MSVC_DBG_SUFFIX}_dynamic-${arch}
392
- ARCHIVE_OUTPUT_DIRECTORY ${IMPLIB_OUTPUT_DIR}
393
- STATIC_LIBRARY_OPTIONS "$<TARGET_LINKER_FILE:clang_rt.asan${MSVC_DBG_SUFFIX} -dynamic-${arch} >" )
394
- get_compiler_rt_install_dir (${arch} IMPLIB_INSTALL_DIR )
395
- install (TARGETS clang_rt.asan-${arch}_implib
396
- ARCHIVE DESTINATION ${IMPLIB_INSTALL_DIR}
397
- LIBRARY DESTINATION ${IMPLIB_INSTALL_DIR}
398
- RUNTIME DESTINATION ${IMPLIB_INSTALL_DIR} )
399
- endif ()
400
-
401
314
if (SANITIZER_USE_SYMBOLS AND NOT ${arch} STREQUAL "i386" )
402
315
add_sanitizer_rt_symbols (clang_rt.asan_cxx
403
316
ARCHS ${arch} )
0 commit comments