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

pal.h will not build with clang 18 for x86 #101639

Closed
richlander opened this issue Apr 27, 2024 · 2 comments · Fixed by #101650
Closed

pal.h will not build with clang 18 for x86 #101639

richlander opened this issue Apr 27, 2024 · 2 comments · Fixed by #101650

Comments

@richlander
Copy link
Member

Builds with clang 16 but not clang 18. This is specific to 32-bit Linux.

  /__w/1/s/src/coreclr/pal/inc/pal.h:3605:5: error: __sync builtin operation MUST have natural alignment (consider using __atomic). [-Werror,-Wsync-alignment]
   3605 |     __sync_val_compare_and_swap(
        |     ^
  /__w/1/s/src/coreclr/pal/inc/pal.h:3471:5: error: __sync builtin operation MUST have natural alignment (consider using __atomic). [-Werror,-Wsync-alignment]
   3471 |     __sync_add_and_fetch(lpAddend, (LONGLONG)1)
        |     ^
  /__w/1/s/src/coreclr/pal/inc/pal.h:3506:5: error: __sync builtin operation MUST have natural alignment (consider using __atomic). [-Werror,-Wsync-alignment]
   3506 |     __sync_sub_and_fetch(lpAddend, (LONGLONG)1)
        |     ^
  3 errors generated.

#101630 (comment)

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 27, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 27, 2024
@am11 am11 added area-PAL-coreclr arch-x86 and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 27, 2024
@am11
Copy link
Member

am11 commented Apr 27, 2024

This diagnostic was added in https://reviews.llvm.org/D143813, it is looking for something like

-    InterlockedIncrement64(IN OUT LONGLONG volatile *lpAddend),
+    InterlockedIncrement64(IN OUT LONGLONG volatile *lpAddend DECLSPEC_ALIGN(8)),

@richlander
Copy link
Member Author

Looks like that change is in LLVM 17+. Thanks for the extra info.

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants