bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.66k stars 576 forks source link

Fix posix no libc wasi debug interp build #3503

Closed bnason-nf closed 4 weeks ago

bnason-nf commented 1 month ago

This change supports building with WAMR_BUILD_LIBC_WASI=0 and WAMR_BUILD_DEBUG_INTERP=1, otherwise the os_socket_* functions will be undefined.

bnason-nf commented 1 month ago

Hi @wenyongh, yes, the intention is for the else() clause to be different. The reason is that when we are building with WAMR_BUILD_DEBUG_INTERP=1, we want to compile posix_socket.c, and we also want to use platform_common_libc_util.cmake regardless of the setting of WAMR_BUILD_LIBC_WASI. I tested all four combinations of WAMR_BUILD_LIBC_WASI and WAMR_BUILD_DEBUG_INTERP before submitting this pull request, so unless I made a mistake I think this is behaving as intended.

wenyongh commented 4 weeks ago

Hi @wenyongh, yes, the intention is for the else() clause to be different. The reason is that when we are building with WAMR_BUILD_DEBUG_INTERP=1, we want to compile posix_socket.c, and we also want to use platform_common_libc_util.cmake regardless of the setting of WAMR_BUILD_LIBC_WASI. I tested all four combinations of WAMR_BUILD_LIBC_WASI and WAMR_BUILD_DEBUG_INTERP before submitting this pull request, so unless I made a mistake I think this is behaving as intended.

OK, got it, thanks.