You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/08/19 10:18:25 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4374: libxx: add new low level c++ standard library support
xiaoxiang781216 commented on a change in pull request #4374:
URL: https://github.com/apache/incubator-nuttx/pull/4374#discussion_r691978411
##########
File path: libs/libxx/libcxx.defs
##########
@@ -18,6 +18,8 @@
#
###########################################################################
+include $(TOPDIR)/Make.defs
Review comment:
remove
##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -0,0 +1,62 @@
+############################################################################
+# libs/libxx/libcxxabi.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.
+#
+###########################################################################
+
+include $(TOPDIR)/Make.defs
+
+VERSION=12.0.0
+
+libcxxabi-$(VERSION).src.tar.xz:
+ $(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(VERSION)/libcxxabi-$(VERSION).src.tar.xz
+
+libcxxabi: libcxxabi-$(VERSION).src.tar.xz
+ $(Q) tar -xf libcxxabi-$(VERSION).src.tar.xz
+ $(Q) mv libcxxabi-$(VERSION).src libcxxabi
+
+$(TOPDIR)/include/libcxxabi: libcxxabi
+ $(Q) $(DIRLINK) $(CURDIR)/libcxxabi/include $(TOPDIR)/include/libcxxabi
+
+dirlinks:: $(TOPDIR)/include/libcxxabi
Review comment:
let's keep libcxxabi internally
##########
File path: libs/libxx/libcxx.defs
##########
@@ -40,9 +42,17 @@ distclean::
$(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxx
$(call DELDIR, libcxx)
-CXXFLAGS += ${shell $(DEFINE) "$(CC)" __GLIBCXX__}
CXXFLAGS += ${shell $(DEFINE) "$(CC)" _LIBCPP_BUILDING_LIBRARY}
+ifeq ($(CONFIG_LIBCXXABI), y)
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" LIBCXX_BUILDING_LIBCXXABI}
+CXXFLAGS += -I $(CURDIR)/libcxxabi/include
+else
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" __GLIBCXX__}
+endif
+
+#CXXFLAGS += -I $(CURDIR)/libcxx/include
Review comment:
remove
##########
File path: libs/libxx/Kconfig
##########
@@ -50,6 +50,12 @@ config UCLIBCXX
endchoice
+config LIBCXXABI
Review comment:
merge with CXX_LIBSUPCXX and change to choice
##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -0,0 +1,62 @@
+############################################################################
+# libs/libxx/libcxxabi.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.
+#
+###########################################################################
+
+include $(TOPDIR)/Make.defs
+
+VERSION=12.0.0
+
+libcxxabi-$(VERSION).src.tar.xz:
+ $(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(VERSION)/libcxxabi-$(VERSION).src.tar.xz
+
+libcxxabi: libcxxabi-$(VERSION).src.tar.xz
+ $(Q) tar -xf libcxxabi-$(VERSION).src.tar.xz
+ $(Q) mv libcxxabi-$(VERSION).src libcxxabi
+
+$(TOPDIR)/include/libcxxabi: libcxxabi
+ $(Q) $(DIRLINK) $(CURDIR)/libcxxabi/include $(TOPDIR)/include/libcxxabi
+
+dirlinks:: $(TOPDIR)/include/libcxxabi
+
+distclean::
+ $(Q) $(DELFILE) libcxxabi-$(VERSION).src.tar.xz
+ $(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxxabi
+ $(call DELDIR, libcxxabi)
+
+CXXFLAGS += -I $(CURDIR)/libcxxabi/include
+
+ifeq ($(CONFIG_CXX_EXCEPTION), y)
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" LIBCXXABI_ENABLE_EXCEPTIONS}
+CPPSRCS += cxa_exception.cpp cxa_personality.cpp
+else
+CPPSRCS += cxa_noexception.cpp
+endif
+
+ifeq ($(CONFIG_LIBCXX), y)
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" _LIBCPP_BUILDING_LIBRARY}
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" LIBCXX_BUILDING_LIBCXXABI}
+CXXFLAGS += -I $(CURDIR)/libcxx/include
+endif
+
+CPPSRCS += cxa_aux_runtime.cpp cxa_default_handlers.cpp cxa_demangle.cpp cxa_exception_storage.cpp cxa_guard.cpp cxa_handlers.cpp cxa_vector.cpp cxa_virtual.cpp stdlib_exception.cpp stdlib_stdexcept.cpp stdlib_typeinfo.cpp abort_message.cpp fallback_malloc.cpp private_typeinfo.cpp cxa_thread_atexit.cpp stdlib_new_delete.cpp
Review comment:
let's split to two lines
##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -0,0 +1,62 @@
+############################################################################
+# libs/libxx/libcxxabi.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.
+#
+###########################################################################
+
+include $(TOPDIR)/Make.defs
+
+VERSION=12.0.0
+
+libcxxabi-$(VERSION).src.tar.xz:
+ $(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(VERSION)/libcxxabi-$(VERSION).src.tar.xz
+
+libcxxabi: libcxxabi-$(VERSION).src.tar.xz
+ $(Q) tar -xf libcxxabi-$(VERSION).src.tar.xz
+ $(Q) mv libcxxabi-$(VERSION).src libcxxabi
+
+$(TOPDIR)/include/libcxxabi: libcxxabi
+ $(Q) $(DIRLINK) $(CURDIR)/libcxxabi/include $(TOPDIR)/include/libcxxabi
+
+dirlinks:: $(TOPDIR)/include/libcxxabi
+
+distclean::
+ $(Q) $(DELFILE) libcxxabi-$(VERSION).src.tar.xz
+ $(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxxabi
+ $(call DELDIR, libcxxabi)
+
+CXXFLAGS += -I $(CURDIR)/libcxxabi/include
+
+ifeq ($(CONFIG_CXX_EXCEPTION), y)
+CXXFLAGS += ${shell $(DEFINE) "$(CC)" LIBCXXABI_ENABLE_EXCEPTIONS}
+CPPSRCS += cxa_exception.cpp cxa_personality.cpp
Review comment:
The partial c++abi support need be removed to avoid the symbol duplication.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org