Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/nuttx spectest option and symbols #1687

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/iwasm/aot/aot_reloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ typedef struct {
REG_SYM(truncf), \
REG_SYM(rint), \
REG_SYM(rintf), \
REG_SYM(sqrt), \
REG_SYM(sqrtf), \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqrt/sqrtf might be a macro but not function, adding them here may cause compile error, see Windows CI report:
https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/3406870901

Suggest to register them like aot_memset/memmove:
Declare and implement aot_sqrt and aot_sqrtf in aot_runtime.h and aot_runtime.c, just after the code of aot_memset and aot_memmove:
https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/core/iwasm/aot/aot_runtime.h#L448-L452

And here:

{ "sqrt", (void*)aot_sqrt },
{ "sqrtf", (void*)aot_sqrtf },

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. then how can we know which APIs may not function but macro? if in future we encounter similar problems again

REG_BULK_MEMORY_SYM() \
REG_ATOMIC_WAIT_SYM() \
REG_REF_TYPES_SYM() \
Expand Down
7 changes: 5 additions & 2 deletions core/iwasm/aot/arch/aot_reloc_xtensa.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ void __gtdf2();
void __umoddi3();
void __floatdidf();
void __divsf3();
void __fixdfdi();
void __floatundidf();


static SymbolMap target_sym_map[] = {
REG_COMMON_SYMBOLS
Expand Down Expand Up @@ -80,8 +83,8 @@ static SymbolMap target_sym_map[] = {
REG_SYM(__umoddi3),
REG_SYM(__floatdidf),
REG_SYM(__divsf3),
REG_SYM(sqrt),
REG_SYM(sqrtf),
REG_SYM(__fixdfdi),
REG_SYM(__floatundidf),
};
/* clang-format on */

Expand Down
6 changes: 6 additions & 0 deletions product-mini/platforms/nuttx/wamr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ else
CFLAGS += -DWASM_ENABLE_GLOBAL_HEAP_POOL=0
endif

ifeq ($(CONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST),y)
CFLAGS += -DWASM_ENABLE_SPEC_TEST=1
else
CFLAGS += -DWASM_ENABLE_SPEC_TEST=0
endif

CFLAGS += -Wno-strict-prototypes -Wno-shadow -Wno-unused-variable
CFLAGS += -Wno-int-conversion -Wno-implicit-function-declaration

Expand Down