Skip to content
New issue

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

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

Already on GitHub? # to your account

Build fails with current Zephyr versions #16

Closed
tomtor opened this issue Dec 27, 2019 · 3 comments
Closed

Build fails with current Zephyr versions #16

tomtor opened this issue Dec 27, 2019 · 3 comments

Comments

@tomtor
Copy link

tomtor commented Dec 27, 2019

I have tried building with Zephyr SDK 0.10.3 (last version supported by https://github.com/zephyrproject-rtos/zephyr) and 0.13, but misc/mempool.h has to be replaced with sys/mempool.h

diff --git a/rust-smem.c b/rust-smem.c
index 4fc58f3..d9f19d9 100644
--- a/rust-smem.c
+++ b/rust-smem.c
@@ -1,6 +1,6 @@
 #include <zephyr.h>
 #include <init.h>
-#include <misc/mempool.h>
+#include <sys/mempool.h>
 #include <app_memory/app_memdomain.h>

 struct k_mem_domain rust_std_domain;
diff --git a/rust/zephyr-sys/wrapper.h b/rust/zephyr-sys/wrapper.h
index baf81fc..f7fd276 100644
--- a/rust/zephyr-sys/wrapper.h
+++ b/rust/zephyr-sys/wrapper.h
@@ -4,7 +4,7 @@

 #include <rust_syscall_macros.h>
 #include <kernel.h>
-#include <misc/mempool.h>
+#include <sys/mempool.h>
 #include <device.h>
 #include <uart.h>
 #include <uart_buffered.h>
diff --git a/syscall-thunk.c b/syscall-thunk.c
index 5d226a1..6a0a2df 100644
--- a/syscall-thunk.c
+++ b/syscall-thunk.c
@@ -1,6 +1,6 @@
 #define __ZEPHYR_DEFINE_SYSCALLS__
 #include <rust_syscall_macros.h>
 #include <kernel.h>
-#include <misc/mempool.h>
+#include <sys/mempool.h>
 #include <device.h>
 #include <uart.h>

after that step I get errors like:

error[E0425]: cannot find function `k_poll_signal_reset` in module `zephyr_sys::syscalls::kernel`
  --> /home/tom/src/zephyr-rust/rust/zephyr-core/src/poll_signal.rs:27:53
   |
27 |                     zephyr_sys::syscalls::$context::k_poll_signal_reset(
   |                                                     ^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `k_poll_signal_raise`
...

and

In file included from zephyr/include/generated/rust_syscall_macros.h:6,
                 from /home/tom/src/zephyr-rust/syscall-thunk.c:2:
/home/tom/src/zephyr/include/syscall.h:93:21: error: expected ';' before '_Bool'
 static ALWAYS_INLINE bool z_syscall_trap(void)
                     ^
                     ;
ninja: build stopped: subcommand failed.

Do I need an older specific version of https://github.com/zephyrproject-rtos/zephyr ?

@tylerwhall
Copy link
Owner

@tomtor The 1.14 LTS branch is known to work. I'll see about supporting current master. It was building against master as of a couple months ago, I believe.

@tylerwhall
Copy link
Owner

I pushed a few small fixes to get it building up through v2.0. v2.1 fails due to the syscall header generation having been reworked upstream.

gen_syscall_header.py is the file in question which was forked from upstream Zephyr. This needs more looking into. I'd like to support master and LTS in the same branch if possible.

I'd recommend the 1.14 LTS branch for now, as that's what I've been using for my zephyr-rust projects.

@tomtor
Copy link
Author

tomtor commented Jan 2, 2020

@tylerwhall Thanks for looking into this, 1.14 LTS does indeed build fine for me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants