[ASan] Link with libclang_rt.asan_iossim_dynamic.dylib when targeting the iOS simulator.
Add a test. llvm-svn: 194820
This commit is contained in:
parent
71ce0cab02
commit
868cca96c4
@ -329,8 +329,17 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
|
||||
// The ASAN runtime library requires C++.
|
||||
AddCXXStdlibLibArgs(Args, CmdArgs);
|
||||
}
|
||||
AddLinkRuntimeLib(Args, CmdArgs,
|
||||
"libclang_rt.asan_osx_dynamic.dylib", true);
|
||||
if (isTargetMacOS()) {
|
||||
AddLinkRuntimeLib(Args, CmdArgs,
|
||||
"libclang_rt.asan_osx_dynamic.dylib",
|
||||
true);
|
||||
} else {
|
||||
if (isTargetIOSSimulator()) {
|
||||
AddLinkRuntimeLib(Args, CmdArgs,
|
||||
"libclang_rt.asan_iossim_dynamic.dylib",
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,14 @@
|
||||
// CHECK-ASAN: stdc++
|
||||
// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
|
||||
|
||||
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
||||
// RUN: -fsanitize=address -mios-simulator-version-min=7.0 %s -o %t.o 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s
|
||||
|
||||
// CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}"
|
||||
// CHECK-ASAN-IOSSIM: stdc++
|
||||
// CHECK-ASAN-IOSSIM: libclang_rt.asan_iossim_dynamic.dylib"
|
||||
|
||||
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
|
||||
// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-DYN-ASAN %s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user