Skip to content

Commit 39041d4

Browse files
Merge pull request #437 from swiftlang/bg/add-new-libcpp-flag
Add new libcxx flag for disabling container overflow checks for Asan.
2 parents 93322b9 + c704557 commit 39041d4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/SWBUniversalPlatform/Specs/Clang LLVM 1.0.xcspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,6 +2736,7 @@
27362736
YES = ();
27372737
NO = (
27382738
"-D_LIBCPP_HAS_NO_ASAN",
2739+
"-D_LIBCPP_HAS_ASAN=0",
27392740
);
27402741
};
27412742
Condition = "$(CLANG_ADDRESS_SANITIZER)";

Tests/SWBTaskConstructionTests/TaskConstructionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4135,7 +4135,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests {
41354135
// There should be one CompileC task, which includes the ASan option, and which puts its output in a -asan directory.
41364136
results.checkTask(.matchTarget(target), .matchRuleType("CompileC")) { task in
41374137
task.checkRuleInfo([.equal("CompileC"), .equal("\(SRCROOT)/build/aProject.build/Debug/\(targetName).build/Objects-normal-asan/x86_64/SourceFile.o"), .suffix("SourceFile.m"), .any, .any, .any, .any])
4138-
task.checkCommandLineContains(["\(core.developerPath.path.str)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang", "-fsanitize=address", "-D_LIBCPP_HAS_NO_ASAN", "\(SRCROOT)/build/aProject.build/Debug/\(targetName).build/Objects-normal-asan/x86_64/SourceFile.o"])
4138+
task.checkCommandLineContains(["\(core.developerPath.path.str)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang", "-fsanitize=address", "-D_LIBCPP_HAS_NO_ASAN", "-D_LIBCPP_HAS_ASAN=0", "\(SRCROOT)/build/aProject.build/Debug/\(targetName).build/Objects-normal-asan/x86_64/SourceFile.o"])
41394139
}
41404140

41414141
// There should be one CompileSwiftSources task, which includes the ASan option, and which puts its output in a -asan directory.

0 commit comments

Comments
 (0)