Simplify sanitizer builds when using Xcode. Instead of specifying a path to an xcconfig file from the Tools folder when building, use the ENABLE_*_SANITIZER Xcode variables to modify options during a build. This change is functionally equivalent to the old xcconfig files, except that WK_ASAN_DISALLOWED can't be used to disable ASan when building host-side tools. (Previously, the xcconfig files from Tools were the "layer" that turned on the ENABLE_*_SANITIZER macros, but this model assumes those macros are enabled in the `xcodebuild` command, which can't be overridden to my knowledge.) Also, in order to support overriding of the compiler optimization level, all GCC_OPTIMIZATION_LEVEL variables in Base.xcconfig files need to be changed to use GCC_OPTIMIZATION_LEVEL_OVERRIDE_NO instead, but a new style checker is introduced to remind folks when changing these variables. <rdar://98015260>
> This change is functionally equivalent to the old xcconfig files, except that WK_ASAN_DISALLOWED can't be used to disable ASan when building host-side tools. (Previously, the xcconfig files from Tools were the "layer" that turned on the ENABLE_*_SANITIZER macros, but this model assumes those macros are enabled in the `xcodebuild` command, which can't be overridden to my knowledge.) I need to check how `-useAddressSanitization` differs from `ENABLE_ADDRESS_SANITIZER=YES` when used on the xcodebuild command-line. It may be possible that the former doesn't override variables in xcconfig files, in which case WK_ASAN_DISALLOWED=YES can just be replaced with ENABLE_ADDRESS_SANITIZER=NO in xcconfig files.
I'm going to post an initial PR to get feedback, but I also still need to investigate Comment #1 and write two unit tests for the new BaseXcconfigChecker.
Pull request: https://github.com/WebKit/WebKit/pull/3811
(In reply to David Kilzer (:ddkilzer) from comment #1) > I need to check how `-useAddressSanitization` differs from > `ENABLE_ADDRESS_SANITIZER=YES` when used on the xcodebuild command-line. Unfortunately, the `-useAddressSanitization` switch can't be used in this context.
(In reply to David Kilzer (:ddkilzer) from comment #2) > I'm going to post an initial PR to get feedback, but I also still need to > investigate Comment #1 and write two unit tests for the new > BaseXcconfigChecker. Added unit tests. Posting new PR in a few minutes.
New PR posted: https://github.com/WebKit/WebKit/pull/3811
Committed 260654@main (5ee7a204c4e9): <https://commits.webkit.org/260654@main> Reviewed commits have been landed. Closing PR #3811 and removing active labels.
This caused a test-webkitpy test failure under some circumstances: Bug 252946: REGRESSION (260654@main): BaseXcconfigCheckerTest fails when not run from top-level folder <https://bugs.webkit.org/show_bug.cgi?id=252946>