You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "simbit18 (via GitHub)" <gi...@apache.org> on 2023/10/13 11:09:02 UTC
[PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
simbit18 opened a new pull request, #10905:
URL: https://github.com/apache/nuttx/pull/10905
## Summary
Simulator build fails on non-GLIBC platform #5621 #5623.
On platforms where the execinfo.h file is missing, the Gnulib substitute implementation is just a stub, and does nothing.
https://www.gnu.org/software/gnulib/manual/html_node/execinfo_002eh.html
## Impact
On Linux with glibc: There should be no impact.
On other platforms: You need to add SIM_GLIBC_PLATFORM=n to your .config file to enable simulator compilation.
## Testing
We tested on platform Alpine linux sim:nsh sim:lua
--
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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10905:
URL: https://github.com/apache/nuttx/pull/10905#discussion_r1358347477
##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -90,10 +90,10 @@ void host_abort(int status)
int host_backtrace(void** array, int size)
{
-#ifdef CONFIG_WINDOWS_CYGWIN
- return 0;
-#else
+#ifdef CONFIG_SIM_GLIBC_PLATFORM
Review Comment:
it's better change to:
```
#if __has_include(<execinfo.h>)
#endif
```
so, you don't need change it from defconfig for non glibc platform.
--
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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 closed pull request #10905: Fix more generic for platforms that do not have execinfo.h
URL: https://github.com/apache/nuttx/pull/10905
--
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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #10905:
URL: https://github.com/apache/nuttx/pull/10905#discussion_r1358359671
##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -90,10 +90,10 @@ void host_abort(int status)
int host_backtrace(void** array, int size)
{
-#ifdef CONFIG_WINDOWS_CYGWIN
- return 0;
-#else
+#ifdef CONFIG_SIM_GLIBC_PLATFORM
Review Comment:
I think __has_include is not portable. You need to test first if it is defined.
https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html
--
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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 commented on code in PR #10905:
URL: https://github.com/apache/nuttx/pull/10905#discussion_r1359325887
##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -90,10 +90,10 @@ void host_abort(int status)
int host_backtrace(void** array, int size)
{
-#ifdef CONFIG_WINDOWS_CYGWIN
- return 0;
-#else
+#ifdef CONFIG_SIM_GLIBC_PLATFORM
Review Comment:
#if defined __has_include
# if __has_include(<execinfo.h>)
# define SIM_GLIBC_PLATFORM 1
# endif
#endif
I tested on Alpine and Mingw it's ok. I will update this 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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10905:
URL: https://github.com/apache/nuttx/pull/10905#discussion_r1358394606
##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -90,10 +90,10 @@ void host_abort(int status)
int host_backtrace(void** array, int size)
{
-#ifdef CONFIG_WINDOWS_CYGWIN
- return 0;
-#else
+#ifdef CONFIG_SIM_GLIBC_PLATFORM
Review Comment:
__has_include is part of c++17 spec, should become c spec soon, but it's always good to check defined(__has_include) first.
##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -90,10 +90,10 @@ void host_abort(int status)
int host_backtrace(void** array, int size)
{
-#ifdef CONFIG_WINDOWS_CYGWIN
- return 0;
-#else
+#ifdef CONFIG_SIM_GLIBC_PLATFORM
Review Comment:
__has_include is part of c++17 spec, should become c spec soon, but it's always good to check `defined(__has_include)` first.
--
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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 commented on PR #10905:
URL: https://github.com/apache/nuttx/pull/10905#issuecomment-1762870805
Sorry, there was a mistake in this change.
--
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
Re: [PR] Fix more generic for platforms that do not have execinfo.h [nuttx]
Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 commented on code in PR #10905:
URL: https://github.com/apache/nuttx/pull/10905#discussion_r1359325887
##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -90,10 +90,10 @@ void host_abort(int status)
int host_backtrace(void** array, int size)
{
-#ifdef CONFIG_WINDOWS_CYGWIN
- return 0;
-#else
+#ifdef CONFIG_SIM_GLIBC_PLATFORM
Review Comment:
```
#if defined __has_include
# if __has_include(<execinfo.h>)
# define SIM_GLIBC_PLATFORM 1
# endif
#endif
```
I tested on Alpine and Mingw it's ok. I will update this 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