From 7bff108d82bd4db01aa6cd2e3611a9c30da978ca Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Wed, 18 Sep 2024 14:21:02 +0300 Subject: [PATCH] Cleanup --- Makefile | 2 -- run-tests.sh | 4 +--- runtime/libc.c | 6 ++++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 807b45f..50b4945 100644 --- a/Makefile +++ b/Makefile @@ -35,8 +35,6 @@ CFLAGS += -Os -Iruntime -I$(BUILD) -Wno-unused-value -Wno-unused-function \ #MPY_LD_FLAGS += -v -#CLEAN_EXTRA += $(BUILD) - $(BUILD)/wasm.c: $(WASM) $(Q)$(MKDIR) -p $(BUILD) $(ECHO) "W2C $<" diff --git a/run-tests.sh b/run-tests.sh index fac872e..8943ada 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -7,8 +7,6 @@ set -e export PATH=.:$PATH -mpremote mkdir :lib 2>&1 >/dev/null || true - for APP in assemblyscript cpp rust tinygo zig virgil wat coremark; do echo "======================================" echo " Building $APP.mpy ..." @@ -19,7 +17,7 @@ for APP in assemblyscript cpp rust tinygo zig virgil wat coremark; do if [[ $ARCH == @(x64|x86) ]]; then micropython-$ARCH -c "import $APP as app; app.setup(); app.loop(); app.loop()" else - mpremote cp $APP.mpy :lib/ 2>&1 >/dev/null + mpremote cp $APP.mpy : 2>&1 >/dev/null mpremote exec "import $APP as app; app.setup(); app.loop(); app.loop()" || true fi echo diff --git a/runtime/libc.c b/runtime/libc.c index ab6a6a9..f6bcf91 100644 --- a/runtime/libc.c +++ b/runtime/libc.c @@ -3,11 +3,15 @@ * Created: 24.08.2024 **/ +// define errno before any includes so it gets into BSS +int errno; + #include "py/dynruntime.h" #include #include #include +#include void *calloc(size_t num, size_t size) { void *ptr = m_malloc(num * size); @@ -54,8 +58,6 @@ int strncmp(const char *_l, const char *_r, size_t n) { return *l - *r; } -int errno; - int *__errno(void) { return &errno; }