Skip to content

Fall back to [[clang::no_sanitize("hwaddress")]] for HWASan on Clang < 21. - #1932

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1023287149
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1023287149

Conversation

@copybara-service

Copy link
Copy Markdown

Fall back to [[clang::no_sanitize("hwaddress")]] for HWASan on Clang < 21.

Clang added the [[gnu::no_sanitize(...)]] spelling in Clang 21, while supporting [[clang::no_sanitize(...)]] in earlier releases. Without checking clang::no_sanitize, Clang 20 and earlier fall back to GNU __attribute__((no_sanitize("hwaddress"))) for ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS under HWASan, which fails to compile when stacked before [[clang::no_sanitize_memory]] on a class member function.

Also move ABSL_ATTRIBUTE_NOINLINE after ABSL_ATTRIBUTE_NO_SANITIZE_* in stacktrace_aarch64-inl.inc (matching stacktrace_x86-inl.inc) so C++11 [[...]] attributes precede GNU __attribute__((noinline)).

…< 21.

Clang added the `[[gnu::no_sanitize(...)]]` spelling in Clang 21, while supporting `[[clang::no_sanitize(...)]]` in earlier releases. Without checking `clang::no_sanitize`, Clang 20 and earlier fall back to GNU `__attribute__((no_sanitize("hwaddress")))` for `ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS` under HWASan, which fails to compile when stacked before `[[clang::no_sanitize_memory]]` on a class member function.

Also move `ABSL_ATTRIBUTE_NOINLINE` after `ABSL_ATTRIBUTE_NO_SANITIZE_*` in `stacktrace_aarch64-inl.inc` (matching `stacktrace_x86-inl.inc`) so C++11 `[[...]]` attributes precede GNU `__attribute__((noinline))`.

PiperOrigin-RevId: 1023287149
@google-cla

google-cla Bot commented Nov 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants