Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d4fbad5cfc5da35ff3d3f86834eb4f8089984585
https://github.com/WebKit/WebKit/commit/d4fbad5cfc5da35ff3d3f86834eb4f8089984585
Author: David Kilzer <[email protected]>
Date: 2026-08-31 (Mon, 31 Aug 2026)
Changed paths:
M Configurations/CommonBase.xcconfig
M Source/JavaScriptCore/Configurations/Base.xcconfig
M Source/ThirdParty/ANGLE/src/common/SimpleMutex.h
M Source/ThirdParty/ANGLE/src/common/angleutils.h
M Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp
M Source/ThirdParty/ANGLE/src/libANGLE/ContextMutex.cpp
M Source/ThirdParty/ANGLE/src/libANGLE/GlobalMutex.cpp
M Source/ThirdParty/gmock/Configurations/Base.xcconfig
M Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig
M Source/WTF/Configurations/Base.xcconfig
M Source/WebCore/Configurations/Base.xcconfig
M Source/WebCore/PAL/Configurations/Base.xcconfig
M Source/WebGPU/Configurations/Base.xcconfig
M Source/WebInspectorUI/Configurations/Base.xcconfig
M Source/WebKit/Configurations/Base.xcconfig
M Source/WebKitLegacy/mac/Configurations/Base.xcconfig
M Source/bmalloc/Configurations/Base.xcconfig
Log Message:
-----------
[Cocoa] Apply -Wthread-safety to all Xcode targets via CommonBase.xcconfig
<https://bugs.webkit.org/show_bug.cgi?id=323013>
<rdar://186279308>
Reviewed by Elliott Williams and Keith Miller.
The CMake build enables -Wthread-safety globally on Cocoa ports
(320158@main), so third-party targets such as ANGLE and gtest are built
with it as a superset. The Xcode build set -Wthread-safety per project,
which left those third-party targets uncovered and duplicated the flag
across a dozen configuration files.
Add -Wthread-safety to WK_COMMON_WARNING_CFLAGS in CommonBase.xcconfig,
which every target that includes CommonBase inherits, and drop the
now-redundant per-project copies. This matches the CMake build's global
flag and extends coverage to ANGLE and gtest.
-Wthread-safety diagnoses any code that manipulates a thread-safety
capability, including the annotated libc++ std::mutex that ANGLE's mutex
wrappers hold. Add three macros to angleutils.h: ANGLE_ACQUIRE_CAPABILITY
and ANGLE_RELEASE_CAPABILITY for functions that unconditionally acquire
or release a mutex, and ANGLE_NO_THREAD_SAFETY_ANALYSIS for functions
whose conditional, recursive, or root-delegating locking the analysis
cannot model.
Annotate angle::priv::MutexOnStd's forwarding lock() and unlock() with
the acquire/release attributes. egl::priv::GlobalMutex uses
ANGLE_NO_THREAD_SAFETY_ANALYSIS on every variant: its recursive variant
locks conditionally, and its three build-time variants must present one
interface. ContextMutex's tryLockImpl(), lockImpl(), and unlockImpl(),
which unlock and re-lock the stable-root mutex, and ErrorSet's
getLockIfNotAlready(), which transfers ownership into a returned
std::unique_lock, use it for the same reason. This mirrors
WTF::RecursiveLockAdapter, which opts the same conditional-locking shapes
out of the analysis. gtest has no such code and is unaffected. dav1d
keeps its own copy because it does not include CommonBase.xcconfig.
No new tests since no change in behavior.
* Configurations/CommonBase.xcconfig:
* Source/JavaScriptCore/Configurations/Base.xcconfig:
* Source/ThirdParty/ANGLE/src/common/SimpleMutex.h:
* Source/ThirdParty/ANGLE/src/common/angleutils.h:
* Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp:
* Source/ThirdParty/ANGLE/src/libANGLE/ContextMutex.cpp:
* Source/ThirdParty/ANGLE/src/libANGLE/GlobalMutex.cpp:
* Source/ThirdParty/gmock/Configurations/Base.xcconfig:
* Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig:
* Source/WTF/Configurations/Base.xcconfig:
* Source/WebCore/Configurations/Base.xcconfig:
* Source/WebCore/PAL/Configurations/Base.xcconfig:
* Source/WebGPU/Configurations/Base.xcconfig:
* Source/WebInspectorUI/Configurations/Base.xcconfig:
* Source/WebKit/Configurations/Base.xcconfig:
* Source/WebKitLegacy/mac/Configurations/Base.xcconfig:
* Source/bmalloc/Configurations/Base.xcconfig:
Canonical link: https://commits.webkit.org/320220@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications