Skip to content

Commit 6bea1b7

Browse files
cbrackendart-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 `timeline_macos.cc`. In the macOS 27 SDK that's part of Xcode 27, Apple appears to have added an `OS_LOG_UNINITIALIZED` macro inside their logging and signposting headers (`os/log.h`, `os/signpost.h`, `os/trace_base.h`). This macro expands to include: `__attribute__((stack_protector_ignore))`. Because of this, we skip stack protection checks on local formatting buffers generated by logging macros such as `os_log_with_type` and `os_signpost_event_emit`. However, in Flutter, we compile the engine with `-fstack-protector-all`, which causes the build to error out complaining 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, which is the same as the approach that was taken in runtime/vm/gbd_helpers.cc. Tested: Compiles under Xcode 26 and Xcode 27 Change-Id: I707584c66bb6cdae7d8ebcfd2a87344f43c618b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/512860 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent a0f809f commit 6bea1b7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎runtime/vm/timeline_macos.cc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include "vm/globals.h"
66
#if defined(DART_HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)
77

8+
#pragma GCC diagnostic push
9+
#pragma GCC diagnostic ignored "-Wignored-attributes"
10+
811
#include <os/signpost.h>
912

1013
#include "vm/log.h"
@@ -76,4 +79,6 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) {
7679

7780
} // namespace dart
7881

82+
#pragma GCC diagnostic pop
83+
7984
#endif // defined(DART_HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)

0 commit comments

Comments
 (0)