-
Notifications
You must be signed in to change notification settings - Fork 724
Zephyr: fix the product mini compilation issue #4629
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
base: main
Are you sure you want to change the base?
Zephyr: fix the product mini compilation issue #4629
Conversation
…eep as a temp solution
- Declare it in the api_vm_extension for each platform - Increase the experimental functions doc - Create a os_nanosleep function in a new zephyr_sleep file - add it to the compilation process.
#include <time.h> | ||
|
||
#include "platform_api_extension.h" | ||
#include "libc_errno.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a standard libc header and leads to a compilation error:
fatal error: libc_errno.h: No such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know, but it didn't anticipate this error.
In fact I tested building iwasm for Linux (file sample) and no other plateforms (except Zephyr obviously).
From what I see, the issue comes from this CMake logic:
wasm-micro-runtime/core/shared/platform/common/posix/platform_api_posix.cmake
Lines 15 to 22 in 95f506a
if ((NOT WAMR_BUILD_LIBC_WASI EQUAL 1) AND (NOT WAMR_BUILD_DEBUG_INTERP EQUAL 1)) | |
list(REMOVE_ITEM source_all | |
${PLATFORM_COMMON_POSIX_DIR}/posix_socket.c | |
) | |
else() | |
include (${CMAKE_CURRENT_LIST_DIR}/../libc-util/platform_common_libc_util.cmake) | |
set(source_all ${source_all} ${PLATFORM_COMMON_LIBC_UTIL_SOURCE}) | |
endif() |
Now that posix_sleep.c
directly include libc_errno.h
, we can build with WAMR_BUILD_LIBC_WASI=0
but we still need this helper.
How do we manage this case ? We can:
- Use a
case
inos_nanosleep
onret
for POSIX. - Change the CMake logic (but I can't cleary indentify the impact)
If it's alright, could I inquire about your experience with: How to set up CI on a Zephyr platform using GitHub Actions? Since there is no board, a simulation is required. So, which is better: nsim or QEMU? |
I @lum1n0us ! Thank you for the quick review. Honestly, I don't have any real experiences for setting a CI on the Zephyr platform using Github Actions. But I may share my insights about native sim vs QEMU. From my understanding about simulation tools:
Also the WAMR project could select a few (embedded) Hardware platforms to support for each of the (RTOS) paltforms supported. It could be aligned with the embedded SIG targeted (hardware) platforms. But in any case at least trying to compile and run the samples should be pretty simple to put in place, and we should begin by that. |
This pull request present a fix to #4628.
It introduces the following changes:
os_nanosleep
API.os_nanosleep
.os_
APIs inplatform_api_extension.h
.simple-file
andsimple-http
samples compile again.Note
At first I intended to change
os_ioctl
return type but didn't in the end.