diff options
Diffstat (limited to 'create_tools')
-rw-r--r-- | create_tools/config/0001-Mod-micropython.patch | 82 | ||||
-rwxr-xr-x | create_tools/create_micropython.sh | 25 | ||||
-rwxr-xr-x | create_tools/tools_download.sh | 3 |
3 files changed, 109 insertions, 1 deletions
diff --git a/create_tools/config/0001-Mod-micropython.patch b/create_tools/config/0001-Mod-micropython.patch new file mode 100644 index 0000000..0df5d8e --- /dev/null +++ b/create_tools/config/0001-Mod-micropython.patch @@ -0,0 +1,82 @@ +From bd97b42bdae5685571eaeb077232500c6dfd6234 Mon Sep 17 00:00:00 2001 +From: Arturs Artamonovs <dos21h@gmail.com> +Date: Thu, 31 Aug 2023 09:25:05 +0100 +Subject: [PATCH] Mod micropython + +--- + ports/unix/Makefile | 8 ++++---- + ports/unix/mpconfigport.mk | 6 +++--- + py/stackctrl.c | 2 ++ + 3 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/ports/unix/Makefile b/ports/unix/Makefile +index 403405dcc..116b9f658 100644 +--- a/ports/unix/Makefile ++++ b/ports/unix/Makefile +@@ -44,9 +44,9 @@ INC += -I$(TOP) + INC += -I$(BUILD) + + # compiler settings +-CWARN = -Wall -Werror ++CWARN = -Wall + CWARN += -Wextra -Wno-unused-parameter -Wpointer-arith -Wdouble-promotion -Wfloat-conversion +-CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) ++CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) -static + + # Debugging/Optimization + ifdef DEBUG +@@ -102,10 +102,10 @@ else + CC = clang + endif + # Use clang syntax for map file +-LDFLAGS_ARCH = -Wl,-map,$@.map -Wl,-dead_strip ++LDFLAGS_ARCH = -Wl,-map,$@.map -Wl,-dead_strip -static + else + # Use gcc syntax for map file +-LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref -Wl,--gc-sections ++LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref -Wl,--gc-sections -static + endif + LDFLAGS += $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA) + +diff --git a/ports/unix/mpconfigport.mk b/ports/unix/mpconfigport.mk +index ce6183c13..11fbbb7b2 100644 +--- a/ports/unix/mpconfigport.mk ++++ b/ports/unix/mpconfigport.mk +@@ -18,10 +18,10 @@ MICROPY_PY_THREAD = 1 + MICROPY_PY_TERMIOS = 1 + + # Subset of CPython socket module +-MICROPY_PY_SOCKET = 1 ++MICROPY_PY_SOCKET = 0 + + # ffi module requires libffi (libffi-dev Debian package) +-MICROPY_PY_FFI = 1 ++MICROPY_PY_FFI = 0 + + # ussl module requires one of the TLS libraries below + MICROPY_PY_USSL = 1 +@@ -37,7 +37,7 @@ MICROPY_PY_JNI = 0 + + # Avoid using system libraries, use copies bundled with MicroPython + # as submodules (currently affects only libffi). +-MICROPY_STANDALONE = 0 ++MICROPY_STANDALONE = 1 + + MICROPY_ROM_TEXT_COMPRESSION = 1 + +diff --git a/py/stackctrl.c b/py/stackctrl.c +index c2f3adb5e..4675532ad 100644 +--- a/py/stackctrl.c ++++ b/py/stackctrl.c +@@ -27,6 +27,8 @@ + #include "py/runtime.h" + #include "py/stackctrl.h" + ++#pragma GCC diagnostic ignored "-Wdangling-pointer=1" ++ + void mp_stack_ctrl_init(void) { + volatile int stack_dummy; + MP_STATE_THREAD(stack_top) = (char *)&stack_dummy; +-- +2.42.0 + diff --git a/create_tools/create_micropython.sh b/create_tools/create_micropython.sh new file mode 100755 index 0000000..0f49dae --- /dev/null +++ b/create_tools/create_micropython.sh @@ -0,0 +1,25 @@ +#!/bin/dash + +SOURCE_DIR=src +MPY_VERSION=1.20.0 + +OUT_DIRECTORY=out + +#prepare +_PWD=`pwd` + +echo "Unarchive busbox" +cd $SOURCE_DIR +tar -xvf micropython-$MPY_VERSION.tar.xz +cd micropython-$MPY_VERSION +#git submodule init +#git submodule update +patch -p1 < ../../config/0001-Mod-micropython.patch +cd ports/unix +make submodules +make -j4 + +#save result +echo "Copy result to out" +cp ./build-standard/micropython ../../../../$OUT_DIRECTORY + diff --git a/create_tools/tools_download.sh b/create_tools/tools_download.sh index e48c536..99597e3 100755 --- a/create_tools/tools_download.sh +++ b/create_tools/tools_download.sh @@ -5,5 +5,6 @@ echo "Download tools" cd src wget -c http://busybox.net/downloads/busybox-1.36.1.tar.bz2 wget -c https://github.com/arsv/minibase/archive/0.7.zip -O minibase.zip - +wget -c https://micropython.org/resources/source/micropython-1.20.0.tar.xz +#git clone --branch v1.20.0 https://github.com/micropython/micropython.git micropython-1.20.0 echo "" |