Skip to content

Commit c704557

Browse files
committed
Add new libcxx flag for disabling container overflow checks
libcxx changed the name of the macro used to include sanitizer container annotations. We should add the new flag name to maintain current behavior. Sanitizer container overflow checks are prone to false positives, so we default to disabling these on xcode projects. rdar://149350723
1 parent 382cc20 commit c704557

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)