incubator-nuttx/libs/libxx/libcxx.defs

85 lines
3.4 KiB
Plaintext
Raw Normal View History

############################################################################
# libs/libxx/libcxx.defs
#
# 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.
#
###########################################################################
LIBCXX_VERSION=12.0.0
# Download and unpack tarball if no git repo found
ifeq ($(wildcard libcxx/.git),)
libcxx-$(LIBCXX_VERSION).src.tar.xz:
$(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION)/libcxx-$(LIBCXX_VERSION).src.tar.xz
libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz
$(Q) tar -xf libcxx-$(LIBCXX_VERSION).src.tar.xz \
--exclude libcxx-$(LIBCXX_VERSION).src/test/std/pstl
$(Q) mv libcxx-$(LIBCXX_VERSION).src libcxx
$(Q) patch -p0 < 0001-Remove-the-locale-fallback-for-NuttX.patch
$(Q) patch -p0 < 0001-libc-avoid-the-waring-__EXCEPTIONS-is-not-defined-ev.patch
$(Q) patch -p1 < 0001-libcxx-Rename-PS-macro-to-avoid-clashing-with-Xtensa.patch
ifeq ($(CONFIG_LIBC_ARCH_ATOMIC),y)
$(Q) patch -p1 < 0002-Omit-atomic_-un-signed_lock_free-if-unsupported.patch
endif
$(Q) touch $@
endif
$(TOPDIR)/include/libcxx: libcxx
$(Q) $(DIRLINK) $(CURDIR)/libcxx/include $(TOPDIR)/include/libcxx
context:: $(TOPDIR)/include/libcxx
distclean::
$(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxx
ifeq ($(wildcard libcxx/.git),)
$(Q) $(DELFILE) libcxx-$(LIBCXX_VERSION).src.tar.xz
$(call DELDIR, libcxx)
endif
CXXFLAGS += -std=c++17 ${shell $(DEFINE) "$(CC)" _LIBCPP_BUILDING_LIBRARY}
ifeq ($(CONFIG_LIBSUPCXX), y)
CXXFLAGS += ${shell $(DEFINE) "$(CC)" __GLIBCXX__}
endif
libcxx: Disable -Wshadow for barrier.cpp This might be specific to gcc or Linux as I didn't see it with clang + macOS. libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)': libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow] 35 | : __expected(__expected) | ^ libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here 29 | ptrdiff_t& __expected; | ^~~~~~~~~~ libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)': libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow] 44 | } | ^ libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here 29 | ptrdiff_t& __expected; | ^~~~~~~~~~ libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)': libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow] 44 | } | ^ libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here 29 | ptrdiff_t& __expected; | ^~~~~~~~~~ CXX: libcxx/src/new.cpp In file included from libcxx/src/new.cpp:19: /usr/include/c++/9/cxxabi.h: In member function 'virtual bool __cxxabiv1::__pbase_type_info::__pointer_catch(const __cxxabiv1::__pbase_type_info*, void**, unsigned int) const': /usr/include/c++/9/cxxabi.h:308:23: error: 'const class std::type_info' has no member named '__do_catch' 308 | return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2); | ^~~~~~~~~~
2020-10-23 07:12:47 +08:00
# Workaround the following warning with "c++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0"
#
# libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
# libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
# 35 | : __expected(__expected)
# | ^
# libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
# 29 | ptrdiff_t& __expected;
# | ^~~~~~~~~~
libcxx/src/barrier.cpp_CXXFLAGS += -Wno-shadow
libcxx/src/locale.cpp_CXXFLAGS += -Wno-shadow
libcxx: Disable -Wshadow for barrier.cpp This might be specific to gcc or Linux as I didn't see it with clang + macOS. libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)': libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow] 35 | : __expected(__expected) | ^ libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here 29 | ptrdiff_t& __expected; | ^~~~~~~~~~ libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)': libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow] 44 | } | ^ libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here 29 | ptrdiff_t& __expected; | ^~~~~~~~~~ libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)': libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow] 44 | } | ^ libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here 29 | ptrdiff_t& __expected; | ^~~~~~~~~~ CXX: libcxx/src/new.cpp In file included from libcxx/src/new.cpp:19: /usr/include/c++/9/cxxabi.h: In member function 'virtual bool __cxxabiv1::__pbase_type_info::__pointer_catch(const __cxxabiv1::__pbase_type_info*, void**, unsigned int) const': /usr/include/c++/9/cxxabi.h:308:23: error: 'const class std::type_info' has no member named '__do_catch' 308 | return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2); | ^~~~~~~~~~
2020-10-23 07:12:47 +08:00
libcxx/src/filesystem/directory_iterator.cpp_CXXFLAGS += -Wno-shadow
libcxx/src/filesystem/operations.cpp_CXXFLAGS += -Wno-shadow
CPPSRCS += $(notdir $(wildcard libcxx/src/*.cpp))
CPPSRCS += $(notdir $(wildcard libcxx/src/experimental/*.cpp))
CPPSRCS += $(notdir $(wildcard libcxx/src/filesystem/*.cpp))
DEPPATH += --dep-path libcxx/src
DEPPATH += --dep-path libcxx/src/experimental
DEPPATH += --dep-path libcxx/src/filesystem
VPATH += libcxx/src
VPATH += libcxx/src/experimental
VPATH += libcxx/src/filesystem