Build embed with C modules isn't working
Port, board and/or hardware
embed
MicroPython version
MicroPython v1.22.2 on 2024-08-13; linux [GCC 4.2.1] version
Reproduction
- Modify
examples/embedding/main.cby addingimport cexampleinto second example - From
examples/embeddingrun
make -f micropython_embed.mk USER_C_MODULES=<micropython_path>/examples/usercmodule
make
- Run embed binary
Expected behaviour
Expected to start without errors
Observed behaviour
Traceback (most recent call last):
File "<stdin>", in <module>
ImportError: module not found
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
py.cmake: MICROPY_SOURCE_PY does not include "nlraarch64.c"
Port, board and/or hardware
embed
MicroPython version
N/A (master source tree)
Reproduction
I've been putting together CMake package config to build the embed port as a dynamic library, rather than a vendorable list of source files.
This allows a vendor to submodule MicroPython and use:
find_package(micropython-embed CONFIG REQUIRED PATHS micropython/ports/embed)
When building for macOS I run into the link errors detailed below.
I believe "nlraarch64.c" can be added to the source files list without side-effects, but it's not much use if nobody is using it. For now I'll settle to raise this issue for posterity, with a plan to fix it and other bugs if/when I get this CMake tomfoolery working nicely.
Expected behaviour
No response
Observed behaviour
The build will fail at the link stage with:
Undefined symbols for architecture arm64:
"_nlr_jump", referenced from:
_mp_compile in compile.c.o
_fun_bc_call in objfun.c.o
_gen_resume_and_raise in objgenerator.c.o
_gen_instance_close in objgenerator.c.o
_it_iternext in objgetitemiter.c.o
_mp_parse in parse.c.o
_raise_exc in parsenum.c.o
...
"_nlr_push", referenced from:
_it_iternext in objgetitemiter.c.o
_mp_iternext in runtime.c.o
_mp_load_method_protected in runtime.c.o
_mp_call_function_1_protected in runtime_utils.c.o
_mp_call_function_2_protected in runtime_utils.c.o
_mp_execute_bytecode in vm.c.o
_mp_embed_exec_str in embed_util.c.o
...
ld: symbol(s) not found for architecture arm64
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree