Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Sep 18, 2024
1 parent 274b776 commit 7bff108
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<"
Expand Down
4 changes: 1 addition & 3 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..."
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions runtime/libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

void *calloc(size_t num, size_t size) {
void *ptr = m_malloc(num * size);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 7bff108

Please sign in to comment.