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/09/01 09:21:22 UTC

[GitHub] [incubator-nuttx] gustavonihei opened a new pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

gustavonihei opened a new pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453


   ## Summary
   This PR intends to enable the integration of `libcxxabi` on applications that disable RTTI (via `-fno-rtti`).
   
   It is okay for the application to be built without RTTI (-fno-rrti), but libcxxabi requires RTTI at least for the library.
   
   ## Impact
   Just for users of `libcxxabi`. Since this library was recently integrated, impact is minimal.
   
   ## Testing
   `esp32-wrover-kit` with `cxxtest` example application.
   


-- 
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] [incubator-nuttx] gustavonihei commented on pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#issuecomment-909460767


   @xiaoxiang781216 I saw that it is also possible to build `libcxxabi` with `-fno-rtti` by removing `private_typeinfo.cpp` from the build, but this is not supported by the `libcxxabi` build system.
   Furthermore, no other project that relies on `libcxxabi` attempts to build it with `-fno-rtti`.


-- 
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] [incubator-nuttx] gustavonihei commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r701029282



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       You are right, I haven't noticed it before. I assumed that setting would be specific to `libcxxabi`.
   NuttX build system supports file-specific compiler flags. Although functional, it seems rather ugly:
   ```suggestion
   libcxxabi/src/private_typeinfo.cpp_CXXFLAGS += -frtti
   ```
   The other way, and most correct I believe, would be to create a switch for RTTI support.
   And this config could be applied to every board makefile, but it is not a small change hehe




-- 
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] [incubator-nuttx] gustavonihei commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r701046151



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       > Another method is select rtti by CXX_EXCEPTION too.
   
   Do you mean to rely on the same switch? I think that's not very intuitive.
   
   Another option would be to separate the ABI libs from the standard implementation libs.
   This would allow us to to compile libcxxabi with RTTI.




-- 
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] [incubator-nuttx] gustavonihei commented on pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#issuecomment-909460767


   @xiaoxiang781216 I saw that it is also possible to build `libcxxabi` with `-fno-rtti` by removing `private_typeinfo.cpp` from the build, but this is not supported by the `libcxxabi` build system.
   Furthermore, no other project that relies on `libcxxabi` attempts to build it with `-fno-rtti`.


-- 
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] [incubator-nuttx] xiaoxiang781216 merged pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453


   


-- 
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r701120127



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       It's a good idea to separate ABI libs.




-- 
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r700714779



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       @gustavonihei  libcxx/uClibc++ share the same CXXFLAGS with libcxxabi, this change will enable rtti for the standard library.




-- 
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r701034346



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       Another method is select rtti by CXX_EXCEPTION too.




-- 
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] [incubator-nuttx] gustavonihei commented on pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#issuecomment-910239512


   > > Since RTTI will increase the code size, it will be useful if we can compile libcxxabi without RTTI.
   > 
   > Compiling `libcxxabi` with RTTI will impose minimal impact on code size, since the real impact will be dictated by enabling RTTI for the application. I think the trade-off here is more like between correctness/compliance and build time, since `libcxxabi` could have 1 or 2 files removed from the build (we could also remove `cxa_demangle.cpp` which is used just for dynamic_cast implementation).
   
   Between the two, I'd go with the first option. This way it is entirely up to the application to decide whether to include RTTI support.
   And disabling RTTI won't bring that many benefits. Besides, we would need to create a new switch on Kconfig for selecting RTTI.


-- 
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r700714779



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       @gustavonihei  libcxx/uClibc++ share the same CXXFLAGS with libcxxabi, this change will enable rtti for the standard library too.




-- 
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] [incubator-nuttx] gustavonihei commented on a change in pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#discussion_r701046151



##########
File path: libs/libxx/libcxxabi.defs
##########
@@ -55,6 +55,9 @@ else
 CPPSRCS += cxa_noexception.cpp
 endif
 
+# RTTI is required for building the libcxxabi library
+CXXFLAGS += -frtti

Review comment:
       > Another method is select rtti by CXX_EXCEPTION too.
   
   Do you mean to rely on the same switch? I think that's not very intuitive.
   
   Another option would be to separate the ABI libs from the standard implementation libs.
   This would allow us to to compile libcxxabi with RTTI.
   And this is not completely absurd, since they being together is more of a convenience than actually correct.




-- 
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] [incubator-nuttx] xiaoxiang781216 commented on pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#issuecomment-910014660


   > @xiaoxiang781216 I saw that it is also possible to build `libcxxabi` with `-fno-rtti` by removing `private_typeinfo.cpp` from the build, but this is not supported by the `libcxxabi` build system.
   > Furthermore, no other project that relies on `libcxxabi` attempts to build it with `-fno-rtti`.
   
   Since RTTI will increase the code size, it will be useful if we can compile libcxxabi without RTTI.
   


-- 
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] [incubator-nuttx] gustavonihei commented on pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#issuecomment-910230792


   > Since RTTI will increase the code size, it will be useful if we can compile libcxxabi without RTTI.
   
   Compiling `libcxxabi` with RTTI will impose minimal impact on code size, since the real impact will be dictated by enabling RTTI for the application. I think the trade-off here is more like between correctness/compliance and build time, since `libcxxabi` could have 1 or 2 files removed from the build (we could also remove `cxa_demangle.cpp` which is used just for dynamic_cast implementation).


-- 
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] [incubator-nuttx] xiaoxiang781216 commented on pull request #4453: libs/libxx: Enforce RTTI for building libcxxabi

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4453:
URL: https://github.com/apache/incubator-nuttx/pull/4453#issuecomment-910014660


   > @xiaoxiang781216 I saw that it is also possible to build `libcxxabi` with `-fno-rtti` by removing `private_typeinfo.cpp` from the build, but this is not supported by the `libcxxabi` build system.
   > Furthermore, no other project that relies on `libcxxabi` attempts to build it with `-fno-rtti`.
   
   Since RTTI will increase the code size, it will be useful if we can compile libcxxabi without RTTI.
   


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