Skip to content

[libc] Remove atomic alignment diagnostics globally #96803

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

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m-unknown-eabi)
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
foreach(lang C;CXX;ASM)
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb -Wno-atomic-alignment" CACHE STRING "")
endforeach()
foreach(type SHARED;MODULE;EXE)
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
Expand Down
6 changes: 0 additions & 6 deletions libc/src/stdlib/rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

namespace LIBC_NAMESPACE {

// Silence warnings on targets with slow atomics.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-alignment"

// An implementation of the xorshift64star pseudo random number generator. This
// is a good general purpose generator for most non-cryptographics applications.
LLVM_LIBC_FUNCTION(int, rand, (void)) {
Expand All @@ -33,6 +29,4 @@ LLVM_LIBC_FUNCTION(int, rand, (void)) {
}
}

#pragma GCC diagnostic pop

} // namespace LIBC_NAMESPACE
6 changes: 0 additions & 6 deletions libc/src/stdlib/srand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@

namespace LIBC_NAMESPACE {

// Silence warnings on targets with slow atomics.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-alignment"

LLVM_LIBC_FUNCTION(void, srand, (unsigned int seed)) {
rand_next.store(seed, cpp::MemoryOrder::RELAXED);
}

#pragma GCC diagnostic pop

} // namespace LIBC_NAMESPACE
Loading