Skip to content

Commit a09b881

Browse files
committed
Revert "[asan][win][msvc] override new and delete and seperate TUs (#68754)"
This reverts commit 481e9b3. Breaks sanitizer bots: https://lab.llvm.org/buildbot/#/builders/127/builds/59071
1 parent d8a0439 commit a09b881

File tree

46 files changed

+75
-1696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+75
-1696
lines changed

compiler-rt/lib/asan/CMakeLists.txt

Lines changed: 3 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,9 @@ if (NOT WIN32 AND NOT APPLE)
3838
)
3939
endif()
4040

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+
)
7544

7645
set(ASAN_STATIC_SOURCES
7746
asan_rtl_static.cpp
@@ -114,20 +83,12 @@ SET(ASAN_HEADERS
11483
asan_thread.h
11584
)
11685

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-
12486
include_directories(..)
12587

12688
set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
12789
set(ASAN_COMMON_DEFINITIONS ${COMPILER_RT_ASAN_SHADOW_SCALE_DEFINITION})
12890

12991
append_rtti_flag(OFF ASAN_CFLAGS)
130-
append_list_if(MSVC /EHsc ASAN_CFLAGS)
13192

13293
# Silence warnings in system headers with MSVC.
13394
if(NOT CLANG_CL)
@@ -178,15 +139,6 @@ add_compiler_rt_object_libraries(RTAsan_dynamic
178139
CFLAGS ${ASAN_DYNAMIC_CFLAGS}
179140
DEFS ${ASAN_DYNAMIC_DEFINITIONS})
180141

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-
190142
if(NOT APPLE)
191143
add_compiler_rt_object_libraries(RTAsan
192144
ARCHS ${ASAN_SUPPORTED_ARCH}
@@ -287,24 +239,13 @@ else()
287239
DEFS ${ASAN_COMMON_DEFINITIONS}
288240
PARENT_TARGET asan)
289241

290-
if(WIN32)
291242
add_compiler_rt_runtime(clang_rt.asan_static
292243
STATIC
293244
ARCHS ${ASAN_SUPPORTED_ARCH}
294245
OBJECT_LIBS RTAsan_static
295-
RTAsan_static_implib
296246
CFLAGS ${ASAN_CFLAGS}
297247
DEFS ${ASAN_COMMON_DEFINITIONS}
298248
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()
308249

309250
add_compiler_rt_runtime(clang_rt.asan-preinit
310251
STATIC
@@ -314,13 +255,6 @@ endif()
314255
DEFS ${ASAN_COMMON_DEFINITIONS}
315256
PARENT_TARGET asan)
316257

317-
318-
if (MSVC AND COMPILER_RT_DEBUG)
319-
set(MSVC_DBG_SUFFIX _dbg)
320-
else()
321-
set(MSVC_DBG_SUFFIX )
322-
endif()
323-
324258
foreach(arch ${ASAN_SUPPORTED_ARCH})
325259
if (COMPILER_RT_HAS_VERSION_SCRIPT)
326260
add_sanitizer_rt_version_list(clang_rt.asan-dynamic-${arch}
@@ -377,27 +311,6 @@ endif()
377311
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
378312
PARENT_TARGET asan)
379313

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-
401314
if (SANITIZER_USE_SYMBOLS AND NOT ${arch} STREQUAL "i386")
402315
add_sanitizer_rt_symbols(clang_rt.asan_cxx
403316
ARCHS ${arch})

compiler-rt/lib/asan/asan_interface.inc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,3 @@ INTERFACE_FUNCTION(__asan_update_allocation_context)
187187
INTERFACE_WEAK_FUNCTION(__asan_default_options)
188188
INTERFACE_WEAK_FUNCTION(__asan_default_suppressions)
189189
INTERFACE_WEAK_FUNCTION(__asan_on_error)
190-
191-
#if SANITIZER_WINDOWS
192-
INTERFACE_FUNCTION(__asan_delete)
193-
INTERFACE_FUNCTION(__asan_delete_align)
194-
INTERFACE_FUNCTION(__asan_delete_array)
195-
INTERFACE_FUNCTION(__asan_delete_array_align)
196-
INTERFACE_FUNCTION(__asan_delete_array_size)
197-
INTERFACE_FUNCTION(__asan_delete_array_size_align)
198-
INTERFACE_FUNCTION(__asan_delete_size)
199-
INTERFACE_FUNCTION(__asan_delete_size_align)
200-
INTERFACE_FUNCTION(__asan_new)
201-
INTERFACE_FUNCTION(__asan_new_align)
202-
INTERFACE_FUNCTION(__asan_new_align_nothrow)
203-
INTERFACE_FUNCTION(__asan_new_array)
204-
INTERFACE_FUNCTION(__asan_new_array_align)
205-
INTERFACE_FUNCTION(__asan_new_array_align_nothrow)
206-
INTERFACE_FUNCTION(__asan_new_array_nothrow)
207-
INTERFACE_FUNCTION(__asan_new_nothrow)
208-
#endif // SANITIZER_WINDOWS

compiler-rt/lib/asan/asan_win_delete_array_align_nothrow_thunk.cpp

Lines changed: 0 additions & 24 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_array_align_thunk.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_array_nothrow_thunk.cpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_array_size_align_thunk.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_array_size_thunk.cpp

Lines changed: 0 additions & 27 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_array_thunk.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_scalar_align_nothrow_thunk.cpp

Lines changed: 0 additions & 24 deletions
This file was deleted.

compiler-rt/lib/asan/asan_win_delete_scalar_align_thunk.cpp

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)