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 2023/01/18 07:03:19 UTC

[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1073117907


##########
libs/libxx/.gitignore:
##########
@@ -4,3 +4,4 @@
 /libcxx-*.src.tar.xz
 /libcxxabi-*.src.tar.xz
 /etl
+/cmake

Review Comment:
   remove the cmake?



##########
libs/libxx/__config_site:
##########
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * libs/libxx/__config_site
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/* Additional port configuration used by llvm libcxx.
+ * 
+ * This file is typically generated by CMake during configuration and used 
+ * to customize the build configuration for libcxx. As Nuttx does not have 
+ * this functionality, this file is copied into the libcxx tree when Nuttx 
+ * initially built.
+ */
+
+
+#ifndef _LIBCPP_CONFIG_SITE
+#define _LIBCPP_CONFIG_SITE
+
+/* 
+ * Use a directory iterator for __remove_all implementation, as openat and 
+ * unlinkat are not defined.
+*/
+#define REMOVE_ALL_USE_DIRECTORY_ITERATOR
+
+/*
+ * The following is the original contents of __config_site.in. The necessity
+ * of supplying these options is yet to be determined.
+
+ * #cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@
+ * #cmakedefine _LIBCPP_ABI_UNSTABLE
+ * #cmakedefine _LIBCPP_ABI_FORCE_ITANIUM
+ * #cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT
+ * #cmakedefine _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
+ * #cmakedefine _LIBCPP_HAS_NO_THREADS
+ * #cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+ * #cmakedefine _LIBCPP_HAS_MUSL_LIBC
+ * #cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
+ * #cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
+ * #cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
+ * #cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
+ * #cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
+ * #cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+ * #cmakedefine _LIBCPP_NO_VCRUNTIME
+ * #cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
+ * #cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
+ * #cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
+ * #cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
+ * #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
+ * #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
+ * #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ * #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
+ * #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+*/
+
+#endif // _LIBCPP_CONFIG_SITE

Review Comment:
   add the blank line to remove the red mark.



##########
libs/libxx/__config_site:
##########
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * libs/libxx/__config_site
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/* Additional port configuration used by llvm libcxx.
+ * 
+ * This file is typically generated by CMake during configuration and used 
+ * to customize the build configuration for libcxx. As Nuttx does not have 

Review Comment:
   All Nuttx to NuttX



##########
libs/libxx/0001-libcxx-enable-support-for-c++11.patch:
##########
@@ -0,0 +1,49 @@
+diff --git a/libcxx/src/barrier.cpp b/libcxx/src/barrier.cpp
+index 54890b2d797e..13bc65dfb307 100644
+--- a/libcxx/src/barrier.cpp
++++ b/libcxx/src/barrier.cpp

Review Comment:
   why need to support the old compiler if the official repo drop them.



##########
include/unistd.h:
##########
@@ -259,7 +259,9 @@
 
 /* Helpers and legacy compatibility definitions */
 
+#ifndef CONFIG_LIBCXX
 #define link(p1, p2)                     symlink((p1), (p2))

Review Comment:
   let's change link to normal function unconditionally...



##########
boards/sim/sim/sim/scripts/Make.defs:
##########
@@ -164,6 +164,10 @@ ifeq ($(CONFIG_LIBCXX),y)
   # It makes libcxx __availability header unhappy.
   # https://github.com/llvm/llvm-project/blob/2e2999cd44f6ec9a5e396fa0113497ea82582f69/libcxx/include/__availability#L258
   CXXFLAGS += -D_LIBCPP_DISABLE_AVAILABILITY
+
+  # Force inclusion of Nuttx math.h, which undefines __GLIBC__.
+  # Without this inclusing, the system math.h may be picked up first, casuing an incorrect configuration in llvm.
+  CXXFLAGS += -include$(TOPDIR)$(DELIM)include$(DELIM)arch$(DELIM)math.h 

Review Comment:
   let add CONFIG_ARCH_MATH_H to the related defconfig instead



-- 
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