You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "gustavonihei (via GitHub)" <gi...@apache.org> on 2023/03/06 14:41:16 UTC

[GitHub] [nuttx] gustavonihei opened a new pull request, #8744: [ESP32-S3] Fix build of WebAssembly applications

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

   ## Summary
   This PR intends to fix the build of WebAssembly applications for the **ESP32-S3**, which currently fails due to the following error:
   ```
   /opt/wasi-sdk-19.0//bin/clang -pipe -I /home/nihei/Projects/NuttX/apps/benchmarks/coremark/coremark -I /home/nihei/Projects/NuttX/apps/benchmarks/coremark/coremark/posix -I /home/nihei/Projects/NuttX/apps/interpreters/wamr/wamr/core/iwasm/include -I "/home/nihei/Projects/NuttX/apps/include" -Wno-undef -DUSE_PTHREAD -DPERFORMANCE_RUN=1 -DMULTITHREAD=1 -DFLAGS_STR="\"Using NuttX compilation options\"" -DMEM_LOCATION=\""Defined by the NuttX configuration"\" --sysroot=/home/nihei/Projects/NuttX/nuttx -nostdlib -D__NuttX__ -c coremark/core_main.c -o core_main.wo
   In file included from coremark/core_main.c:23:
   In file included from /home/nihei/Projects/NuttX/apps/benchmarks/coremark/coremark/coremark.h:41:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/stdio.h:35:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/lib/lib.h:31:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/kmalloc.h:36:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/userspace.h:35:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/arch.h:87:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/sched.h:39:
   In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/irq.h:37:
   /home/nihei/Projects/NuttX/nuttx/include/arch/irq.h:336:11: error: unknown register name 'a2' in asm
       : : : "a2"
             ^
   1 error generated.
   make[3]: *** [/home/nihei/Projects/NuttX/apps/interpreters/Wasm.mk:50: core_main.wo] Error 1
   ```
   The proposed fix is to remove an unused include of `userspace.h` from `kmalloc.h`, which ends up including the arch-specific `nuttx/irq.h` that contains inline assembly instructions.
   
   ## Impact
   No functional changes, should have no impact.
   
   ## Testing
   Custom defconfig based on `esp32s3-devkit:nsh` for enabling WAMR support.
   CI build pass.
   
   


-- 
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 #8744: [ESP32-S3] Fix build of WebAssembly applications

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

   > @xiaoxiang781216 Can you help me fix this issue with **libuv**? https://github.com/apache/nuttx/actions/runs/4367847346/jobs/7639730978#step:7:261
   
   Ok, I will take a look soon.


-- 
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] gustavonihei commented on a diff in pull request #8744: [ESP32-S3] Fix build of WebAssembly applications

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


##########
sched/signal/sig_findaction.c:
##########
@@ -23,8 +23,11 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
+
 #include "signal/signal.h"
 
+#include <nuttx/sched.h>

Review Comment:
   Oh, I missed this one. Thanks, @xiaoxiang781216!



-- 
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] gustavonihei closed pull request #8744: [ESP32-S3] Fix build of WebAssembly applications

Posted by "gustavonihei (via GitHub)" <gi...@apache.org>.
gustavonihei closed pull request #8744: [ESP32-S3] Fix build of WebAssembly applications
URL: https://github.com/apache/nuttx/pull/8744


-- 
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] yamt commented on pull request #8744: [ESP32-S3] Fix build of WebAssembly applications

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

   > ## Summary
   > 
   > This PR intends to fix the build of WebAssembly applications for the **ESP32-S3**, which currently fails due to the following error:
   > 
   > ```
   > /opt/wasi-sdk-19.0//bin/clang -pipe -I /home/nihei/Projects/NuttX/apps/benchmarks/coremark/coremark -I /home/nihei/Projects/NuttX/apps/benchmarks/coremark/coremark/posix -I /home/nihei/Projects/NuttX/apps/interpreters/wamr/wamr/core/iwasm/include -I "/home/nihei/Projects/NuttX/apps/include" -Wno-undef -DUSE_PTHREAD -DPERFORMANCE_RUN=1 -DMULTITHREAD=1 -DFLAGS_STR="\"Using NuttX compilation options\"" -DMEM_LOCATION=\""Defined by the NuttX configuration"\" --sysroot=/home/nihei/Projects/NuttX/nuttx -nostdlib -D__NuttX__ -c coremark/core_main.c -o core_main.wo
   > In file included from coremark/core_main.c:23:
   > In file included from /home/nihei/Projects/NuttX/apps/benchmarks/coremark/coremark/coremark.h:41:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/stdio.h:35:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/lib/lib.h:31:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/kmalloc.h:36:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/userspace.h:35:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/arch.h:87:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/sched.h:39:
   > In file included from /home/nihei/Projects/NuttX/nuttx/include/nuttx/irq.h:37:
   > /home/nihei/Projects/NuttX/nuttx/include/arch/irq.h:336:11: error: unknown register name 'a2' in asm
   >     : : : "a2"
   >           ^
   > 1 error generated.
   > make[3]: *** [/home/nihei/Projects/NuttX/apps/interpreters/Wasm.mk:50: core_main.wo] Error 1
   > ```
   > 
   > The proposed fix is to remove an unused include of `userspace.h` from `kmalloc.h`, which ends up including the arch-specific `nuttx/irq.h` that contains inline assembly instructions.
   > ## Impact
   > 
   > No functional changes, should have no impact.
   > ## Testing
   > 
   > Custom defconfig based on `esp32s3-devkit:nsh` for enabling WAMR support. CI build pass.
   
   it seems wrong to use nuttx headers when building wasm modules.
   please do the following instead.
   
   * use wasi-libc (my recommendation)
   * or, use sysroot provided by wamr-sdk


-- 
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] gustavonihei commented on pull request #8744: [ESP32-S3] Fix build of WebAssembly applications

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

   @xiaoxiang781216 Can you help me fix this issue with **libuv**?
   https://github.com/apache/nuttx/actions/runs/4367847346/jobs/7639730978#step:7:261


-- 
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 #8744: [ESP32-S3] Fix build of WebAssembly applications

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


##########
sched/signal/sig_findaction.c:
##########
@@ -23,8 +23,11 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
+
 #include "signal/signal.h"
 
+#include <nuttx/sched.h>

Review Comment:
   move before line 27



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