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
micro: riscv32_mcu build failed with undefined references #32041
Comments
@dansitu, please take a look. |
I am running into a similar error when trying to compile any of the examples for riscv using the same commands as listed above.
|
Thank you for writing a fix @zhoupeng . Unfortunately I still can't build the micro_speech, magic_wand or person_detection examples for person_detection fails with the error
I have yet to test my own models. Also, trying to build a linux version of the hello world example with the __dso fix gives me this error: |
Hi @Zielasko , Thanks for your response. Sorry for late reply, I am not convenient to handle mail in time, because on a travel of RISC-V tech forum. 2)__dso_handle missing problem. Thanks for response, very helpful. Hi @nkreeger @gbaned @rockyrhodes, sorry for late, thanks @nkreeger for your detail review I will submit a new version patch, catching up on this Fridays after my RISC-V tech forum journey. |
Fix the ld error: undefined references to `__wrap_puts` for build commands like `make -f tensorflow/lite/micro/tools/make/Makefile TARGET=riscv32_mcu hello_world_bin` The related issue is tensorflow#32041 Refactoring, suggested by Nick Kreeger(nick.kreeger@gmail.com): The targets/mcu_riscv_makefile.inc should only include the bare-bones parts for building for this platform. So move platform specific items from targets/mcu_riscv_makefile.inc to the actual example folder. Create a riscv32_mcu folder in each example directory. In those directories, create a new Makefile.inc that adds these rules moved out. The bug's original reasons: The Makefile variables XXX_TEST_SRCS/XXX_SRCS in targets/mcu_riscv_makefile.inc are overridden by the the examples's respective makefile.inc (eg. hello_world/Makefile.inc), which leads to the architecture special __wrap__funs are not included correctly.
Closing since the associated PR has been merged. Feel free to reopen if necessary. Thanks! |
System information
Describe the problem
TF Lite for micro, riscv32 build fails with undefined references.
make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=riscv32_mcu TARGET_ARCH=riscv32 hello_world_bin
/home/ehirdoy/src/tensorflow/tensorflow/lite/experimental/micro/riscv32_mcu/debug_log.cc:18: undefined reference to
__wrap_puts' exit.c:(.text.exit+0x2e): undefined reference to
__wrap__exit'sbrkr.c:(.text._sbrk_r+0x12): undefined reference to
__wrap__sbrk' writer.c:(.text._write_r+0x16): undefined reference to
__wrap__write'closer.c:(.text._close_r+0x12): undefined reference to
__wrap__close' lseekr.c:(.text._lseek_r+0x16): undefined reference to
__wrap__lseek'readr.c:(.text._read_r+0x16): undefined reference to
__wrap__read' fstatr.c:(.text._fstat_r+0x14): undefined reference to
__wrap__fstat'isattyr.c:(.text._isatty_r+0x12): undefined reference to `__wrap__isatty'
Provide the exact sequence of commands / steps that you executed before running into the problem
export PATH="$PATH:./tensorflow/lite/experimental/micro/tools/make/downloads/riscv_toolchain/bin"
make -f tensorflow/lite/experimental/micro/tools/make/Makefile clean
make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=riscv32_mcu TARGET_ARCH=riscv32 hello_world_bin
Any other info / logs
make.log
The text was updated successfully, but these errors were encountered: