llext: adding missing heap when llext is disabled#331
llext: adding missing heap when llext is disabled#331andreagilardoni wants to merge 8 commits intoarduino:mainfrom
Conversation
93ef78b to
3b90f8a
Compare
pillo79
left a comment
There was a problem hiding this comment.
Allowing to build with LLEXT=n is a worthy goal! But I believe some things need to be addressed here:
- remove the last commit (
LLEXT_EDKis an absolutely mandatory part of the build!) - fix various
_defconfigtypos in the first commit - use the opportunity to improve the logic in main.c
Thanks!
loader/main.c
Outdated
| typedef void (*entry_point_t)(struct k_heap *heap, size_t heap_size); | ||
| entry_point_t entry_point = (entry_point_t)(base_addr + HEADER_LEN + 1); | ||
| entry_point(&llext_heap, llext_heap.heap.init_bytes); | ||
| entry_point(&SKETCH_HEAP, SKETCH_HEAP.heap.init_bytes); |
There was a problem hiding this comment.
This was a bug that needed to be addressed anyway, so let's write this line like this:
| entry_point(&SKETCH_HEAP, SKETCH_HEAP.heap.init_bytes); | |
| entry_point(&SKETCH_HEAP, SKETCH_HEAP_SIZE); |
There was a problem hiding this comment.
is entry_point expecting a KB measured or B measured value? I guess byte measured
loader/main.c
Outdated
| } | ||
| } | ||
|
|
||
| if (!IS_ENABLED(CONFIG_LLEXT)) { |
There was a problem hiding this comment.
That's enough, let's not add more #ifs please! 😁
You can replace this with a global #ifdef CONFIG_LLEXT that goes all the way to the return 0 at the end of this function. In the meantime, get rid of all the other #if CONFIG_LLEXT that are now redundant.
There was a problem hiding this comment.
I would love to keep something that can notify an user that the loader is built with llext disabled when linking a sketch with dynamic link mode. I think it can be easy to forget of this build choice and troublesome to find out that the sketch is not running because of this
d3af987 to
3416a2a
Compare
5ec2d57 to
aa32654
Compare
Defined config for sketch heap size, now LLEXT_HEAP_SIZE defaults to this value Signed-off-by: Andrea Gilardoni <a.gilardoni@arduino.cc>
When llext is disabled lext-edk include file generation had a recursion bug Signed-off-by: Andrea Gilardoni <a.gilardoni@arduino.cc>
When CONFIG_LLEXT=n llext_heap is not defined, thus raising compile time error when compiling with that option disabled. NOTE that the only way to use a sketch with a loader compiled with llext disabled is to use static linkage mode. This could help save up some space. Signed-off-by: Andrea Gilardoni <a.gilardoni@arduino.cc>
This commits make it possible to have the same exported symbols as an llext build, when llext is disabled by means of: - ephemeral symbols in section .exported_sym - gen_provides: mechanism to include symbols through list of regex Signed-off-by: Andrea Gilardoni <a.gilardoni@arduino.cc>
aa32654 to
46f2a8a
Compare
Making script gen_provides avoid failing when no symbol is provided, instead it just prints a warning message. This is required to avoid extra/build.sh fail when the loader is build without llext support Signed-off-by: Andrea Gilardoni <a.gilardoni@arduino.cc>
rename kheap_llext_heap and kheap_llext_heap_size symbols to kheap__sketch_heap Signed-off-by: Andrea Gilardoni <a.gilardoni@arduino.cc>
In this way wew are able to use symbol linkage statically without the need of the entire LLEXT runtime
46f2a8a to
34b3707
Compare
Built
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors | |
|---|---|---|---|---|---|---|---|---|
🔥 zephyr_contrib |
ek_ra8d1
| 🔥 | Core build failed! | |||||
frdm_mcxn947
| 🔥 | Core build failed! | ||||||
frdm_rw612
| 🔥 | Core build failed! | ||||||
🔥 zephyr_main |
giga
| 🔥 | Core build failed! | |||||
nano33ble
| 🔥 | Core build failed! | ||||||
nano_matter
| 🔥 | Core build failed! | ||||||
niclasense
| 🔥 | Core build failed! | ||||||
opta
| 🔥 | Core build failed! | ||||||
portentac33
| 🔥 | Core build failed! | ||||||
portentah7
| 🔥 | Core build failed! | ||||||
🔥 zephyr_unoq |
unoq
| 🔥 | Core build failed! | |||||
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
Caution
zephyr_contrib is blocked due to failures on ek_ra8d1, frdm_mcxn947, frdm_rw612!
Caution
zephyr_main is blocked due to failures on giga, nano33ble, nano_matter, niclasense, opta, portentac33, portentah7!
Caution
zephyr_unoq is blocked due to failures on unoq!
When CONFIG_LLEXT=n llext_heap is not defined, thus raising compile time error when compiling with that option disabled. A further generic config is added, in order to customize the size of the heap (SKETCH_HEAP_SIZE)
NOTE that the only way to use a sketch with a loader compiled with llext disabled is to use static linkage mode. This could help save up some space.