Enable WASI feature, enhance security and add SGX sample (#142)

Change emcc to clang
Refine interpreter to improve perforamnce
This commit is contained in:
Weining
2019-11-20 21:16:36 +08:00
committed by wenyongh
parent 29c7c743e9
commit 27f246b5f3
159 changed files with 9543 additions and 3789 deletions

View File

@ -1,7 +1,7 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
CC = emcc
CC = clang-8
LVGL_DIR = ${shell pwd}
IWASM_DIR=../../../core/iwasm
CFLAGS += -O3 \
@ -50,7 +50,8 @@ SRCS += $(LVGL_DIR)/src/main.c
SRCS += $(IWASM_DIR)/lib/app-libs/base/timer.c
all:
@$(CC) $(CFLAGS) $(SRCS) \
-s WASM=1 -s SIDE_MODULE=1 -s ASSERTIONS=1 -s STACK_OVERFLOW_CHECK=2 \
-s TOTAL_MEMORY=65536 -s TOTAL_STACK=2048\
-s "EXPORTED_FUNCTIONS=['_on_init', '_on_timer_callback']" \
--target=wasm32 -O3 -z stack-size=2048 -Wl,--initial-memory=65536 \
-Wl,--allow-undefined \
-Wl,--no-threads,--strip-all,--no-entry -nostdlib \
-Wl,--export=on_init -Wl,--export=on_timer_callback \
-o ui_app.wasm

View File

@ -56,7 +56,7 @@ char label_count1_str[11] = { 0 };
void timer1_update(user_timer_t timer1)
{
if ((count % 100) == 0) {
sprintf(count_str, "%d", count / 100);
snprintf(count_str, sizeof(count_str), "%d", count / 100);
lv_label_set_text(count_label, count_str);
}
lv_task_handler();
@ -67,7 +67,8 @@ void timer1_update(user_timer_t timer1)
static lv_res_t btn_rel_action(lv_obj_t * btn)
{
label_count1_value++;
sprintf(label_count1_str, "%d", label_count1_value);
snprintf(label_count1_str, sizeof(label_count1_str),
"%d", label_count1_value);
lv_label_set_text(label_count1, label_count1_str);
return LV_RES_OK;
}