trns1997 commented on PR #11269:
URL: https://github.com/apache/nuttx/pull/11269#issuecomment-1830507448

   > The porting is not completly finished, mainly because I didn't try with 
older version of the lib and I was focused on the missing symbols bug.
   > 
   > Hereafter a patch with the modifications:
   > 
   > ```
   > diff --git a/libs/libxx/__config_site b/libs/libxx/__config_site
   > index 8662a132f0..9131580ad5 100644
   > --- a/libs/libxx/__config_site
   > +++ b/libs/libxx/__config_site
   > @@ -9,10 +9,6 @@
   >  #ifndef _LIBCPP___CONFIG_SITE
   >  #define _LIBCPP___CONFIG_SITE
   >  
   > -/* The following is generated from include/__config_site.in
   > - * in Ubunutu 22.0.4 with g++ 11.3.0.
   > - */
   > -
   >  #define _LIBCPP_ABI_VERSION 1
   >  #define _LIBCPP_ABI_NAMESPACE __1
   >  /* #undef _LIBCPP_ABI_FORCE_ITANIUM */
   > @@ -23,18 +19,24 @@
   >  /* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */
   >  /* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */
   >  /* #undef _LIBCPP_HAS_THREAD_API_WIN32 */
   > -/* #undef _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL */
   >  /* #undef _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS */
   >  #define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
   >  /* #undef _LIBCPP_NO_VCRUNTIME */
   >  /* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */
   > -/* #undef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY */
   > -/* #undef _LIBCPP_HAS_PARALLEL_ALGORITHMS */
   > +/* #undef _LIBCPP_HAS_NO_FILESYSTEM */
   >  /* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */
   >  /* #undef _LIBCPP_HAS_NO_LOCALIZATION */
   >  /* #undef _LIBCPP_HAS_NO_WIDE_CHARACTERS */
   > -#define _LIBCPP_ENABLE_ASSERTIONS_DEFAULT 0
   > -/* #undef _LIBCPP_ENABLE_DEBUG_MODE */
   > +#define _LIBCPP_HAS_NO_STD_MODULES
   > +/* #undef _LIBCPP_HAS_NO_TIME_ZONE_DATABASE */
   > +
   > +// PSTL backends
   > +#define _LIBCPP_PSTL_CPU_BACKEND_SERIAL
   > +/* #undef _LIBCPP_PSTL_CPU_BACKEND_THREAD */
   > +/* #undef _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH */
   > +
   > +// Hardening.
   > +#define _LIBCPP_HARDENING_MODE_DEFAULT 2
   >  
   >  // __USE_MINGW_ANSI_STDIO gets redefined on MinGW
   >  #ifdef __clang__
   > diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs
   > index 9d5922ff93..937c1969fa 100644
   > --- a/libs/libxx/libcxx.defs
   > +++ b/libs/libxx/libcxx.defs
   > @@ -46,6 +46,11 @@ ifeq ($(wildcard libcxx/.git),)
   >  endif
   >  
   >  CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY
   > +
   > +CXXFLAGS += ${DEFINE_PREFIX}__STDC_CONSTANT_MACROS
   > +CXXFLAGS += ${DEFINE_PREFIX}__STDC_FORMAT_MACROS
   > +CXXFLAGS += ${DEFINE_PREFIX}__STDC_LIMIT_MACROS
   > +
   >  CXXFLAGS += ${INCDIR_PREFIX}$(CURDIR)/libcxx/src
   >  
   >  ifeq ($(CONFIG_LIBSUPCXX), y)
   > @@ -139,3 +144,5 @@ endif
   >  CPPSRCS += $(wildcard libcxx/src/*.cpp)
   >  CPPSRCS += $(wildcard libcxx/src/experimental/*.cpp)
   >  CPPSRCS += $(wildcard libcxx/src/filesystem/*.cpp)
   > +CPPSRCS += $(wildcard libcxx/src/ryu/*.cpp)
   > +
   > ```
   
   This patch is correct but there is a small bug. When I activate the 
