From 7a576ff05698cb1be121f6da0cd22f8e9aaa86b9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 19 Jan 2022 11:16:56 +0900 Subject: [PATCH] boards/sim/sim/sim/scripts/Make.defs: Disable libcxx availability macros --- boards/sim/sim/sim/scripts/Make.defs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index be3fc1f763..c8897d9fb9 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -122,6 +122,14 @@ ifeq ($(CONFIG_LIBCXX),y) # XXX what to do for windows? CXXFLAGS += -D__GLIBCXX__ endif + + # Disable availability macros. + # The availability on Host OS is not likely appropriate for NuttX. + # + # Note: When compiling NuttX apps, we undefine __APPLE__. + # It makes libcxx __availability header unhappy. + # https://github.com/llvm/llvm-project/blob/2e2999cd44f6ec9a5e396fa0113497ea82582f69/libcxx/include/__availability#L258 + CXXFLAGS += -D_LIBCPP_DISABLE_AVAILABILITY endif ifeq ($(CONFIG_SIM_ASAN),y)