Bug 244540
| Summary: | [Xcode] Simplify sanitizer builds | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | WebCore Misc. | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ap, emw, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=271055 | ||
| Bug Depends on: | |||
| Bug Blocks: | 252946, 272481 | ||
David Kilzer (:ddkilzer)
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>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
> 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.
David Kilzer (:ddkilzer)
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.
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/3811
David Kilzer (:ddkilzer)
(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.
David Kilzer (:ddkilzer)
(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.
David Kilzer (:ddkilzer)
New PR posted: https://github.com/WebKit/WebKit/pull/3811
EWS
Committed 260654@main (5ee7a204c4e9): <https://commits.webkit.org/260654@main>
Reviewed commits have been landed. Closing PR #3811 and removing active labels.
David Kilzer (:ddkilzer)
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>