Revert "Check whether 64-bit atomic is supported"

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an 2024-06-29 09:34:59 +08:00 committed by Xiang Xiao
parent 5ad03c833f
commit ec150b21d9
2 changed files with 0 additions and 37 deletions

View File

@ -66,27 +66,6 @@ set(MACHINE ${CONFIG_ARCH})
set(CMAKE_SYSTEM_NAME NuttX)
set(WITH_DOC OFF)
# cmake-format: off
set(ATOMIC_TEST_CODE
[-[
#include <stdatomic.h>
int main() {
_Atomic long long x = 0;
return x;
}
]-]
)
# cmake-format: on
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_atomic.c ${ATOMIC_TEST_CODE})
try_compile(HAS_64BIT_ATOMIC_SUPPORT ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/test_atomic.c)
if(NOT HAS_64BIT_ATOMIC_SUPPORT)
add_compile_options(-DNO_ATOMIC_64_SUPPORT)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libmetal
${CMAKE_CURRENT_BINARY_DIR}/libmetal EXCLUDE_FROM_ALL)

View File

@ -56,20 +56,6 @@ CSRCS += libmetal/lib/version.c
CFLAGS += -DMETAL_INTERNAL
# Check whether the current toolchain supports 64-bit atomic
ATOMIC_DETECT_CODE := detect_64_atomic.c
ATOMIC_DETECT_BIN := detect_64_atomic_bin
DETECT_ATOMIC_SUPPORT = \
echo '\#include <stdatomic.h>' > $(ATOMIC_DETECT_CODE); \
echo 'int main() { _Atomic long long x = 0; return x; }' >> $(ATOMIC_DETECT_CODE); \
if $(CC) -o $(ATOMIC_DETECT_BIN) $(ATOMIC_DETECT_CODE) 2>/dev/null; then \
echo ""; \
else \
echo "-DNO_ATOMIC_64_SUPPORT"; \
fi; \
CFLAGS += $(shell $(DETECT_ATOMIC_SUPPORT))
LIBMETAL_HDRS_SEDEXP := \
"s/@PROJECT_VERSION_MAJOR@/0/g; \
s/@PROJECT_VERSION_MINOR@/1/g; \
@ -119,7 +105,5 @@ ifeq ($(wildcard libmetal/.git),)
$(call DELFILE, libmetal.zip)
endif
$(call DELFILE, .libmetal_headers)
$(call DELFILE, $(ATOMIC_DETECT_CODE))
$(call DELFILE, $(ATOMIC_DETECT_BIN))
endif