Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tsan] Fix alignas specifier in tsan_platform_mac.cpp #99252

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Jul 16, 2024

Placing the alignas specifier after the declaration causes the following:

error: 'alignas' attribute cannot be applied to types

Breakages can be seen at:
https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-mac-x64/b8742225171944684321/overview
https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8742225171944684321/+/u/clang/install/stdout

This patch corrects the placement, which follows the convention and
style of other alignas directives in compiler-rt.

Created using spr 1.3.4
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 16, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Paul Kirth (ilovepi)

Changes

Placing the alignas specifier after the declaration causes the following:

error: 'alignas' attribute cannot be applied to types

Breakages can be seen at:
https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-mac-x64/b8742225171944684321/overview
https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8742225171944684321/+/u/clang/install/stdout

This patch corrects the placement, which follows the convention and
style of other alignas directives in compiler-rt.


Full diff: https://github.com/llvm/llvm-project/pull/99252.diff

1 Files Affected:

  • (modified) compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp (+3-3)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
index c8a66e60a69f1..6add1e8fc27b8 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
@@ -45,9 +45,9 @@
 
 namespace __tsan {
 
-#if !SANITIZER_GO
-static char main_thread_state[sizeof(ThreadState)] alignas(
-    SANITIZER_CACHE_LINE_SIZE);
+#  if !SANITIZER_GO
+alignas(SANITIZER_CACHE_LINE_SIZE) static char main_thread_state[sizeof(
+    ThreadState)];
 static ThreadState *dead_thread_state;
 static pthread_key_t thread_state_key;
 

@ilovepi
Copy link
Contributor Author

ilovepi commented Jul 16, 2024

Didn't see: 898c116, so I'm closing.

@ilovepi ilovepi closed this Jul 16, 2024
@ilovepi ilovepi deleted the users/ilovepi/spr/tsan-fix-alignas-specifier-in-tsan_platform_maccpp branch July 16, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants