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 05:00:08 UTC

[GitHub] [nuttx] g2gps opened a new pull request, #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

g2gps opened a new pull request, #8173:
URL: https://github.com/apache/nuttx/pull/8173

   ## Summary
   
   Upgrade of LLVM libcxx from 12.0.0 to 14.0.6 in order to take advantage of newer features and fixes. See #7105 for previous discussion.
   
   ## Impact
   
   Changes to the Nuttx tree are relatively minimal. However, there are a couple of new patches applied to libcxx in order to get the build working with c++17, c++14 and c++11. It is a possible that there are additional options that could be applied to `__config_site`  which would remove this requirement. Although there is nothing obvious which stands out to me. Feedback or guidance in relation to this would be appreciated. 
   
   ## Testing
   
   I've performed testing using `sim:libcxxtest` configuration, whilst setting the `CONFIG_CXX_STANDARD` to:
    - c++11
    - c++14
    - c++17
    - c++20
   
   Attempting to build with c++98 fails miserably. Although this was also the case with libcxx `12.0.0`.
   
   A sample of the output from `cxxtest`, with `CONFIG_CXX_STANDARD` set to c++17, the default value is:
   ```
   nsh> cxxtest
   load_absmodule: Loading /bin/cxxtest
   builtin_loadbinary: Loading file: /bin/cxxtest
   load_absmodule: Successfully loaded module /bin/cxxtest
   binfmt_dumpmodule: Module:
   binfmt_dumpmodule:   entrypt:   0x55786b3b92e6
   binfmt_dumpmodule:   mapped:    0 size=0
   binfmt_dumpmodule:   alloc:     0 0 0
   binfmt_dumpmodule:   stacksize: 2048
   binfmt_dumpmodule:   stackaddr: 0
   binfmt_dumpmodule:   unload:    0
   exec_module: Executing cxxtest
   Test ofstream ================================
   printf: Starting test_ostream
   printf: Successfully opened /dev/console
   cout: Successfully opened /dev/console
   Writing this to /dev/console
   Test iostream ================================
   Hello, this is only a test
   Print an int: 190
   Print a char: d
   Test std::vector =============================
   v1=1 2 3
   Hello World Good Luck 
   Test std::map ================================
   Test C++17 features ==========================
   File /proc/meminfo exists!
   Invalid file! /invalid
   File /proc/version exists!
   Test RTTI ====================================
   extend
   Test Exception ===============================
   Catch exception: runtime error
   nsh> 
   ```
   


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


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

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1403147571

   @g2gps It's here:
   https://github.com/xiaoxiang781216/incubator-nuttx/tree/llvm-libcxx-upgrade
   please cherry-pick to your branch.


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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1082623300


##########
fs/vfs/fs_symlink.c:
##########
@@ -180,4 +180,30 @@ int symlink(FAR const char *path1, FAR const char *path2)
   return ERROR;
 }
 
+/****************************************************************************
+ * Name: link
+ *
+ * Description:
+ *  The link function provides a wrapper to symlink. Solely to provide
+ *  compatibility to posix compatibility layer, in
+ *  libxx/libcxx/src/filesystem/posix_compat.h.
+ *
+ *  See symlink for details on limitations.
+ *
+ * Input Parameters:
+ *   path1 - Points to a pathname naming an existing file.
+ *   path2 - Points to a pathname naming the new directory entry to be
+ *           created.
+ *
+ * Returned Value:
+ *   On success, zero (OK) is returned.  Otherwise, -1 (ERROR) is returned
+ *   the errno variable is set appropriately.
+ *
+ ****************************************************************************/
+
+int link(FAR const char *path1, FAR const char *path2)

Review Comment:
   no, since the c++ header file normally contain something like this:
   ```
   namespace std
   {
     using ::link;
   }
   ```
   macro will make the above fail to compile.



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


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

Posted by GitBox <gi...@apache.org>.
g2gps commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080646797


##########
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:
   Done.



##########
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:
   Done.



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396454597

   @g2gps it's better to fuse the last patch to related individual patch 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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080817564


##########
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:
   As far as I know, the user could select C++ 11, but the build of libcxx need at least c++17: https://github.com/apache/nuttx/pull/6181.
   Since NuttX build libcxx and user code in one pass with the same toolchain in most user case, it doesn't make sense to use the different c++ standard.



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1082623300


##########
fs/vfs/fs_symlink.c:
##########
@@ -180,4 +180,30 @@ int symlink(FAR const char *path1, FAR const char *path2)
   return ERROR;
 }
 
+/****************************************************************************
+ * Name: link
+ *
+ * Description:
+ *  The link function provides a wrapper to symlink. Solely to provide
+ *  compatibility to posix compatibility layer, in
+ *  libxx/libcxx/src/filesystem/posix_compat.h.
+ *
+ *  See symlink for details on limitations.
+ *
+ * Input Parameters:
+ *   path1 - Points to a pathname naming an existing file.
+ *   path2 - Points to a pathname naming the new directory entry to be
+ *           created.
+ *
+ * Returned Value:
+ *   On success, zero (OK) is returned.  Otherwise, -1 (ERROR) is returned
+ *   the errno variable is set appropriately.
+ *
+ ****************************************************************************/
+
+int link(FAR const char *path1, FAR const char *path2)

Review Comment:
   no, since the c++ header file normally contain somethin like this:
   ```
   namespace std
   {
     using ::link;
   }
   ```



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


[GitHub] [nuttx] xiaoxiang781216 closed pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 closed pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6
URL: https://github.com/apache/nuttx/pull/8173


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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080817564


##########
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:
   As far as I know, the user could select C++ 11, but the build of libcxx need at least c++17: https://github.com/apache/nuttx/pull/6181.
   Since NuttX build libcxx and user code in one pass with the same toolchain in most user case, it doesn't make sense to use the different c++ standard for libcxx and user code.



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


[GitHub] [nuttx] g2gps commented on pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

Posted by GitBox <gi...@apache.org>.
g2gps commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396468518

   Would you prefer that I squash the commits into one while applying the amendments?


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


[GitHub] [nuttx] g2gps commented on pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

Posted by GitBox <gi...@apache.org>.
g2gps commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396487086

   > 
   
   For 15.0.0, it seems libcxx moved to using `__attribute__((using_if_exists))` in order to enable or disable features. See [this commit on LLVM](https://github.com/llvm/llvm-project/commit/a9c9183ca42629fa83cdda297d1d30c7bc1d7c91). As far as I can tell, there is no support for this yet in GCC. I found an open [bug report]( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105584), and didn't make any attempts on the upgrade after that.


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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080830955


##########
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:
   Yes, we definitely need more documentation.



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396485568

   Please reorganize the patch set and remove the intermediate change, @g2gps .


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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396479291

   BTW, @g2gps do you plan to upgrade libcxx to 15.0.x


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


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

Posted by GitBox <gi...@apache.org>.
g2gps commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080646614


##########
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:
   I overlooked this option. Adding it to `defconfig` solves this issue.



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


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

Posted by GitBox <gi...@apache.org>.
g2gps commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080647201


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

Review Comment:
   Removed from `.gitignore`. The directory is now removed after the archive is unpacked.



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


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

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1398807223

   @g2gps here is patch(https://github.com/apache/nuttx/pull/8206) which implement quick_exit and at_quick_exit, so we can upgrade to 15.0.0 without patch the official release, I think.


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


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

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1402519505

   @g2gps could you give maintainer right to edit your patch here?
   <img width="530" alt="image" src="https://user-images.githubusercontent.com/18066964/214394757-353e737a-bcbd-42e7-931d-04a2e8eb2c29.png">
   
   I just adjust your patch to make it pass CI.


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


[GitHub] [nuttx] g2gps commented on pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

Posted by "g2gps (via GitHub)" <gi...@apache.org>.
g2gps commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1402833516

   @xiaoxiang781216 I don't appear to have the option you suggested. Maybe because the pull request came from an organisation, not a personal account.
   
   Is there another way we could go about this? Possibly, if you sent me a patch, I could apply it and push the changes?


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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080842496


##########
libs/libxx/Kconfig:
##########
@@ -35,10 +35,11 @@ config LIBCXXMINI
 
 config LIBCXX
 	bool "LLVM libc++ C++ Standard Library"
+	depends on CXX_STANDARD="c++17" || CXX_STANDARD="c++20"

Review Comment:
   does Kconfig support string comparison? And it will stop work after https://github.com/apache/nuttx/pull/8187. So I think it's enough to point the standard requirement in help text.



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


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

Posted by GitBox <gi...@apache.org>.
g2gps commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080846046


##########
libs/libxx/Kconfig:
##########
@@ -35,10 +35,11 @@ config LIBCXXMINI
 
 config LIBCXX
 	bool "LLVM libc++ C++ Standard Library"
+	depends on CXX_STANDARD="c++17" || CXX_STANDARD="c++20"

Review Comment:
   It does work, for me at least. However, if #8187 gets integrated, this would break. 



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


[GitHub] [nuttx] g2gps commented on pull request #8173: LLVM libcxx upgrade from 12.0.0 to 14.0.6

Posted by GitBox <gi...@apache.org>.
g2gps commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1397810269

   > Could you give a list of the function not implemented by NuttX yet. I can take time to implement them.
   
   The complete list of unimplemented functions is:
   ```c
   int at_quick_exit(void (*func)(void))                                     
   void quick_exit(int status); 
   int openat(int dirfd, const char *pathname, int flags);
   int unlinkat(int dirfd, const char *pathname, int flags);
   ```
   
   There is alternate implementation in libcxx for `__remove_all` which removes the need for `openat` and `unlinkat`. This is enabled with `#define REMOVE_ALL_USE_DIRECTORY_ITERATOR`, which I had previously added to `__config_site`.
   
   For `at_quick_exit` and `quick_exit`, there either needs to be implementations in NuttX, or they are patched out. Like so:
   ```diff
   diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib
   index 457c31f625d8..40ecdfac969d 100644
   --- a/libcxx/include/cstdlib
   +++ b/libcxx/include/cstdlib
   @@ -132,8 +132,8 @@ using ::wctomb _LIBCPP_USING_IF_EXISTS;
    using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
    using ::wcstombs _LIBCPP_USING_IF_EXISTS;
    #if !defined(_LIBCPP_CXX03_LANG)
   -using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
   -using ::quick_exit _LIBCPP_USING_IF_EXISTS;
   +// using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
   +// using ::quick_exit _LIBCPP_USING_IF_EXISTS;
    #endif
    #if _LIBCPP_STD_VER > 14
    using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
   ```
   
   If the above is done, cxxlib version `15.0.7` works with c++20, with no further modification. The patch I added previously still needs to be used in order to support c++17.


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


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

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1082252596


##########
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 
+ * is initially built.
+ */
+
+
+#ifndef _LIBCPP_CONFIG_SITE
+#define _LIBCPP_CONFIG_SITE

Review Comment:
   ```suggestion
   #ifndef __LIBS_LIBXX_LIBCPP___CONFIG_SITE
   #define __LIBS_LIBXX_LIBCPP___CONFIG_SITE
   ```



##########
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 
+ * is 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:
   ```suggestion
   #endif // __LIBS_LIBXX_LIBCPP___CONFIG_SITE
   ```



##########
fs/vfs/fs_symlink.c:
##########
@@ -180,4 +180,30 @@ int symlink(FAR const char *path1, FAR const char *path2)
   return ERROR;
 }
 
+/****************************************************************************
+ * Name: link
+ *
+ * Description:
+ *  The link function provides a wrapper to symlink. Solely to provide
+ *  compatibility to posix compatibility layer, in
+ *  libxx/libcxx/src/filesystem/posix_compat.h.
+ *
+ *  See symlink for details on limitations.
+ *
+ * Input Parameters:
+ *   path1 - Points to a pathname naming an existing file.
+ *   path2 - Points to a pathname naming the new directory entry to be
+ *           created.
+ *
+ * Returned Value:
+ *   On success, zero (OK) is returned.  Otherwise, -1 (ERROR) is returned
+ *   the errno variable is set appropriately.
+ *
+ ****************************************************************************/
+
+int link(FAR const char *path1, FAR const char *path2)

Review Comment:
   is `link` required to be a function? Can we use macro 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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
g2gps commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080829205


##########
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:
   Ok. Sure, that makes sense. I'll remove that patch. Would it be useful to also add additional text the the help prompt of `CONFIG_LIBCXX` to state that it requires c++17 or later?



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396470872

   > Would you prefer that I squash the commits into one while applying the amendments?
   
   It's fine since github provide UI to compare the change between the new patch and the old patch.


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


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

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1085853645


##########
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 
+ * is initially built.
+ */
+
+
+#ifndef _LIBCPP_CONFIG_SITE
+#define _LIBCPP_CONFIG_SITE

Review Comment:
   @pkarashchenko since this file is generated from a template(__config_site.in), it's better to avoid making the unnecessary modification.



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1398009453

   > > Could you give a list of the function not implemented by NuttX yet. I can take time to implement them.
   > 
   > The complete list of unimplemented functions is:
   > 
   > ```c
   > int at_quick_exit(void (*func)(void))                                     
   > void quick_exit(int status); 
   
   I will implement these functions in the next couple days.
   
   > int openat(int dirfd, const char *pathname, int flags);
   > int unlinkat(int dirfd, const char *pathname, int flags);
   > ```
   
   @Donny9 will provide an implementation later.
   
   > 
   > There is alternate implementation in libcxx for `__remove_all` which removes the need for `openat` and `unlinkat`. This is enabled with `#define REMOVE_ALL_USE_DIRECTORY_ITERATOR`, which I had previously added to `__config_site`.
   > 
   > For `at_quick_exit` and `quick_exit`, there either needs to be implementations in NuttX, or they are patched out. Like so:
   > 
   > ```diff
   > diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib
   > index 457c31f625d8..40ecdfac969d 100644
   > --- a/libcxx/include/cstdlib
   > +++ b/libcxx/include/cstdlib
   > @@ -132,8 +132,8 @@ using ::wctomb _LIBCPP_USING_IF_EXISTS;
   >  using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
   >  using ::wcstombs _LIBCPP_USING_IF_EXISTS;
   >  #if !defined(_LIBCPP_CXX03_LANG)
   > -using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
   > -using ::quick_exit _LIBCPP_USING_IF_EXISTS;
   > +// using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
   > +// using ::quick_exit _LIBCPP_USING_IF_EXISTS;
   >  #endif
   >  #if _LIBCPP_STD_VER > 14
   >  using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
   > ```
   > 
   > If the above is done, cxxlib version `15.0.7` works with c++20, with no further modification. The patch I added previously still needs to be used in order to support c++17, along with any further modification needed to support.
   
   could you remove the temporary change from PR?


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


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

Posted by GitBox <gi...@apache.org>.
g2gps commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080646183


##########
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:
   As I understand, LLVM still has support for C++11. From `libcxx/include/__config`:
   ```c++
   #ifndef _LIBCPP_STD_VER
   #  if  __cplusplus <= 201103L
   #    define _LIBCPP_STD_VER 11
   #  elif __cplusplus <= 201402L
   #    define _LIBCPP_STD_VER 14
   #  elif __cplusplus <= 201703L
   #    define _LIBCPP_STD_VER 17
   #  elif __cplusplus <= 202002L
   #    define _LIBCPP_STD_VER 20
   #  else
   #    define _LIBCPP_STD_VER 21  // current year, or date of c++2b ratification
   #  endif
   #endif // _LIBCPP_STD_VER
   ```
   and
   ```c++
   #if defined(_LIBCPP_COMPILER_GCC) && __cplusplus < 201103L
   #error "libc++ does not support using GCC with C++03. Please enable C++11"
   #endif
   ```
   I would say that their minimum supported version is C++11 (with GCC).
   
   Was the intention to drop C++11 from NuttX, when using the LLVM library?



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

Review Comment:
   Done.



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1080817564


##########
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:
   As far as I know, the user could select C++ 11, but the build of libcxx need at least c++17: https://github.com/apache/nuttx/pull/6181.
   Since NuttX build libcxx and user code in one pass with the same toolchain in most user case, it doesn't make sense to use the different c++ standard for libcxx and user code especially after https://github.com/apache/nuttx/pull/8120.



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


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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1396494107

   > For 15.0.0, it seems libcxx moved to using `__attribute__((using_if_exists))` in order to enable or disable features. See [this commit on LLVM](https://github.com/llvm/llvm-project/commit/a9c9183ca42629fa83cdda297d1d30c7bc1d7c91). As far as I can tell, there is no support for this yet in GCC. I found an open [bug report](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105584), and didn't make any attempts on the upgrade after that.
   
   But I think it doesn't matter whether the compiler support using_if_exists since we can implement the lack of c standard library functions which are required by libcxx.


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


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

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1404792538

   @g2gps to boost the process, I create a new PR here: https://github.com/apache/nuttx/pull/8244.


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


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

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#discussion_r1087226999


##########
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 
+ * is initially built.
+ */
+
+
+#ifndef _LIBCPP_CONFIG_SITE
+#define _LIBCPP_CONFIG_SITE

Review Comment:
   Sure. I didn't knew that is autogenerated



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


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

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8173:
URL: https://github.com/apache/nuttx/pull/8173#issuecomment-1724084038

   let's track the upgrade with https://github.com/apache/nuttx/pull/8244


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