mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[python] Fixed MicroPython emscripten bug.
Micropython did not work because of two problems: - the stack in ascending order on emscripten - if optimized, some variables may be stored in local JavaScript variables, which breaks garbage collection. Change-Id: Ib454e0c4d995e9f5f85370eea758526119b35773
This commit is contained in:
@@ -67,7 +67,6 @@ py_objs = $(addprefix python/src/py/,\
|
||||
runtime_utils.o \
|
||||
scheduler.o \
|
||||
nativeglue.o \
|
||||
stackctrl.o \
|
||||
argcheck.o \
|
||||
warning.o \
|
||||
map.o \
|
||||
@@ -179,8 +178,21 @@ port_objs += $(addprefix python/port/,\
|
||||
modkandinsky.o \
|
||||
modkandinsky_impl.o \
|
||||
mphalport.o \
|
||||
stackctrl.o \
|
||||
)
|
||||
|
||||
# Reduce optimization for the emscripten platform.
|
||||
# With optimization, register and stack variables might be held in a JavaScript
|
||||
# local variable, which breaks garbage collection. Indeed, these JavaScript
|
||||
# variables cannot be marked as root during garbage collection, which means that
|
||||
# the heap objects they depend on will likely be destroyed. When the Python
|
||||
# computing resumes, if necessary heap objects have been destroyed, the Python
|
||||
# program crashes.
|
||||
|
||||
ifeq ($(PLATFORM),emscripten)
|
||||
$(py_objs): SFLAGS := $(subst -Os,-O0,$(SFLAGS))
|
||||
endif
|
||||
|
||||
# QSTR generation
|
||||
|
||||
python/port/genhdr/qstrdefs.generated.h: python/port/genhdr/qstrdefs.in.h
|
||||
|
||||
Reference in New Issue
Block a user