following options in any board:
   ```
   CONFIG_LIBCXX=y
   CONFIG_LIBCXX_VERSION="17.0.5
   ```
   
   I get the following error:
   ```
   ➜  nuttx git:(master) ✗ ./tools/configure.sh -E -l stm32f411e-disco:nsh && 
make -j8 
   make: Entering directory '/home/thomas/nuttxspace/nuttx'
   make: Leaving directory '/home/thomas/nuttxspace/nuttx'
     Copy files
     Select CONFIG_HOST_LINUX=y
     Refreshing...
   CP: arch/dummy/Kconfig to 
/home/thomas/nuttxspace/nuttx/arch/dummy/dummy_kconfig
   CP: boards/dummy/Kconfig to 
/home/thomas/nuttxspace/nuttx/boards/dummy/dummy_kconfig
   LN: platform/board to /home/thomas/nuttxspace/apps/platform/dummy
   LN: include/arch to arch/arm/include
   LN: include/arch/board to 
/home/thomas/nuttxspace/nuttx/boards/arm/stm32/stm32f411e-disco/include
   LN: drivers/platform to /home/thomas/nuttxspace/nuttx/drivers/dummy
   LN: include/arch/chip to /home/thomas/nuttxspace/nuttx/arch/arm/include/stm32
   LN: arch/arm/src/chip to /home/thomas/nuttxspace/nuttx/arch/arm/src/stm32
   LN: arch/arm/src/board to 
/home/thomas/nuttxspace/nuttx/boards/arm/stm32/stm32f411e-disco/../common
   LN: arch/arm/src/board/board to 
/home/thomas/nuttxspace/nuttx/boards/arm/stm32/stm32f411e-disco/src
   mkkconfig in /home/thomas/nuttxspace/apps/examples/mcuboot
   mkkconfig in /home/thomas/nuttxspace/apps/examples
   mkkconfig in /home/thomas/nuttxspace/apps/crypto
   mkkconfig in /home/thomas/nuttxspace/apps/audioutils
   mkkconfig in /home/thomas/nuttxspace/apps/logging
   mkkconfig in /home/thomas/nuttxspace/apps/system
   mkkconfig in /home/thomas/nuttxspace/apps/boot
   mkkconfig in /home/thomas/nuttxspace/apps/fsutils
   mkkconfig in /home/thomas/nuttxspace/apps/benchmarks
   mkkconfig in /home/thomas/nuttxspace/apps/math
   mkkconfig in /home/thomas/nuttxspace/apps/interpreters/luamodules
   mkkconfig in /home/thomas/nuttxspace/apps/interpreters
   mkkconfig in /home/thomas/nuttxspace/apps/lte
   mkkconfig in /home/thomas/nuttxspace/apps/testing
   mkkconfig in /home/thomas/nuttxspace/apps/mlearning
   mkkconfig in /home/thomas/nuttxspace/apps/graphics
   mkkconfig in /home/thomas/nuttxspace/apps/netutils
   mkkconfig in /home/thomas/nuttxspace/apps/sdr
   mkkconfig in /home/thomas/nuttxspace/apps/canutils
   mkkconfig in /home/thomas/nuttxspace/apps/inertial
   mkkconfig in /home/thomas/nuttxspace/apps/wireless/ieee802154
   mkkconfig in /home/thomas/nuttxspace/apps/wireless/bluetooth
   mkkconfig in /home/thomas/nuttxspace/apps/wireless
   mkkconfig in /home/thomas/nuttxspace/apps/games
   mkkconfig in /home/thomas/nuttxspace/apps/industry
   mkkconfig in /home/thomas/nuttxspace/apps
   Loaded configuration '.config'
   Configuration saved to '.config'
   Create version.h
   Downloading: libcxx-17.0.5.src.tar.xz LN: platform/board to 
/home/thomas/nuttxspace/apps/platform/dummy
   Register: nsh
   Register: sh
   CXX:  libcxx/src/memory_resource.cpp In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__string/char_traits.h:29,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string_view:221,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__format/format_parse_context.h:16,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__format/concepts.h:17,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__thread/formatter.h:15,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/thread:92,
                    from libcxx/src/barrier.cpp:14:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   CXX:  libcxx/src/functional.cpp In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/remove.h:12,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string:569,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/error_category.h:15,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/system_error.h:14,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__mutex/unique_lock.h:17,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__condition_variable/condition_variable.h:17,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/mutex:192,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__memory_resource/synchronized_pool_resource.h:18,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/memory_resource:57,
                    from libcxx/src/memory_resource.cpp:10:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   CXX:  libcxx/src/thread.cpp In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/algorithm:1761,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/array:547,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__functional/boyer_moore_searcher.h:25,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/functional:526,
                    from libcxx/src/functional.cpp:9:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/remove.h:12,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string:569,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/error_category.h:15,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/future:380,
                    from libcxx/src/thread.cpp:16:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   CXX:  libcxx/src/ios.instantiations.cpp In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/remove.h:12,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string:569,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/error_category.h:15,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/system_error.h:14,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__mutex/unique_lock.h:17,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__condition_variable/condition_variable.h:17,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/mutex:192,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__locale:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/fstream:187,
                    from libcxx/src/ios.instantiations.cpp:10:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   make[1]: *** [Makefile:72: libcxx/src/memory_resource.o] Error 1
   make[1]: *** Waiting for unfinished jobs....
   make[1]: *** [Makefile:72: libcxx/src/barrier.o] Error 1
   make[1]: *** [Makefile:72: libcxx/src/functional.o] Error 1
   make[1]: *** [Makefile:72: libcxx/src/thread.o] Error 1
   make[1]: *** [Makefile:72: libcxx/src/ios.instantiations.o] Error 1
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/remove.h:12,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string:569,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/error_category.h:15,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/system_error.h:14,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__mutex/unique_lock.h:17,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__condition_variable/condition_variable.h:17,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/mutex:192,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__memory_resource/synchronized_pool_resource.h:18,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/memory_resource:57,
                    from ./libcxx/src/memory_resource.cpp:10:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__string/char_traits.h:29,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string_view:221,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__format/format_parse_context.h:16,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__format/concepts.h:17,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__thread/formatter.h:15,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/thread:92,
                    from ./libcxx/src/barrier.cpp:14:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   ERROR: arm-none-eabi-g++ failed: 1
          command: arm-none-eabi-g++ -MT ./memory_resource.o  -M '-nostdinc++' 
'-Wno-attributes' '-Wno-unknown-pragmas' '-Wno-psabi' '-std=gnu++20' 
'-fno-exceptions' '-fcheck-new' '-fno-rtti' '-Os' '-fno-strict-aliasing' 
'-fomit-frame-pointer' '--param=min-pagesize=0' '-fno-common' '-Wall' 
'-Wshadow' '-Wundef' '-ffunction-sections' '-fdata-sections' '-mlittle-endian' 
'-march=armv7e-m' '-mtune=cortex-m4' '-mfloat-abi=soft' '-mthumb' '-Wa,-mthumb' 
'-Wa,-mimplicit-it=always' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include/libcxx' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' 
'-pipe' '-D_LIBCPP_BUILDING_LIBRARY' '-I' 
'/home/thomas/nuttxspace/nuttx/libs/libxx/libcxx/src' '-D__GLIBCXX__' 
./libcxx/src/memory_resource.cpp
   make[2]: *** [/home/thomas/nuttxspace/nuttx/tools/Config.mk:231: 
libcxx/src/memory_resource.ddp] Error 1
   make[2]: *** Waiting for unfinished jobs....
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/algorithm:1761,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/array:547,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__functional/boyer_moore_searcher.h:25,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/functional:526,
                    from ./libcxx/src/functional.cpp:9:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   ERROR: arm-none-eabi-g++ failed: 1
          command: arm-none-eabi-g++ -MT ./barrier.o  -M '-nostdinc++' 
'-Wno-attributes' '-Wno-unknown-pragmas' '-Wno-psabi' '-std=gnu++20' 
'-fno-exceptions' '-fcheck-new' '-fno-rtti' '-Os' '-fno-strict-aliasing' 
'-fomit-frame-pointer' '--param=min-pagesize=0' '-fno-common' '-Wall' 
'-Wshadow' '-Wundef' '-ffunction-sections' '-fdata-sections' '-mlittle-endian' 
'-march=armv7e-m' '-mtune=cortex-m4' '-mfloat-abi=soft' '-mthumb' '-Wa,-mthumb' 
'-Wa,-mimplicit-it=always' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include/libcxx' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' 
'-pipe' '-D_LIBCPP_BUILDING_LIBRARY' '-I' 
'/home/thomas/nuttxspace/nuttx/libs/libxx/libcxx/src' '-D__GLIBCXX__' 
./libcxx/src/barrier.cpp
   make[2]: *** [/home/thomas/nuttxspace/nuttx/tools/Config.mk:231: 
libcxx/src/barrier.ddp] Error 1
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/remove.h:12,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string:569,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/error_category.h:15,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/system_error.h:14,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__mutex/unique_lock.h:17,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__condition_variable/condition_variable.h:17,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/mutex:192,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__locale:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/fstream:187,
                    from ./libcxx/src/ios.instantiations.cpp:10:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/find.h:21,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__algorithm/remove.h:12,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/string:569,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__system_error/error_category.h:15,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/future:380,
                    from ./libcxx/src/thread.cpp:16:
   /home/thomas/nuttxspace/nuttx/include/libcxx/cwchar:117:5: error: #error 
<cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. 
This usually means that your header search paths are not configured properly. 
The header search paths should contain the C++ Standard Library headers before 
any C Standard Library, and you are probably using compiler flags that make 
that not be the case.
     117 | #   error <cwchar> tried including <wchar.h> but didn't find 
libc++'s <wchar.h> header. \
         |     ^~~~~
   ERROR: arm-none-eabi-g++ failed: 1
          command: arm-none-eabi-g++ -MT ./functional.o  -M '-nostdinc++' 
'-Wno-attributes' '-Wno-unknown-pragmas' '-Wno-psabi' '-std=gnu++20' 
'-fno-exceptions' '-fcheck-new' '-fno-rtti' '-Os' '-fno-strict-aliasing' 
'-fomit-frame-pointer' '--param=min-pagesize=0' '-fno-common' '-Wall' 
'-Wshadow' '-Wundef' '-ffunction-sections' '-fdata-sections' '-mlittle-endian' 
'-march=armv7e-m' '-mtune=cortex-m4' '-mfloat-abi=soft' '-mthumb' '-Wa,-mthumb' 
'-Wa,-mimplicit-it=always' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include/libcxx' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' 
'-pipe' '-D_LIBCPP_BUILDING_LIBRARY' '-I' 
'/home/thomas/nuttxspace/nuttx/libs/libxx/libcxx/src' '-D__GLIBCXX__' 
./libcxx/src/functional.cpp
   make[2]: *** [/home/thomas/nuttxspace/nuttx/tools/Config.mk:231: 
libcxx/src/functional.ddp] Error 1
   ERROR: arm-none-eabi-g++ failed: 1
          command: arm-none-eabi-g++ -MT ./ios.instantiations.o  -M 
'-nostdinc++' '-Wno-attributes' '-Wno-unknown-pragmas' '-Wno-psabi' 
'-std=gnu++20' '-fno-exceptions' '-fcheck-new' '-fno-rtti' '-Os' 
'-fno-strict-aliasing' '-fomit-frame-pointer' '--param=min-pagesize=0' 
'-fno-common' '-Wall' '-Wshadow' '-Wundef' '-ffunction-sections' 
'-fdata-sections' '-mlittle-endian' '-march=armv7e-m' '-mtune=cortex-m4' 
'-mfloat-abi=soft' '-mthumb' '-Wa,-mthumb' '-Wa,-mimplicit-it=always' 
'-isystem' '/home/thomas/nuttxspace/nuttx/include/libcxx' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' 
'-pipe' '-D_LIBCPP_BUILDING_LIBRARY' '-I' 
'/home/thomas/nuttxspace/nuttx/libs/libxx/libcxx/src' '-D__GLIBCXX__' 
./libcxx/src/ios.instantiations.cpp
   make[2]: *** [/home/thomas/nuttxspace/nuttx/tools/Config.mk:231: 
libcxx/src/ios.instantiations.ddp] Error 1
   ERROR: arm-none-eabi-g++ failed: 1
          command: arm-none-eabi-g++ -MT ./thread.o  -M '-nostdinc++' 
'-Wno-attributes' '-Wno-unknown-pragmas' '-Wno-psabi' '-std=gnu++20' 
'-fno-exceptions' '-fcheck-new' '-fno-rtti' '-Os' '-fno-strict-aliasing' 
'-fomit-frame-pointer' '--param=min-pagesize=0' '-fno-common' '-Wall' 
'-Wshadow' '-Wundef' '-ffunction-sections' '-fdata-sections' '-mlittle-endian' 
'-march=armv7e-m' '-mtune=cortex-m4' '-mfloat-abi=soft' '-mthumb' '-Wa,-mthumb' 
'-Wa,-mimplicit-it=always' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include/libcxx' '-isystem' 
'/home/thomas/nuttxspace/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' 
'-pipe' '-D_LIBCPP_BUILDING_LIBRARY' '-I' 
'/home/thomas/nuttxspace/nuttx/libs/libxx/libcxx/src' '-D__GLIBCXX__' 
./libcxx/src/thread.cpp
   make[2]: *** [/home/thomas/nuttxspace/nuttx/tools/Config.mk:231: 
libcxx/src/thread.ddp] Error 1
   make[1]: *** [Makefile:84: .depend] Error 2
   make: *** [tools/Unix.mk:611: pass2dep] Error 2
   make: *** Waiting for unfinished jobs....
   make: *** [tools/LibTargets.mk:216: libs/libxx/libxx.a] Error 2
   ```
   
   But after playing around with the options i figured out that adding 
