Bug 312514
| Summary: | [CMake] Add mac-asan preset and fix sanitizer link flags | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zak ridouh <zakr> |
| Component: | CMake | Assignee: | zak ridouh <zakr> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 312071 | ||
| Bug Blocks: | |||
zak ridouh
Add a mac-asan CMake preset for AddressSanitizer builds and fix two
pre-existing bugs that prevented ENABLE_SANITIZERS from working on the
Mac port.
The mac-asan preset uses RelWithDebInfo (optimized + debuggable), enables
ENABLE_SANITIZERS=address, and inherits dev settings (ccache,
compile_commands).
OptionsMac.cmake now mirrors Configurations/Sanitizers.xcconfig by adding
-fsanitize-address-use-after-return=never (disables ASan's fake stack
which breaks JSC garbage collection) and -DRELEASE_WITHOUT_OPTIMIZATIONS
(prevents ALWAYS_INLINE from defeating sanitizer instrumentation). Both
flags are gated to exclude Swift compilation and linking.
Fix unquoted CMAKE_SHARED_LINKER_FLAGS appends in WebKit and
WebKitLegacy PlatformMac.cmake. Without quotes, CMake treats the
expansion as a list, inserting a literal semicolon into the generated
Ninja link command, which the shell interprets as a command separator.
This was latent when CMAKE_SHARED_LINKER_FLAGS was empty but breaks any
build that populates it (e.g. ENABLE_SANITIZERS).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/174956971>
zak ridouh
Pull request: https://github.com/WebKit/WebKit/pull/62926
EWS
Committed 311472@main (2dbae6f74c8d): <https://commits.webkit.org/311472@main>
Reviewed commits have been landed. Closing PR #62926 and removing active labels.