From 60db257e6990cd6f95f0e35e88a08b0cbb5455e7 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 16 Dec 2019 17:37:49 -0800 Subject: [PATCH] soc: intel_s1000: add dummy atexit() for Clang++ Add a dummy atexit() function when compiling C++ source files using Clang++. Signed-off-by: Daniel Leung --- soc/xtensa/intel_s1000/xcc/CMakeLists.txt | 1 + soc/xtensa/intel_s1000/xcc/cpp_fixes.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 soc/xtensa/intel_s1000/xcc/cpp_fixes.c diff --git a/soc/xtensa/intel_s1000/xcc/CMakeLists.txt b/soc/xtensa/intel_s1000/xcc/CMakeLists.txt index 7525c28a8f0..13ba2bd7930 100644 --- a/soc/xtensa/intel_s1000/xcc/CMakeLists.txt +++ b/soc/xtensa/intel_s1000/xcc/CMakeLists.txt @@ -1,3 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 +zephyr_library_sources_ifdef(CONFIG_CPLUSPLUS cpp_fixes.c) zephyr_library_sources_ifdef(CONFIG_NEWLIB_LIBC newlib_fixes.c) diff --git a/soc/xtensa/intel_s1000/xcc/cpp_fixes.c b/soc/xtensa/intel_s1000/xcc/cpp_fixes.c new file mode 100644 index 00000000000..2e840c7d3e4 --- /dev/null +++ b/soc/xtensa/intel_s1000/xcc/cpp_fixes.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2019, Intel Corporation. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#ifdef __clang__ + +int atexit(void (*function)(void)) +{ + return 0; +} + +#endif /* __clang__ */