Skip to content

Commit 969a51f

Browse files
committed
Revert "[ASan] Moved optimized callbacks into a separate library."
We need some internal updates for this, shared directly with the author. This reverts commit 71b3bfd.
1 parent eb91d91 commit 969a51f

File tree

5 files changed

+2
-55
lines changed

5 files changed

+2
-55
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,11 +826,6 @@ collectSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,
826826
if (SanArgs.needsStatsRt() && SanArgs.linkRuntimes())
827827
StaticRuntimes.push_back("stats_client");
828828

829-
// Always link the static runtime regardless of DSO or executable.
830-
if (SanArgs.needsAsanRt()) {
831-
HelperStaticRuntimes.push_back("asan_static");
832-
}
833-
834829
// Collect static runtimes.
835830
if (Args.hasArg(options::OPT_shared)) {
836831
// Don't link static runtimes into DSOs.

clang/test/Driver/sanitizer-ld.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
2323
// RUN: | FileCheck --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-LINUX %s
2424
//
25-
// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan-x86_64
25+
// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan
2626

2727
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
2828
// RUN: -target i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libsan \

compiler-rt/lib/asan/CMakeLists.txt

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ set(ASAN_SOURCES
3434

3535
if (NOT WIN32 AND NOT APPLE)
3636
list(APPEND ASAN_SOURCES
37+
asan_rtl_x86_64.S
3738
asan_interceptors_vfork.S
3839
)
3940
endif()
@@ -42,16 +43,6 @@ set(ASAN_CXX_SOURCES
4243
asan_new_delete.cpp
4344
)
4445

45-
set(ASAN_STATIC_SOURCES
46-
asan_rtl_static.cpp
47-
)
48-
49-
if (NOT WIN32 AND NOT APPLE)
50-
list(APPEND ASAN_STATIC_SOURCES
51-
asan_rtl_x86_64.S
52-
)
53-
endif()
54-
5546
set(ASAN_PREINIT_SOURCES
5647
asan_preinit.cpp
5748
)
@@ -144,12 +135,6 @@ if(NOT APPLE)
144135
ADDITIONAL_HEADERS ${ASAN_HEADERS}
145136
CFLAGS ${ASAN_CFLAGS}
146137
DEFS ${ASAN_COMMON_DEFINITIONS})
147-
add_compiler_rt_object_libraries(RTAsan_static
148-
ARCHS ${ASAN_SUPPORTED_ARCH}
149-
SOURCES ${ASAN_STATIC_SOURCES}
150-
ADDITIONAL_HEADERS ${ASAN_HEADERS}
151-
CFLAGS ${ASAN_CFLAGS}
152-
DEFS ${ASAN_COMMON_DEFINITIONS})
153138
add_compiler_rt_object_libraries(RTAsan_preinit
154139
ARCHS ${ASAN_SUPPORTED_ARCH}
155140
SOURCES ${ASAN_PREINIT_SOURCES}
@@ -191,14 +176,6 @@ if(APPLE)
191176
LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS}
192177
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
193178
PARENT_TARGET asan)
194-
195-
add_compiler_rt_runtime(clang_rt.asan_static
196-
STATIC
197-
ARCHS ${ASAN_SUPPORTED_ARCH}
198-
OBJECT_LIBS RTAsan_static
199-
CFLAGS ${ASAN_CFLAGS}
200-
DEFS ${ASAN_COMMON_DEFINITIONS}
201-
PARENT_TARGET asan)
202179
else()
203180
# Build separate libraries for each target.
204181

@@ -230,14 +207,6 @@ else()
230207
DEFS ${ASAN_COMMON_DEFINITIONS}
231208
PARENT_TARGET asan)
232209

233-
add_compiler_rt_runtime(clang_rt.asan_static
234-
STATIC
235-
ARCHS ${ASAN_SUPPORTED_ARCH}
236-
OBJECT_LIBS RTAsan_static
237-
CFLAGS ${ASAN_CFLAGS}
238-
DEFS ${ASAN_COMMON_DEFINITIONS}
239-
PARENT_TARGET asan)
240-
241210
add_compiler_rt_runtime(clang_rt.asan-preinit
242211
STATIC
243212
ARCHS ${ASAN_SUPPORTED_ARCH}

compiler-rt/lib/asan/asan_rtl_static.cpp

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

compiler-rt/lib/asan/tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID)
261261
set(ASAN_TEST_RUNTIME_OBJECTS
262262
$<TARGET_OBJECTS:RTAsan.${arch}>
263263
$<TARGET_OBJECTS:RTAsan_cxx.${arch}>
264-
$<TARGET_OBJECTS:RTAsan_static.${arch}>
265264
$<TARGET_OBJECTS:RTInterception.${arch}>
266265
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
267266
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
@@ -287,7 +286,6 @@ if(ANDROID)
287286
# Test w/o ASan instrumentation. Link it with ASan statically.
288287
add_executable(AsanNoinstTest # FIXME: .arch?
289288
$<TARGET_OBJECTS:RTAsan.${arch}>
290-
$<TARGET_OBJECTS:RTAsan_static.${arch}>
291289
$<TARGET_OBJECTS:RTInterception.${arch}>
292290
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
293291
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>

0 commit comments

Comments
 (0)