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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to