diff --git a/arch/sim/include/math.h b/arch/sim/include/math.h deleted file mode 100644 index 7126027332c..00000000000 --- a/arch/sim/include/math.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** - * arch/sim/include/math.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_SIM_INCLUDE_MATH_H -#define __ARCH_SIM_INCLUDE_MATH_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include_next - -#ifdef __GLIBC__ -#undef __GLIBC__ -#endif - -#endif /* __ARCH_SIM_INCLUDE_MATH_H */ diff --git a/boards/sim/sim/sim/configs/libcxxtest/defconfig b/boards/sim/sim/sim/configs/libcxxtest/defconfig index 98735fa9869..608014f9546 100644 --- a/boards/sim/sim/sim/configs/libcxxtest/defconfig +++ b/boards/sim/sim/sim/configs/libcxxtest/defconfig @@ -10,7 +10,6 @@ CONFIG_ARCH="sim" CONFIG_ARCH_BOARD="sim" CONFIG_ARCH_BOARD_SIM=y CONFIG_ARCH_CHIP="sim" -CONFIG_ARCH_MATH_H=y CONFIG_ARCH_SIM=y CONFIG_BOARDCTL_APP_SYMTAB=y CONFIG_BOARDCTL_POWEROFF=y diff --git a/libs/libxx/0001-Fix-build-error-about-__GLIBC__.patch b/libs/libxx/0001-Fix-build-error-about-__GLIBC__.patch new file mode 100644 index 00000000000..95d6ee09dff --- /dev/null +++ b/libs/libxx/0001-Fix-build-error-about-__GLIBC__.patch @@ -0,0 +1,17 @@ +diff --git libcxx/src/locale.cpp libcxx/src/locale.cpp +--- libcxx/src/locale.cpp ++++ libcxx/src/locale.cpp +@@ -41,6 +41,10 @@ + #include "include/atomic_support.h" + #include "include/sso_allocator.h" + ++#if defined(__NuttX__) && defined(__GLIBC__) ++# undef __GLIBC__ ++#endif ++ + // On Linux, wint_t and wchar_t have different signed-ness, and this causes + // lots of noise in the build log, but no bugs that I know of. + _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wsign-conversion") +-- +2.34.1 + diff --git a/libs/libxx/libcxx.cmake b/libs/libxx/libcxx.cmake index 9b4c3fee88d..c88568f1322 100644 --- a/libs/libxx/libcxx.cmake +++ b/libs/libxx/libcxx.cmake @@ -49,7 +49,9 @@ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxx) ${CMAKE_CURRENT_LIST_DIR}/libcxx < ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-remove-mach-time-h.patch && patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx < - ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-fix-ld-errors.patch + ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-fix-ld-errors.patch && patch -p1 -d + ${CMAKE_CURRENT_LIST_DIR}/libcxx < + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-build-error-about-__GLIBC__.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs index 717af3489e6..192a6734a1e 100644 --- a/libs/libxx/libcxx.defs +++ b/libs/libxx/libcxx.defs @@ -35,6 +35,7 @@ libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz $(Q) patch -p2 < mbstate_t.patch $(Q) patch -p0 < 0001-libcxx-remove-mach-time-h.patch $(Q) patch -p0 < 0001-libcxx-fix-ld-errors.patch + $(Q) patch -p0 < 0001-Fix-build-error-about-__GLIBC__.patch $(Q) touch $@ endif