From 36741a7392663c5a07192e1522881a3b6c17126e Mon Sep 17 00:00:00 2001 From: wenyongh Date: Fri, 17 May 2019 18:01:35 +0800 Subject: [PATCH] Fix some compile errors --- core/iwasm/readme.txt | 75 ------------------- samples/littlevgl/README.md | 26 +++---- samples/littlevgl/build.sh | 6 +- .../src/platform/zephyr/iwasm_main.c | 4 +- .../zephyr-build/CMakeLists.txt | 2 +- samples/simple/CMakeLists.txt | 8 +- samples/simple/build.sh | 6 +- test-tools/host-tool/CMakeLists.txt | 1 - test-tools/host-tool/src/main.c | 1 - 9 files changed, 26 insertions(+), 103 deletions(-) delete mode 100644 core/iwasm/readme.txt diff --git a/core/iwasm/readme.txt b/core/iwasm/readme.txt deleted file mode 100644 index 16af58d7e..000000000 --- a/core/iwasm/readme.txt +++ /dev/null @@ -1,75 +0,0 @@ - -1. How to build iwasm in Linux - - cd products/linux/ - mkdir build && cd build - cmake .. && make - -2. How to build iwasm in Zephyr system - (1) clone zephyr source code - - git clone https://github.com/zephyrproject-rtos/zephyr.git - - (2) copy /products/zephyr/simple directory to zephry/samples/ - - cd zephyr/samples/ - cp -a /products/zephyr/simple simple - cd simple - - (3) create a link to and rename it to iwasm - - ln -s iwasm - - (4) create a link to and rename it to shared-lib - - ln -s shared-lib - - (5) build source code - - mkdir build && cd build - source ../../../zephyr-env.sh - cmake -GNinja -DBOARD=qemu_x86 .. - ninja - - (6) run simple - - ninja run - -3. How to build iwasm in AliOS-Things platform - (1) clone AliOS-Things source code - - git clone https://github.com/alibaba/AliOS-Things.git - - (2) copy /products/alios-things directory to AliOS-Things/middleware, - and rename it as iwasm - - cp -a /products/alios-things middleware/iwasm - - (3) create a link to in middleware/iwasm/ and rename it to iwasm - - ln -s middleware/iwasm/iwasm - - (4) create a link to in middleware/iwasm/ and rename it to shared-lib - - ln -s middle/iwasm/shared-lib - - (5) modify sample source code of AliOS-Things to call iwasm_init() function - - modify file app/example/helloworld/helloworld.c, in the beginning of - function application_start(), add: - - bool iwasm_init(void); - iwasm_init(); - - modify file app/example/helloworld/helloworld.mk, change - $(NAME)_COMPONENTS := yloop cli - to - $(NAME)_COMPONENTS := yloop cli iwasm - - (6) build source code - - aos make helloworld@linuxhost - - (7) run source code - ./out/helloworld@linuxhost/binary/helloworld@linuxhost.elf - diff --git a/samples/littlevgl/README.md b/samples/littlevgl/README.md index 5933c4d36..3cf5145fb 100644 --- a/samples/littlevgl/README.md +++ b/samples/littlevgl/README.md @@ -60,10 +60,10 @@ WASM VM and native extension method can be built into Zephyr, Then we can instal `git clone https://github.com/zephyrproject-rtos/zephyr.git`
b. copy samples
`cd zephyr/samples/`
- `cp -a samples/littlevgl/vgl-wasm-runtime vgl-wasm-runtime`
+ `cp -a samples/littlevgl/vgl-wasm-runtime vgl-wasm-runtime`
`cd vgl-wasm-runtime/zephyr_build`
c. create a link to wamr core
- ` ln -s /core core`
+ ` ln -s /core core`
d. build source code
Since ui_app incorporated LittlevGL source code, so it needs more RAM on the device to install the application. It is recommended that RAM SIZE greater than 512KB. @@ -82,27 +82,27 @@ Hardware Connections ``` +-------------------+-+------------------+ -|NUCLEO-F767ZI || ILI9341 Display | +|NUCLEO-F767ZI | ILI9341 Display | +-------------------+-+------------------+ -| CN7.10 | CLK | +| CN7.10 | CLK | +-------------------+-+------------------+ -| CN7.12 | MISO | +| CN7.12 | MISO | +-------------------+-+------------------+ -| CN7.14 | MOSI | +| CN7.14 | MOSI | +-------------------+-+------------------+ -| CN11.1 | CS1 for ILI9341 | +| CN11.1 | CS1 for ILI9341 | +-------------------+-+------------------+ -| CN11.2 | D/C | +| CN11.2 | D/C | +-------------------+-+------------------+ -| CN11.3 | RESET | +| CN11.3 | RESET | +-------------------+-+------------------+ -| CN9.25 | PEN interrupt| +| CN9.25 | PEN interrupt | +-------------------+-+------------------+ -| CN9.27 | CS2 for XPT2046 | +| CN9.27 | CS2 for XPT2046 | +-------------------+-+------------------+ -| CN10.14 | PC UART RX | +| CN10.14 | PC UART RX | +-------------------+-+------------------+ -| CN11.16 | PC UART RX | +| CN11.16 | PC UART RX | +-------------------+-+------------------+ ``` diff --git a/samples/littlevgl/build.sh b/samples/littlevgl/build.sh index ec123263e..cc1b72bb4 100755 --- a/samples/littlevgl/build.sh +++ b/samples/littlevgl/build.sh @@ -1,7 +1,7 @@ #!/bin/bash PROJECT_DIR=$PWD -ROOT_DIR=${PWD}/../../.. +WAMR_DIR=${PWD}/../.. OUT_DIR=${PWD}/out BUILD_DIR=${PWD}/build @@ -13,7 +13,7 @@ rm -rf ${OUT_DIR} mkdir ${OUT_DIR} -cd ${ROOT_DIR}/wamr/core/shared-lib/mem-alloc +cd ${WAMR_DIR}/core/shared-lib/mem-alloc if [ ! -d "tlsf" ]; then git clone https://github.com/mattconte/tlsf fi @@ -36,7 +36,7 @@ echo "#####################build host-tool" cd $BUILD_DIR mkdir -p host-tool cd host-tool -cmake ${ROOT_DIR}/wamr/test-tools/host-tool +cmake ${WAMR_DIR}/test-tools/host-tool make if [ $? != 0 ];then echo "BUILD_FAIL host tool exit as $?\n" diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c index 23be02a56..dc0d745c3 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c @@ -16,14 +16,14 @@ #include "bh_platform.h" #include "runtime_lib.h" #include "native_interface.h" -#include "app-manager-export.h" +#include "app_manager_export.h" #include "board_config.h" #include "bh_common.h" #include "bh_queue.h" #include "bh_thread.h" #include "bh_memory.h" #include "runtime_sensor.h" -#include "attr-container.h" +#include "attr_container.h" #include "module_wasm_app.h" #include "wasm_export.h" diff --git a/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt b/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt index a3b186ddc..bb5948ed9 100644 --- a/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt +++ b/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt @@ -34,7 +34,7 @@ target_include_directories(app PRIVATE ${IWASM_ROOT}/runtime/include ${IWASM_ROOT}/runtime/platform/zephyr ${IWASM_ROOT}/runtime/platform/include ${IWASM_ROOT}/runtime/utils - ${IWASM_ROOT}/runtime/vmcore_wasm + ${IWASM_ROOT}/runtime/vmcore-wasm ${IWASM_ROOT}/lib/native/base ${IWASM_ROOT}/lib/native/libc ${IWASM_ROOT}/lib/native/extension/sensor diff --git a/samples/simple/CMakeLists.txt b/samples/simple/CMakeLists.txt index a02e415f4..01fade444 100644 --- a/samples/simple/CMakeLists.txt +++ b/samples/simple/CMakeLists.txt @@ -43,10 +43,10 @@ message ("PLATFORM = " ${PLATFORM}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") -set(REPO_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../..) -set(WASM_DIR ${REPO_ROOT_DIR}/wamr/core/iwasm) -set(APP_MGR_DIR ${REPO_ROOT_DIR}/wamr/core/app-mgr) -set(SHARED_DIR ${REPO_ROOT_DIR}/wamr/core/shared-lib) +set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) +set(WASM_DIR ${WAMR_ROOT_DIR}/core/iwasm) +set(APP_MGR_DIR ${WAMR_ROOT_DIR}/core/app-mgr) +set(SHARED_DIR ${WAMR_ROOT_DIR}/core/shared-lib) enable_language (ASM) diff --git a/samples/simple/build.sh b/samples/simple/build.sh index 7fe76126d..1d8b8e1b1 100755 --- a/samples/simple/build.sh +++ b/samples/simple/build.sh @@ -1,7 +1,7 @@ #!/bin/bash CURR_DIR=$PWD -ROOT_DIR=${PWD}/../../.. +WAMR_DIR=${PWD}/../.. OUT_DIR=${PWD}/out BUILD_DIR=${PWD}/build @@ -15,7 +15,7 @@ rm -rf ${OUT_DIR} mkdir ${OUT_DIR} mkdir ${OUT_DIR}/wasm-apps -cd ${ROOT_DIR}/wamr/core/shared-lib/mem-alloc +cd ${WAMR_DIR}/core/shared-lib/mem-alloc if [ ! -d "tlsf" ]; then git clone https://github.com/mattconte/tlsf fi @@ -34,7 +34,7 @@ cp -a simple ${OUT_DIR} echo "#####################build simple project success" echo "#####################build host-tool" -cd ${ROOT_DIR}/wamr/test-tools/host-tool +cd ${WAMR_DIR}/test-tools/host-tool mkdir -p bin cd bin cmake .. diff --git a/test-tools/host-tool/CMakeLists.txt b/test-tools/host-tool/CMakeLists.txt index 00a4cd82a..df1512a7b 100644 --- a/test-tools/host-tool/CMakeLists.txt +++ b/test-tools/host-tool/CMakeLists.txt @@ -41,7 +41,6 @@ include (${SHARED_DIR}/utils/shared_utils.cmake) include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake) include (${CJSON_DIR}/cjson.cmake) include (${SHARED_DIR}/coap/lib_coap.cmake) -include (${SSG_LIB_DIR}/host_agent_lib.cmake) if (CMAKE_SIZEOF_VOID_P EQUAL 8) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") diff --git a/test-tools/host-tool/src/main.c b/test-tools/host-tool/src/main.c index 87b170ea0..d343095df 100644 --- a/test-tools/host-tool/src/main.c +++ b/test-tools/host-tool/src/main.c @@ -29,7 +29,6 @@ #include "app_manager_export.h" /* for Module_WASM_App */ #include "host_link.h" /* for REQUEST_PACKET */ #include "transport.h" -#include "iagent_bsp.h" /* for bh_get_elpased_ms */ #define BUF_SIZE 1024 #define TIMEOUT_EXIT_CODE 2