-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[libc] Removed unused flags from baremetal cache files #168942
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
[libc] Removed unused flags from baremetal cache files #168942
Conversation
These flags are not needed for building libc.
|
@llvm/pr-subscribers-libc Author: Petr Hosek (petrhosek) ChangesThese flags are not needed for building libc. Full diff: https://github.com/llvm/llvm-project/pull/168942.diff 3 Files Affected:
diff --git a/libc/cmake/caches/armv6m-none-eabi.cmake b/libc/cmake/caches/armv6m-none-eabi.cmake
index 1f463ae5c0ead..d1d614655e557 100644
--- a/libc/cmake/caches/armv6m-none-eabi.cmake
+++ b/libc/cmake/caches/armv6m-none-eabi.cmake
@@ -2,7 +2,7 @@ set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
set(RUNTIMES_TARGET_TRIPLE "armv6m-none-eabi" CACHE STRING "")
foreach(lang C;CXX;ASM)
- set(CMAKE_${lang}_FLAGS "-march=armv6m -mcpu=cortex-m0plus -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
+ set(CMAKE_${lang}_FLAGS "-march=armv6m -mcpu=cortex-m0plus -mfloat-abi=soft -Wno-atomic-alignment" CACHE STRING "")
endforeach()
include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake)
diff --git a/libc/cmake/caches/armv7em-none-eabi.cmake b/libc/cmake/caches/armv7em-none-eabi.cmake
index afbe9c87dffe1..2b6df8fdf40ab 100644
--- a/libc/cmake/caches/armv7em-none-eabi.cmake
+++ b/libc/cmake/caches/armv7em-none-eabi.cmake
@@ -2,7 +2,7 @@ set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
set(RUNTIMES_TARGET_TRIPLE "armv7em-none-eabi" CACHE STRING "")
foreach(lang C;CXX;ASM)
- set(CMAKE_${lang}_FLAGS "-march=armv7em -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
+ set(CMAKE_${lang}_FLAGS "-march=armv7em -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment" CACHE STRING "")
endforeach()
include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake)
diff --git a/libc/cmake/caches/armv7m-none-eabi.cmake b/libc/cmake/caches/armv7m-none-eabi.cmake
index 796adb2f31148..fe76828fa529f 100644
--- a/libc/cmake/caches/armv7m-none-eabi.cmake
+++ b/libc/cmake/caches/armv7m-none-eabi.cmake
@@ -2,7 +2,7 @@ set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
set(RUNTIMES_TARGET_TRIPLE "armv7m-none-eabi" CACHE STRING "")
foreach(lang C;CXX;ASM)
- set(CMAKE_${lang}_FLAGS "-march=armv7m -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
+ set(CMAKE_${lang}_FLAGS "-march=armv7m -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment" CACHE STRING "")
endforeach()
include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake)
|
🐧 Linux x64 Test ResultsThe build succeeded and no tests ran. This is expected in some build configurations. |
|
|
||
| foreach(lang C;CXX;ASM) | ||
| set(CMAKE_${lang}_FLAGS "-march=armv6m -mcpu=cortex-m0plus -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "") | ||
| set(CMAKE_${lang}_FLAGS "-march=armv6m -mcpu=cortex-m0plus -mfloat-abi=soft -Wno-atomic-alignment" CACHE STRING "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bikeshedding a bit, but why do we need -Wno-atomic-alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because we use atomics for some internal API and there's no support unaligned accesses on Cortex-M0, but it's not a problem in practice because we don't do any unaligned accesses. We expect this will eventually get resolved by switching to TLS but we haven't had time to implement it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like clang shouldn't emit this warning for targets that don't support unaligned atomic accesses?
Not sure about the implementation (ie whether warnings can be target specific, how we would plumb information about the target, etc).
These flags are not needed for building libc.
These flags are not needed for building libc.
These flags are not needed for building libc.