From edfe674560bd0128363fa0a2246896272eb539b4 Mon Sep 17 00:00:00 2001 From: haopengxiang Date: Thu, 9 Jan 2025 15:41:26 +0800 Subject: [PATCH 1/2] add dir ignored since changed libxx layout changed Signed-off-by: haopengxiang --- libs/libxx/libstdc++/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 libs/libxx/libstdc++/.gitignore diff --git a/libs/libxx/libstdc++/.gitignore b/libs/libxx/libstdc++/.gitignore new file mode 100644 index 00000000000..9ba33fb6f30 --- /dev/null +++ b/libs/libxx/libstdc++/.gitignore @@ -0,0 +1 @@ +/libstdc++/ From 0cc9237ac02dde0a56d9d2104ca03b73489f96c5 Mon Sep 17 00:00:00 2001 From: haopengxiang Date: Thu, 14 Nov 2024 00:10:51 +0800 Subject: [PATCH 2/2] cmake(bugfix):fix libcxxabi layout build error Signed-off-by: haopengxiang --- libs/libxx/libcxx/CMakeLists.txt | 4 ++++ libs/libxx/libcxxabi/CMakeLists.txt | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libs/libxx/libcxx/CMakeLists.txt b/libs/libxx/libcxx/CMakeLists.txt index ff5a4b24878..6788eb4bbd7 100644 --- a/libs/libxx/libcxx/CMakeLists.txt +++ b/libs/libxx/libcxx/CMakeLists.txt @@ -84,6 +84,10 @@ if(CONFIG_LIBCXX) add_compile_definitions(__GLIBCXX__) endif() + if(CONFIG_LIBCXXABI) + add_compile_definitions(LIBCXX_BUILDING_LIBCXXABI) + endif() + set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) diff --git a/libs/libxx/libcxxabi/CMakeLists.txt b/libs/libxx/libcxxabi/CMakeLists.txt index 1defc475f22..ab518d852bc 100644 --- a/libs/libxx/libcxxabi/CMakeLists.txt +++ b/libs/libxx/libcxxabi/CMakeLists.txt @@ -76,7 +76,14 @@ if(CONFIG_LIBCXXABI) cxa_thread_atexit.cpp cxa_vector.cpp cxa_virtual.cpp) + add_compile_definitions(_LIBCPP_BUILDING_LIBRARY) + if(CONFIG_LIBSUPCXX_TOOLCHAIN) + add_compile_definitions(__GLIBCXX__) + endif() + if(CONFIG_LIBSUPCXX) + add_compile_definitions(__GLIBCXX__) + endif() # C++ STL files list(APPEND SRCS stdlib_exception.cpp stdlib_new_delete.cpp stdlib_stdexcept.cpp stdlib_typeinfo.cpp) @@ -121,6 +128,6 @@ if(CONFIG_LIBCXXABI) target_sources(libcxxabi PRIVATE ${TARGET_SRCS}) target_include_directories( - libcxxabi BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include - ${CMAKE_CURRENT_LIST_DIR}/libcxx/src) + libcxxabi BEFORE PRIVATE ${NUTTX_DIR}/libs/libxx/libcxx/libcxx/src + ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include) endif()