`CONFIG_LIBM=y` to the defconfig the compilation is successful.
   ```
   ➜  nuttx git:(master) ✗ ./tools/configure.sh -E -l stm32f411e-disco:nsh && 
make -j8 
   make: Entering directory '/home/thomas/nuttxspace/nuttx'
   make: Leaving directory '/home/thomas/nuttxspace/nuttx'
     Copy files
     Select CONFIG_HOST_LINUX=y
     Refreshing...
   CP: arch/dummy/Kconfig to 
/home/thomas/nuttxspace/nuttx/arch/dummy/dummy_kconfig
   CP: boards/dummy/Kconfig to 
/home/thomas/nuttxspace/nuttx/boards/dummy/dummy_kconfig
   LN: platform/board to /home/thomas/nuttxspace/apps/platform/dummy
   LN: include/arch to arch/arm/include
   LN: include/arch/board to 
/home/thomas/nuttxspace/nuttx/boards/arm/stm32/stm32f411e-disco/include
   LN: drivers/platform to /home/thomas/nuttxspace/nuttx/drivers/dummy
   LN: include/arch/chip to /home/thomas/nuttxspace/nuttx/arch/arm/include/stm32
   LN: arch/arm/src/chip to /home/thomas/nuttxspace/nuttx/arch/arm/src/stm32
   LN: arch/arm/src/board to 
/home/thomas/nuttxspace/nuttx/boards/arm/stm32/stm32f411e-disco/../common
   LN: arch/arm/src/board/board to 
/home/thomas/nuttxspace/nuttx/boards/arm/stm32/stm32f411e-disco/src
   mkkconfig in /home/thomas/nuttxspace/apps/examples/mcuboot
   mkkconfig in /home/thomas/nuttxspace/apps/examples
   mkkconfig in /home/thomas/nuttxspace/apps/crypto
   mkkconfig in /home/thomas/nuttxspace/apps/audioutils
   mkkconfig in /home/thomas/nuttxspace/apps/logging
   mkkconfig in /home/thomas/nuttxspace/apps/system
   mkkconfig in /home/thomas/nuttxspace/apps/boot
   mkkconfig in /home/thomas/nuttxspace/apps/fsutils
   mkkconfig in /home/thomas/nuttxspace/apps/benchmarks
   mkkconfig in /home/thomas/nuttxspace/apps/math
   mkkconfig in /home/thomas/nuttxspace/apps/interpreters/luamodules
   mkkconfig in /home/thomas/nuttxspace/apps/interpreters
   mkkconfig in /home/thomas/nuttxspace/apps/lte
   mkkconfig in /home/thomas/nuttxspace/apps/testing
   mkkconfig in /home/thomas/nuttxspace/apps/mlearning
   mkkconfig in /home/thomas/nuttxspace/apps/graphics
   mkkconfig in /home/thomas/nuttxspace/apps/netutils
   mkkconfig in /home/thomas/nuttxspace/apps/sdr
   mkkconfig in /home/thomas/nuttxspace/apps/canutils
   mkkconfig in /home/thomas/nuttxspace/apps/inertial
   mkkconfig in /home/thomas/nuttxspace/apps/wireless/ieee802154
   mkkconfig in /home/thomas/nuttxspace/apps/wireless/bluetooth
   mkkconfig in /home/thomas/nuttxspace/apps/wireless
   mkkconfig in /home/thomas/nuttxspace/apps/games
   mkkconfig in /home/thomas/nuttxspace/apps/industry
   mkkconfig in /home/thomas/nuttxspace/apps
   Loaded configuration '.config'
   Configuration saved to '.config'
   Create version.h
   Downloading: libcxx-17.0.5.src.tar.xz LN: platform/board to 
/home/thomas/nuttxspace/apps/platform/dummy
   Register: nsh
   Register: sh
   CXX:  libcxx/src/ios.cpp libcxx/src/string.cpp:58:33: warning: 
'template<class _CharT> struct std::__1::char_traits' is deprecated: 
char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t 
is non-standard and is provided for a temporary period. It will be removed in 
LLVM 18, so please migrate off of it. [-Wdeprecated-declarations]
      58 | template string operator+<char, char_traits<char>, 
allocator<char>>(char const*, string const&);
         |                                 ^~~~~~~~~~~
   In file included from 
/home/thomas/nuttxspace/nuttx/include/libcxx/__fwd/fstream.h:13,
                    from /home/thomas/nuttxspace/nuttx/include/libcxx/iosfwd:99,
                    from 
/home/thomas/nuttxspace/nuttx/include/libcxx/charconv:99,
                    from libcxx/src/string.cpp:11:
   /home/thomas/nuttxspace/nuttx/include/libcxx/__fwd/string.h:23:29: note: 
declared here
      23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
         |                             ^~~~~~~~~~~
   In file included from libcxx/src/filesystem/path.cpp:14:
   libcxx/src/filesystem/path_parser.h: In constructor 
'std::__1::__fs::filesystem::parser::PathParser::PathParser(std::__1::__fs::filesystem::parser::string_view_t,
 ParserState)':
   libcxx/src/filesystem/path_parser.h:58:43: warning: declaration of 'State' 
shadows a member of 'std::__1::__fs::filesystem::parser::PathParser' [-Wshadow]
      58 |   PathParser(string_view_t P, ParserState State) noexcept : Path(P),
         |                               ~~~~~~~~~~~~^~~~~
   libcxx/src/filesystem/path_parser.h:55:15: note: shadowed declaration is here
      55 |   ParserState State;
         |               ^~~~~
   libcxx/src/filesystem/path_parser.h: In constructor 
'std::__1::__fs::filesystem::parser::PathParser::PathParser(std::__1::__fs::filesystem::parser::string_view_t,
 ParserState)':
   libcxx/src/filesystem/path_parser.h:58:43: warning: declaration of 'State' 
shadows a member of 'std::__1::__fs::filesystem::parser::PathParser' [-Wshadow]
      58 |   PathParser(string_view_t P, ParserState State) noexcept : Path(P),
         |                               ~~~~~~~~~~~~^~~~~
   libcxx/src/filesystem/path_parser.h:55:15: note: shadowed declaration is here
      55 |   ParserState State;
         |               ^~~~~
   libcxx/src/filesystem/path_parser.h: In constructor 
'std::__1::__fs::filesystem::parser::PathParser::PathParser(std::__1::__fs::filesystem::parser::string_view_t,
 ParserState)':
   libcxx/src/filesystem/path_parser.h:58:43: warning: declaration of 'State' 
shadows a member of 'std::__1::__fs::filesystem::parser::PathParser' [-Wshadow]
      58 |   PathParser(string_view_t P, ParserState State) noexcept : Path(P),
         |                               ~~~~~~~~~~~~^~~~~
   libcxx/src/filesystem/path_parser.h:55:15: note: shadowed declaration is here
      55 |   ParserState State;
         |               ^~~~~
   CC:  irq/irq_dispatch.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"
         |           ^~~~~~~
   LD: nuttx
   CP: nuttx.hex
   CP: nuttx.bin
   ```
   There is something the libm include that resolves the issue. I will look 
further into it tomorrow.
   
   An interesting note for the future LLVM version (which will be 18) the 
following warning will need to be addressed:
   ```
   CXX:  libcxx/src/ios.cpp libcxx/src/string.cpp:58:33: warning: 
'template<class _CharT> struct std::__1::char_traits' is deprecated: 
char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t 
is non-standard and is provided for a temporary period. It will be removed in 
LLVM 18, so please migrate off of it. [-Wdeprecated-declarations]
      58 | template string operator+<char, char_traits<char>, 
allocator<char>>(char const*, string const&);
         |                                 ^~~~~~~~~~~
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to