summaryrefslogtreecommitdiff
path: root/create_tools/config/0001-Mod-micropython.patch
blob: 0df5d8eb3faf0bf610f1ecb8328f4dae3de07caf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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