Skip to content

Commit 918b93f

Browse files
cbrackenangle-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
Suppress warnings from macOS 27 logging macros
Suppress `-Wignored-attributes` triggered when compiling macOS-specific logging and tracing code in `debug.cpp`. In the macOS 27 SDK introduced with Xcode 27, Apple has applied an `OS_LOG_UNINITIALIZED` macro inside their logging and signposting headers (`os/log.h`, `os/signpost.h`, `os/trace_base.h`) which expands to include `__attribute__((stack_protector_ignore))`. Because of this, stack protection checks are skipped on local formatting buffers generated by logging macros such as `os_log_with_type` and `os_signpost_event_emit`. However, in Flutter (and likely other ANGLE users), we compile the engine with `-fstack-protector-all`, which causes the build to error out complaining that the `stack_protector_ignore` attribute is being ignored: error: 'stack_protector_ignore' attribute ignored due to '-fstack-protector-all' option [-Werror,-Wignored-attributes] This wraps these usages in ignore pragmas to avoid disabling it across the board. Bug: b/523963866 Change-Id: Iee87ccddb6dd469a230d7e39a957bb441c41e4a2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7930232 Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Charlie Lao <[email protected]> Auto-Submit: Chris Bracken <[email protected]> Commit-Queue: Geoff Lang <[email protected]>
1 parent 65ee1a4 commit 918b93f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/common/debug.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
#endif
2727

2828
#if defined(ANGLE_PLATFORM_APPLE)
29+
# pragma GCC diagnostic push
30+
# pragma GCC diagnostic ignored "-Wignored-attributes"
2931
# include <os/log.h>
32+
# pragma GCC diagnostic pop
3033
#endif
3134

3235
#if defined(ANGLE_PLATFORM_WINDOWS)
@@ -293,8 +296,11 @@ void Trace(LogSeverity severity, const char *message)
293296
default:
294297
UNREACHABLE();
295298
}
299+
# pragma GCC diagnostic push
300+
# pragma GCC diagnostic ignored "-Wignored-attributes"
296301
os_log_with_type(OS_LOG_DEFAULT, apple_log_type, "ANGLE: %s: %s\n",
297302
LogSeverityName(severity), str.c_str());
303+
# pragma GCC diagnostic pop
298304
#else
299305
// Note: we use fprintf because <iostream> includes static initializers.
300306
fprintf((severity >= LOG_WARN) ? stderr : stdout, "%s: %s\n", LogSeverityName(severity),

0 commit comments

Comments
 (0)