Skip to content

Commit 0d46c68

Browse files
crafcat7xiaoxiang781216
authored andcommitted
libxx:fix build error when enable LIBCXXTOOLCHAIN
Summary: P:➜ nuttx git:(4cec713) LC_ALL=C make CC: chip/stm32_gpio.c chip/stm32_gpio.c:41:11: note: '#pragma message: CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py' 41 | # pragma message "CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py" | ^~~~~~~ CXX: libcxxmini/libxx_new.cxx libcxxmini/libxx_new.cxx:72:11: error: redefinition of 'void* operator new(std::size_t, void*)' 72 | FAR void *operator new(std::size_t nbytes, FAR void *ptr) | ^~~~~~~~ In file included from /usr/include/newlib/c++/13.2.1/bits/atomic_base.h:36, from /usr/include/newlib/c++/13.2.1/atomic:41, from /home/leduc/wdc_workspace/src/autre/nuttx_dev/nuttx/include/nuttx/atomic.h:32, from /home/leduc/wdc_workspace/src/autre/nuttx_dev/nuttx/include/nuttx/fs/fs.h:38, from /home/leduc/wdc_workspace/src/autre/nuttx_dev/nuttx/include/nuttx/lib/lib.h:30, from libcxxmini/libxx_new.cxx:29: /usr/include/newlib/c++/13.2.1/new:174:33: note: 'void* operator new(std::size_t, void*)' previously defined here 174 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ make[1]: *** [Makefile:69: libxx_new.o] Error 1 make: *** [tools/LibTargets.mk:216: libs/libxx/libxx.a] Error 2 Signed-off-by: chenrun1 <[email protected]>
1 parent 0e8cf38 commit 0d46c68

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/libxx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if(CONFIG_HAVE_CXX)
3232
include(uClibc++.cmake)
3333
elseif(CONFIG_LIBCXX)
3434
include(libcxx.cmake)
35-
else()
35+
elseif(CONFIG_LIBCXXMINI)
3636
include(libcxxmini.cmake)
3737
endif()
3838

libs/libxx/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ ifeq ($(CONFIG_UCLIBCXX),y)
3333
include uClibc++.defs
3434
else ifeq ($(CONFIG_LIBCXX),y)
3535
include libcxx.defs
36-
else
36+
else ifeq ($(CONFIG_LIBCXXMINI),y)
3737
include libcxxmini.defs
38+
endif
39+
3840
ifeq ($(CONFIG_ETL),y)
3941
include etl.defs
4042
endif
41-
endif
4243

4344
ifeq ($(CONFIG_LIBCXXABI),y)
4445
include libcxxabi.defs

0 commit comments

Comments
 (0)