Fixes partly: https://github.com/apache/nuttx-apps/issues/2046
Also, this fixes warnings like:
```
spacetanuki% ./tools/configure.sh -E sim:wamr
Copy files
Select CONFIG_HOST_MACOS=y
Refreshing...
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory /usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
CP: arch/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/arch/dummy/dummy_kconf
ig
CP: boards/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/boards/dummy/dummy_k
config
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
```
And leave all intermediate file in apps/wasm,
such as .map file, entry object etc used in
wasm module build.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Try to follow current NuttX's toolchain parttern:
Wasm.mk: Provide target rule for building wasm module
WASI-SDK.defs: Provide compile flags for building
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
when a program has multiple MAINSRC for incremental compilation,
the PROGNAME of the compiled file may generate errors
-------------------- compile definition error ---------------------
cc -c -g CFLAGS INCLUDEDIR -Dmain=funA_main funB.c -o funB.c.path.o
^^^^ ^^^^^^ ^^^^
-------------------------------------------------------------------
use the MAINOBJ:PROGNAME mapping variable to define the main entry name
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
wasm clang can't find math.h if using libm from toolchain.
It's OK to using math.h from NuttX since only declaration is needed for wasm build.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
For example, before this patch, object file is like:
```
apps/examples/hello/hello_main.wo
```
With this patch, it will be:
```
apps/examples/hello/hello_main.c.home.huang.Work.nx.apps.examples.hello.wo
'''
Follow the native build:
'''
apps/examples/hello/hello_main.c.home.huang.Work.nx.apps.examples.hello.o
```
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>