From 823317cbceeae07b26961533752770d4073d7e98 Mon Sep 17 00:00:00 2001 From: Zhou Peng Date: Tue, 21 Jan 2020 14:58:02 +0800 Subject: [PATCH] lite:micro:riscv32_mcu: Fix hidden symbol `__dso_handle' isn't defined. For arduino sketch in riscv_mcu examples, this patch fix by declare the global variable `void* __dso_handle;`. --- tensorflow/lite/micro/arduino/abi.cc | 16 ++++++++++++++++ .../hello_world/riscv32_mcu/Makefile.inc | 3 ++- .../examples/magic_wand/riscv32_mcu/Makefile.inc | 6 ++++-- .../micro_speech/riscv32_mcu/Makefile.inc | 6 ++++-- .../person_detection/riscv32_mcu/Makefile.inc | 6 ++++-- 5 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 tensorflow/lite/micro/arduino/abi.cc diff --git a/tensorflow/lite/micro/arduino/abi.cc b/tensorflow/lite/micro/arduino/abi.cc new file mode 100644 index 00000000000..6e58671f9a6 --- /dev/null +++ b/tensorflow/lite/micro/arduino/abi.cc @@ -0,0 +1,16 @@ +/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +void* __dso_handle; diff --git a/tensorflow/lite/micro/examples/hello_world/riscv32_mcu/Makefile.inc b/tensorflow/lite/micro/examples/hello_world/riscv32_mcu/Makefile.inc index 61d683286dd..f24610a5c14 100644 --- a/tensorflow/lite/micro/examples/hello_world/riscv32_mcu/Makefile.inc +++ b/tensorflow/lite/micro/examples/hello_world/riscv32_mcu/Makefile.inc @@ -11,7 +11,8 @@ ifeq ($(TARGET), riscv32_mcu) $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/freedom-e300-hifive1/init.c HELLO_WORLD_TEST_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) - HELLO_WORLD_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) + HELLO_WORLD_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc LIBWRAP_SYMS := malloc free \ open lseek read write fstat stat close link unlink \ diff --git a/tensorflow/lite/micro/examples/magic_wand/riscv32_mcu/Makefile.inc b/tensorflow/lite/micro/examples/magic_wand/riscv32_mcu/Makefile.inc index e8f8b15a279..545ed1ad1f5 100644 --- a/tensorflow/lite/micro/examples/magic_wand/riscv32_mcu/Makefile.inc +++ b/tensorflow/lite/micro/examples/magic_wand/riscv32_mcu/Makefile.inc @@ -10,8 +10,10 @@ ifeq ($(TARGET), riscv32_mcu) $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/entry.S \ $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/freedom-e300-hifive1/init.c - magic_wand_TEST_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) - magic_wand_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) + magic_wand_TEST_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc + magic_wand_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc LIBWRAP_SYMS := malloc free \ open lseek read write fstat stat close link unlink \ diff --git a/tensorflow/lite/micro/examples/micro_speech/riscv32_mcu/Makefile.inc b/tensorflow/lite/micro/examples/micro_speech/riscv32_mcu/Makefile.inc index 3c9960d1510..480c6fbb219 100644 --- a/tensorflow/lite/micro/examples/micro_speech/riscv32_mcu/Makefile.inc +++ b/tensorflow/lite/micro/examples/micro_speech/riscv32_mcu/Makefile.inc @@ -10,8 +10,10 @@ ifeq ($(TARGET), riscv32_mcu) $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/entry.S \ $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/freedom-e300-hifive1/init.c - MICRO_SPEECH_TEST_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) - MICRO_SPEECH_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) + MICRO_SPEECH_TEST_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc + MICRO_SPEECH_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc LIBWRAP_SYMS := malloc free \ open lseek read write fstat stat close link unlink \ diff --git a/tensorflow/lite/micro/examples/person_detection/riscv32_mcu/Makefile.inc b/tensorflow/lite/micro/examples/person_detection/riscv32_mcu/Makefile.inc index 54c180c3baa..e138efd0954 100644 --- a/tensorflow/lite/micro/examples/person_detection/riscv32_mcu/Makefile.inc +++ b/tensorflow/lite/micro/examples/person_detection/riscv32_mcu/Makefile.inc @@ -10,8 +10,10 @@ ifeq ($(TARGET), riscv32_mcu) $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/entry.S \ $(MAKEFILE_DIR)/downloads/sifive_fe310_lib/bsp/env/freedom-e300-hifive1/init.c - person_detection_TEST_HDRS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) - person_detection_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) + person_detection_TEST_HDRS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc + person_detection_SRCS += $(MICRO_FE310_LIBWRAP_SRCS) $(MICRO_FE310_BSP_ENV_SRCS) \ + tensorflow/lite/micro/arduino/abi.cc LIBWRAP_SYMS := malloc free \ open lseek read write fstat stat close link unlink \