mirror of
https://github.com/pyenv/pyenv.git
synced 2026-06-06 00:48:13 +09:00
Add micropython 1.22.0 to 1.28.0; add downstream patches to fix compilation errors (#3460)
This commit is contained in:
parent
874b27c749
commit
7f1139ebe6
@ -0,0 +1 @@
|
||||
install_package micropython-1.22.0 https://micropython.org/resources/source/micropython-1.22.0.tar.xz#a042764f0b6f6d92b267454c5bd5afcb83fc3900119f2583672aac571e661924 micropython
|
||||
@ -0,0 +1 @@
|
||||
install_package micropython-1.23.0 https://micropython.org/resources/source/micropython-1.23.0.tar.xz#0ab283c2fc98d466c1ff26692bee46abaeeab55d488a36fc3cb6372cb8fb390d micropython
|
||||
@ -0,0 +1 @@
|
||||
install_package micropython-1.24.0 https://micropython.org/resources/source/micropython-1.24.0.tar.xz#cde2a6795280945100089c053ba85f842d85f3038229d743da35a3673bc1786b micropython
|
||||
@ -0,0 +1 @@
|
||||
install_package micropython-1.25.0 https://micropython.org/resources/source/micropython-1.25.0.tar.xz#9fe99ad5808e66bb40d374f5cad187c32c7d1c49cf47f72b38fd453c28c2aebe micropython
|
||||
@ -0,0 +1 @@
|
||||
install_package micropython-1.26.0 https://micropython.org/resources/source/micropython-1.26.0.tar.xz#a1b8e0f6bf7a8a78b55ac865c46c4c45f9623a86a1785d2063ff1cb3b6e661d7 micropython
|
||||
@ -0,0 +1 @@
|
||||
install_package micropython-1.27.0 https://micropython.org/resources/source/micropython-1.27.0.tar.xz#9874b20646c3bbe81d524f779a16875e5d088b7065e175ffd2aa2a02f50573c9 micropython
|
||||
@ -0,0 +1 @@
|
||||
install_package micropython-1.28.0 https://micropython.org/resources/source/micropython-1.28.0.tar.xz#4e43c59657b8da33b4bc503509a827cc3ea6cb66c446475c57776cf4467ba215 micropython
|
||||
@ -0,0 +1,34 @@
|
||||
From f4fd023eb978b298add7883ab2e8429560ef0b12 Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Epler <jepler@unpythonic.net>
|
||||
Date: Sat, 27 Sep 2025 19:29:49 -0500
|
||||
Subject: [PATCH 1/5] py/misc: Don't warn about a GNU extension for static
|
||||
assert macro.
|
||||
|
||||
This warning was enabled by default on clang 17.0.0 on macOS 26. Disable
|
||||
it, because we want to make these checks at compile-time even if it
|
||||
requires an extension.
|
||||
|
||||
Fixes issue #18116.
|
||||
|
||||
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
||||
---
|
||||
py/misc.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/py/misc.h b/py/misc.h
|
||||
index e19a53572..ba1afbc15 100644
|
||||
--- a/py/misc.h
|
||||
+++ b/py/misc.h
|
||||
@@ -51,6 +51,9 @@ typedef unsigned int uint;
|
||||
#define MP_STRINGIFY(x) MP_STRINGIFY_HELPER(x)
|
||||
|
||||
// Static assertion macro
|
||||
+#if __clang__
|
||||
+#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
|
||||
+#endif
|
||||
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
|
||||
// In C++ things like comparing extern const pointers are not constant-expressions so cannot be used
|
||||
// in MP_STATIC_ASSERT. Note that not all possible compiler versions will reject this. Some gcc versions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
From 67b977ebab060285c20d222d104bb3f3a17656d7 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:36:05 +1000
|
||||
Subject: [PATCH 2/5] py/emitinlinethumb: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
py/emitinlinethumb.c | 108 +++++++++++++++++++++----------------------
|
||||
1 file changed, 54 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c
|
||||
index 29487f104..0b9efa1da 100644
|
||||
--- a/py/emitinlinethumb.c
|
||||
+++ b/py/emitinlinethumb.c
|
||||
@@ -150,27 +150,27 @@ typedef struct _reg_name_t { byte reg;
|
||||
byte name[3];
|
||||
} reg_name_t;
|
||||
STATIC const reg_name_t reg_name_table[] = {
|
||||
- {0, "r0\0"},
|
||||
- {1, "r1\0"},
|
||||
- {2, "r2\0"},
|
||||
- {3, "r3\0"},
|
||||
- {4, "r4\0"},
|
||||
- {5, "r5\0"},
|
||||
- {6, "r6\0"},
|
||||
- {7, "r7\0"},
|
||||
- {8, "r8\0"},
|
||||
- {9, "r9\0"},
|
||||
- {10, "r10"},
|
||||
- {11, "r11"},
|
||||
- {12, "r12"},
|
||||
- {13, "r13"},
|
||||
- {14, "r14"},
|
||||
- {15, "r15"},
|
||||
- {10, "sl\0"},
|
||||
- {11, "fp\0"},
|
||||
- {13, "sp\0"},
|
||||
- {14, "lr\0"},
|
||||
- {15, "pc\0"},
|
||||
+ {0, {'r', '0' }},
|
||||
+ {1, {'r', '1' }},
|
||||
+ {2, {'r', '2' }},
|
||||
+ {3, {'r', '3' }},
|
||||
+ {4, {'r', '4' }},
|
||||
+ {5, {'r', '5' }},
|
||||
+ {6, {'r', '6' }},
|
||||
+ {7, {'r', '7' }},
|
||||
+ {8, {'r', '8' }},
|
||||
+ {9, {'r', '9' }},
|
||||
+ {10, {'r', '1', '0' }},
|
||||
+ {11, {'r', '1', '1' }},
|
||||
+ {12, {'r', '1', '2' }},
|
||||
+ {13, {'r', '1', '3' }},
|
||||
+ {14, {'r', '1', '4' }},
|
||||
+ {15, {'r', '1', '5' }},
|
||||
+ {10, {'s', 'l' }},
|
||||
+ {11, {'f', 'p' }},
|
||||
+ {13, {'s', 'p' }},
|
||||
+ {14, {'l', 'r' }},
|
||||
+ {15, {'p', 'c' }},
|
||||
};
|
||||
|
||||
#define MAX_SPECIAL_REGISTER_NAME_LENGTH 7
|
||||
@@ -368,20 +368,20 @@ typedef struct _cc_name_t { byte cc;
|
||||
byte name[2];
|
||||
} cc_name_t;
|
||||
STATIC const cc_name_t cc_name_table[] = {
|
||||
- { ASM_THUMB_CC_EQ, "eq" },
|
||||
- { ASM_THUMB_CC_NE, "ne" },
|
||||
- { ASM_THUMB_CC_CS, "cs" },
|
||||
- { ASM_THUMB_CC_CC, "cc" },
|
||||
- { ASM_THUMB_CC_MI, "mi" },
|
||||
- { ASM_THUMB_CC_PL, "pl" },
|
||||
- { ASM_THUMB_CC_VS, "vs" },
|
||||
- { ASM_THUMB_CC_VC, "vc" },
|
||||
- { ASM_THUMB_CC_HI, "hi" },
|
||||
- { ASM_THUMB_CC_LS, "ls" },
|
||||
- { ASM_THUMB_CC_GE, "ge" },
|
||||
- { ASM_THUMB_CC_LT, "lt" },
|
||||
- { ASM_THUMB_CC_GT, "gt" },
|
||||
- { ASM_THUMB_CC_LE, "le" },
|
||||
+ { ASM_THUMB_CC_EQ, { 'e', 'q' }},
|
||||
+ { ASM_THUMB_CC_NE, { 'n', 'e' }},
|
||||
+ { ASM_THUMB_CC_CS, { 'c', 's' }},
|
||||
+ { ASM_THUMB_CC_CC, { 'c', 'c' }},
|
||||
+ { ASM_THUMB_CC_MI, { 'm', 'i' }},
|
||||
+ { ASM_THUMB_CC_PL, { 'p', 'l' }},
|
||||
+ { ASM_THUMB_CC_VS, { 'v', 's' }},
|
||||
+ { ASM_THUMB_CC_VC, { 'v', 'c' }},
|
||||
+ { ASM_THUMB_CC_HI, { 'h', 'i' }},
|
||||
+ { ASM_THUMB_CC_LS, { 'l', 's' }},
|
||||
+ { ASM_THUMB_CC_GE, { 'g', 'e' }},
|
||||
+ { ASM_THUMB_CC_LT, { 'l', 't' }},
|
||||
+ { ASM_THUMB_CC_GT, { 'g', 't' }},
|
||||
+ { ASM_THUMB_CC_LE, { 'l', 'e' }},
|
||||
};
|
||||
|
||||
typedef struct _format_4_op_t { byte op;
|
||||
@@ -389,21 +389,21 @@ typedef struct _format_4_op_t { byte op;
|
||||
} format_4_op_t;
|
||||
#define X(x) (((x) >> 4) & 0xff) // only need 1 byte to distinguish these ops
|
||||
STATIC const format_4_op_t format_4_op_table[] = {
|
||||
- { X(ASM_THUMB_FORMAT_4_EOR), "eor" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSL), "lsl" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSR), "lsr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ASR), "asr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ADC), "adc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_SBC), "sbc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ROR), "ror" },
|
||||
- { X(ASM_THUMB_FORMAT_4_TST), "tst" },
|
||||
- { X(ASM_THUMB_FORMAT_4_NEG), "neg" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMP), "cmp" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMN), "cmn" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ORR), "orr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MUL), "mul" },
|
||||
- { X(ASM_THUMB_FORMAT_4_BIC), "bic" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MVN), "mvn" },
|
||||
+ { X(ASM_THUMB_FORMAT_4_EOR), {'e', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSL), {'l', 's', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSR), {'l', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ASR), {'a', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ADC), {'a', 'd', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_SBC), {'s', 'b', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ROR), {'r', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_TST), {'t', 's', 't' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_NEG), {'n', 'e', 'g' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMP), {'c', 'm', 'p' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMN), {'c', 'm', 'n' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ORR), {'o', 'r', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MUL), {'m', 'u', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_BIC), {'b', 'i', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MVN), {'m', 'v', 'n' }},
|
||||
};
|
||||
#undef X
|
||||
|
||||
@@ -428,10 +428,10 @@ typedef struct _format_vfp_op_t {
|
||||
char name[3];
|
||||
} format_vfp_op_t;
|
||||
STATIC const format_vfp_op_t format_vfp_op_table[] = {
|
||||
- { 0x30, "add" },
|
||||
- { 0x34, "sub" },
|
||||
- { 0x20, "mul" },
|
||||
- { 0x80, "div" },
|
||||
+ { 0x30, {'a', 'd', 'd' }},
|
||||
+ { 0x34, {'s', 'u', 'b' }},
|
||||
+ { 0x20, {'m', 'u', 'l' }},
|
||||
+ { 0x80, {'d', 'i', 'v' }},
|
||||
};
|
||||
|
||||
// shorthand alias for whether we allow ARMv7-M instructions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From a792bf8c58f1e1c63a65bc867bac75a93d496cac Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:34:37 +1000
|
||||
Subject: [PATCH 3/5] extmod/moductypes: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
Also split out the duplicate string to a top-level array (probably the
|
||||
duplicate string literal was interned, so unlikely to have any impact.)
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
extmod/moductypes.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
|
||||
index f56567107..87fd5fb69 100644
|
||||
--- a/extmod/moductypes.c
|
||||
+++ b/extmod/moductypes.c
|
||||
@@ -264,15 +264,18 @@ STATIC mp_obj_t uctypes_struct_sizeof(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uctypes_struct_sizeof_obj, 1, 2, uctypes_struct_sizeof);
|
||||
|
||||
+static const char type2char[16] = {
|
||||
+ 'B', 'b', 'H', 'h', 'I', 'i', 'Q', 'q',
|
||||
+ '-', '-', '-', '-', '-', '-', 'f', 'd'
|
||||
+};
|
||||
+
|
||||
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
return mp_binary_get_val(struct_type, type2char[val_type], p, &p);
|
||||
}
|
||||
|
||||
static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
mp_binary_set_val(struct_type, type2char[val_type], val, p, &p);
|
||||
}
|
||||
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
From 933867777002e4652a8e73efe8dafd5f48db771e Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Pozdeev <vano@mail.mipt.ru>
|
||||
Date: Sat, 30 May 2026 13:26:40 +0300
|
||||
Subject: [PATCH 4/5] (downstream) Avoids the new Wunterminated-string-literal
|
||||
when compiled with gcc 15.1.
|
||||
|
||||
---
|
||||
py/emitinlinextensa.c | 32 ++++++++++++++++----------------
|
||||
1 file changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinextensa.c b/py/emitinlinextensa.c
|
||||
index 5dac2ae39..f233c59e1 100644
|
||||
--- a/py/emitinlinextensa.c
|
||||
+++ b/py/emitinlinextensa.c
|
||||
@@ -119,22 +119,22 @@ typedef struct _reg_name_t { byte reg;
|
||||
byte name[3];
|
||||
} reg_name_t;
|
||||
STATIC const reg_name_t reg_name_table[] = {
|
||||
- {0, "a0\0"},
|
||||
- {1, "a1\0"},
|
||||
- {2, "a2\0"},
|
||||
- {3, "a3\0"},
|
||||
- {4, "a4\0"},
|
||||
- {5, "a5\0"},
|
||||
- {6, "a6\0"},
|
||||
- {7, "a7\0"},
|
||||
- {8, "a8\0"},
|
||||
- {9, "a9\0"},
|
||||
- {10, "a10"},
|
||||
- {11, "a11"},
|
||||
- {12, "a12"},
|
||||
- {13, "a13"},
|
||||
- {14, "a14"},
|
||||
- {15, "a15"},
|
||||
+ {0, {'a', '0' }},
|
||||
+ {1, {'a', '1' }},
|
||||
+ {2, {'a', '2' }},
|
||||
+ {3, {'a', '3' }},
|
||||
+ {4, {'a', '4' }},
|
||||
+ {5, {'a', '5' }},
|
||||
+ {6, {'a', '6' }},
|
||||
+ {7, {'a', '7' }},
|
||||
+ {8, {'a', '8' }},
|
||||
+ {9, {'a', '9' }},
|
||||
+ {10, {'a', '1', '0' }},
|
||||
+ {11, {'a', '1', '1' }},
|
||||
+ {12, {'a', '1', '2' }},
|
||||
+ {13, {'a', '1', '3' }},
|
||||
+ {14, {'a', '1', '4' }},
|
||||
+ {15, {'a', '1', '5' }},
|
||||
};
|
||||
|
||||
// return empty string in case of error, so we can attempt to parse the string
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 2286de72aa797d48dbbe2764a06165441d2ad049 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 14:34:09 +1000
|
||||
Subject: [PATCH 5/5] lib/littlefs: Fix string initializer in lfs1.c.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
It would be preferable to just disable this warning, but Clang
|
||||
-Wunknown-warning-option kicks in even when disabling warnings so this
|
||||
becomes fiddly to apply.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
lib/littlefs/lfs1.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/littlefs/lfs1.c b/lib/littlefs/lfs1.c
|
||||
index 6a3fd6700..ec18dc470 100644
|
||||
--- a/lib/littlefs/lfs1.c
|
||||
+++ b/lib/littlefs/lfs1.c
|
||||
@@ -2141,7 +2141,7 @@ int lfs1_format(lfs1_t *lfs1, const struct lfs1_config *cfg) {
|
||||
.d.elen = sizeof(superblock.d) - sizeof(superblock.d.magic) - 4,
|
||||
.d.nlen = sizeof(superblock.d.magic),
|
||||
.d.version = LFS1_DISK_VERSION,
|
||||
- .d.magic = {"littlefs"},
|
||||
+ .d.magic = {'l', 'i', 't', 't', 'l', 'e', 'f', 's'},
|
||||
.d.block_size = lfs1->cfg->block_size,
|
||||
.d.block_count = lfs1->cfg->block_count,
|
||||
.d.root = {lfs1->root[0], lfs1->root[1]},
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 8a2f70ad0a0d4aa58d009c974da66b367bf50418 Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Epler <jepler@unpythonic.net>
|
||||
Date: Sat, 27 Sep 2025 19:29:49 -0500
|
||||
Subject: [PATCH 1/5] py/misc: Don't warn about a GNU extension for static
|
||||
assert macro.
|
||||
|
||||
This warning was enabled by default on clang 17.0.0 on macOS 26. Disable
|
||||
it, because we want to make these checks at compile-time even if it
|
||||
requires an extension.
|
||||
|
||||
Fixes issue #18116.
|
||||
|
||||
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
||||
---
|
||||
py/misc.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/py/misc.h b/py/misc.h
|
||||
index eea3e8b0f..7b6a24c5c 100644
|
||||
--- a/py/misc.h
|
||||
+++ b/py/misc.h
|
||||
@@ -51,6 +51,9 @@ typedef unsigned int uint;
|
||||
#define MP_STRINGIFY(x) MP_STRINGIFY_HELPER(x)
|
||||
|
||||
// Static assertion macro
|
||||
+#if __clang__
|
||||
+#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
|
||||
+#endif
|
||||
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
|
||||
// In C++ things like comparing extern const pointers are not constant-expressions so cannot be used
|
||||
// in MP_STATIC_ASSERT. Note that not all possible compiler versions will reject this. Some gcc versions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
From 6800cd400e3c5b3881982a9a84d77a8cdb5e09be Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:36:05 +1000
|
||||
Subject: [PATCH 2/5] py/emitinlinethumb: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
py/emitinlinethumb.c | 108 +++++++++++++++++++++----------------------
|
||||
1 file changed, 54 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c
|
||||
index 7818bb4f4..d6596337a 100644
|
||||
--- a/py/emitinlinethumb.c
|
||||
+++ b/py/emitinlinethumb.c
|
||||
@@ -150,27 +150,27 @@ typedef struct _reg_name_t { byte reg;
|
||||
byte name[3];
|
||||
} reg_name_t;
|
||||
static const reg_name_t reg_name_table[] = {
|
||||
- {0, "r0\0"},
|
||||
- {1, "r1\0"},
|
||||
- {2, "r2\0"},
|
||||
- {3, "r3\0"},
|
||||
- {4, "r4\0"},
|
||||
- {5, "r5\0"},
|
||||
- {6, "r6\0"},
|
||||
- {7, "r7\0"},
|
||||
- {8, "r8\0"},
|
||||
- {9, "r9\0"},
|
||||
- {10, "r10"},
|
||||
- {11, "r11"},
|
||||
- {12, "r12"},
|
||||
- {13, "r13"},
|
||||
- {14, "r14"},
|
||||
- {15, "r15"},
|
||||
- {10, "sl\0"},
|
||||
- {11, "fp\0"},
|
||||
- {13, "sp\0"},
|
||||
- {14, "lr\0"},
|
||||
- {15, "pc\0"},
|
||||
+ {0, {'r', '0' }},
|
||||
+ {1, {'r', '1' }},
|
||||
+ {2, {'r', '2' }},
|
||||
+ {3, {'r', '3' }},
|
||||
+ {4, {'r', '4' }},
|
||||
+ {5, {'r', '5' }},
|
||||
+ {6, {'r', '6' }},
|
||||
+ {7, {'r', '7' }},
|
||||
+ {8, {'r', '8' }},
|
||||
+ {9, {'r', '9' }},
|
||||
+ {10, {'r', '1', '0' }},
|
||||
+ {11, {'r', '1', '1' }},
|
||||
+ {12, {'r', '1', '2' }},
|
||||
+ {13, {'r', '1', '3' }},
|
||||
+ {14, {'r', '1', '4' }},
|
||||
+ {15, {'r', '1', '5' }},
|
||||
+ {10, {'s', 'l' }},
|
||||
+ {11, {'f', 'p' }},
|
||||
+ {13, {'s', 'p' }},
|
||||
+ {14, {'l', 'r' }},
|
||||
+ {15, {'p', 'c' }},
|
||||
};
|
||||
|
||||
#define MAX_SPECIAL_REGISTER_NAME_LENGTH 7
|
||||
@@ -368,20 +368,20 @@ typedef struct _cc_name_t { byte cc;
|
||||
byte name[2];
|
||||
} cc_name_t;
|
||||
static const cc_name_t cc_name_table[] = {
|
||||
- { ASM_THUMB_CC_EQ, "eq" },
|
||||
- { ASM_THUMB_CC_NE, "ne" },
|
||||
- { ASM_THUMB_CC_CS, "cs" },
|
||||
- { ASM_THUMB_CC_CC, "cc" },
|
||||
- { ASM_THUMB_CC_MI, "mi" },
|
||||
- { ASM_THUMB_CC_PL, "pl" },
|
||||
- { ASM_THUMB_CC_VS, "vs" },
|
||||
- { ASM_THUMB_CC_VC, "vc" },
|
||||
- { ASM_THUMB_CC_HI, "hi" },
|
||||
- { ASM_THUMB_CC_LS, "ls" },
|
||||
- { ASM_THUMB_CC_GE, "ge" },
|
||||
- { ASM_THUMB_CC_LT, "lt" },
|
||||
- { ASM_THUMB_CC_GT, "gt" },
|
||||
- { ASM_THUMB_CC_LE, "le" },
|
||||
+ { ASM_THUMB_CC_EQ, { 'e', 'q' }},
|
||||
+ { ASM_THUMB_CC_NE, { 'n', 'e' }},
|
||||
+ { ASM_THUMB_CC_CS, { 'c', 's' }},
|
||||
+ { ASM_THUMB_CC_CC, { 'c', 'c' }},
|
||||
+ { ASM_THUMB_CC_MI, { 'm', 'i' }},
|
||||
+ { ASM_THUMB_CC_PL, { 'p', 'l' }},
|
||||
+ { ASM_THUMB_CC_VS, { 'v', 's' }},
|
||||
+ { ASM_THUMB_CC_VC, { 'v', 'c' }},
|
||||
+ { ASM_THUMB_CC_HI, { 'h', 'i' }},
|
||||
+ { ASM_THUMB_CC_LS, { 'l', 's' }},
|
||||
+ { ASM_THUMB_CC_GE, { 'g', 'e' }},
|
||||
+ { ASM_THUMB_CC_LT, { 'l', 't' }},
|
||||
+ { ASM_THUMB_CC_GT, { 'g', 't' }},
|
||||
+ { ASM_THUMB_CC_LE, { 'l', 'e' }},
|
||||
};
|
||||
|
||||
typedef struct _format_4_op_t { byte op;
|
||||
@@ -389,21 +389,21 @@ typedef struct _format_4_op_t { byte op;
|
||||
} format_4_op_t;
|
||||
#define X(x) (((x) >> 4) & 0xff) // only need 1 byte to distinguish these ops
|
||||
static const format_4_op_t format_4_op_table[] = {
|
||||
- { X(ASM_THUMB_FORMAT_4_EOR), "eor" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSL), "lsl" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSR), "lsr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ASR), "asr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ADC), "adc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_SBC), "sbc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ROR), "ror" },
|
||||
- { X(ASM_THUMB_FORMAT_4_TST), "tst" },
|
||||
- { X(ASM_THUMB_FORMAT_4_NEG), "neg" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMP), "cmp" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMN), "cmn" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ORR), "orr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MUL), "mul" },
|
||||
- { X(ASM_THUMB_FORMAT_4_BIC), "bic" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MVN), "mvn" },
|
||||
+ { X(ASM_THUMB_FORMAT_4_EOR), {'e', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSL), {'l', 's', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSR), {'l', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ASR), {'a', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ADC), {'a', 'd', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_SBC), {'s', 'b', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ROR), {'r', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_TST), {'t', 's', 't' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_NEG), {'n', 'e', 'g' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMP), {'c', 'm', 'p' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMN), {'c', 'm', 'n' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ORR), {'o', 'r', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MUL), {'m', 'u', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_BIC), {'b', 'i', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MVN), {'m', 'v', 'n' }},
|
||||
};
|
||||
#undef X
|
||||
|
||||
@@ -428,10 +428,10 @@ typedef struct _format_vfp_op_t {
|
||||
char name[3];
|
||||
} format_vfp_op_t;
|
||||
static const format_vfp_op_t format_vfp_op_table[] = {
|
||||
- { 0x30, "add" },
|
||||
- { 0x34, "sub" },
|
||||
- { 0x20, "mul" },
|
||||
- { 0x80, "div" },
|
||||
+ { 0x30, {'a', 'd', 'd' }},
|
||||
+ { 0x34, {'s', 'u', 'b' }},
|
||||
+ { 0x20, {'m', 'u', 'l' }},
|
||||
+ { 0x80, {'d', 'i', 'v' }},
|
||||
};
|
||||
|
||||
// shorthand alias for whether we allow ARMv7-M instructions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 562667562772f6507c2bb454fe15b7a259134305 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:34:37 +1000
|
||||
Subject: [PATCH 3/5] extmod/moductypes: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
Also split out the duplicate string to a top-level array (probably the
|
||||
duplicate string literal was interned, so unlikely to have any impact.)
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
extmod/moductypes.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
|
||||
index fa743eb63..ad022099e 100644
|
||||
--- a/extmod/moductypes.c
|
||||
+++ b/extmod/moductypes.c
|
||||
@@ -264,15 +264,18 @@ static mp_obj_t uctypes_struct_sizeof(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uctypes_struct_sizeof_obj, 1, 2, uctypes_struct_sizeof);
|
||||
|
||||
+static const char type2char[16] = {
|
||||
+ 'B', 'b', 'H', 'h', 'I', 'i', 'Q', 'q',
|
||||
+ '-', '-', '-', '-', '-', '-', 'f', 'd'
|
||||
+};
|
||||
+
|
||||
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
return mp_binary_get_val(struct_type, type2char[val_type], p, &p);
|
||||
}
|
||||
|
||||
static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
mp_binary_set_val(struct_type, type2char[val_type], val, p, &p);
|
||||
}
|
||||
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
From acd88980b95f8e6e331310b9f6154f6423464840 Mon Sep 17 00:00:00 2001
|
||||
From: Alessandro Gatti <a.gatti@frob.it>
|
||||
Date: Tue, 28 Jan 2025 14:58:29 +0100
|
||||
Subject: [PATCH 4/5] py/emitinlinextensa: Simplify register name lookup.
|
||||
|
||||
This commit changes the Xtensa inline assembly parser to use a slightly
|
||||
simpler (and probably a tiny bit more efficient) way to look up register
|
||||
names when decoding instruction parameters.
|
||||
|
||||
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
||||
---
|
||||
py/emitinlinextensa.c | 49 +++++++++----------------------------------
|
||||
1 file changed, 10 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinextensa.c b/py/emitinlinextensa.c
|
||||
index 57056d597..fed259cfc 100644
|
||||
--- a/py/emitinlinextensa.c
|
||||
+++ b/py/emitinlinextensa.c
|
||||
@@ -115,50 +115,21 @@ static bool emit_inline_xtensa_label(emit_inline_asm_t *emit, mp_uint_t label_nu
|
||||
return true;
|
||||
}
|
||||
|
||||
-typedef struct _reg_name_t { byte reg;
|
||||
- byte name[3];
|
||||
-} reg_name_t;
|
||||
-static const reg_name_t reg_name_table[] = {
|
||||
- {0, "a0\0"},
|
||||
- {1, "a1\0"},
|
||||
- {2, "a2\0"},
|
||||
- {3, "a3\0"},
|
||||
- {4, "a4\0"},
|
||||
- {5, "a5\0"},
|
||||
- {6, "a6\0"},
|
||||
- {7, "a7\0"},
|
||||
- {8, "a8\0"},
|
||||
- {9, "a9\0"},
|
||||
- {10, "a10"},
|
||||
- {11, "a11"},
|
||||
- {12, "a12"},
|
||||
- {13, "a13"},
|
||||
- {14, "a14"},
|
||||
- {15, "a15"},
|
||||
+static const qstr_short_t REGISTERS[16] = {
|
||||
+ MP_QSTR_a0, MP_QSTR_a1, MP_QSTR_a2, MP_QSTR_a3, MP_QSTR_a4, MP_QSTR_a5, MP_QSTR_a6, MP_QSTR_a7,
|
||||
+ MP_QSTR_a8, MP_QSTR_a9, MP_QSTR_a10, MP_QSTR_a11, MP_QSTR_a12, MP_QSTR_a13, MP_QSTR_a14, MP_QSTR_a15
|
||||
};
|
||||
|
||||
-// return empty string in case of error, so we can attempt to parse the string
|
||||
-// without a special check if it was in fact a string
|
||||
-static const char *get_arg_str(mp_parse_node_t pn) {
|
||||
- if (MP_PARSE_NODE_IS_ID(pn)) {
|
||||
- qstr qst = MP_PARSE_NODE_LEAF_ARG(pn);
|
||||
- return qstr_str(qst);
|
||||
- } else {
|
||||
- return "";
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static mp_uint_t get_arg_reg(emit_inline_asm_t *emit, const char *op, mp_parse_node_t pn) {
|
||||
- const char *reg_str = get_arg_str(pn);
|
||||
- for (mp_uint_t i = 0; i < MP_ARRAY_SIZE(reg_name_table); i++) {
|
||||
- const reg_name_t *r = ®_name_table[i];
|
||||
- if (reg_str[0] == r->name[0]
|
||||
- && reg_str[1] == r->name[1]
|
||||
- && reg_str[2] == r->name[2]
|
||||
- && (reg_str[2] == '\0' || reg_str[3] == '\0')) {
|
||||
- return r->reg;
|
||||
+ if (MP_PARSE_NODE_IS_ID(pn)) {
|
||||
+ qstr node_qstr = MP_PARSE_NODE_LEAF_ARG(pn);
|
||||
+ for (size_t i = 0; i < MP_ARRAY_SIZE(REGISTERS); i++) {
|
||||
+ if (node_qstr == REGISTERS[i]) {
|
||||
+ return i;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
+
|
||||
emit_inline_xtensa_error_exc(emit,
|
||||
mp_obj_new_exception_msg_varg(&mp_type_SyntaxError,
|
||||
MP_ERROR_TEXT("'%s' expects a register"), op));
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From b043e1847e1fbfa0db3eff73cb3a53b74f5ecc5a Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 14:34:09 +1000
|
||||
Subject: [PATCH 5/5] lib/littlefs: Fix string initializer in lfs1.c.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
It would be preferable to just disable this warning, but Clang
|
||||
-Wunknown-warning-option kicks in even when disabling warnings so this
|
||||
becomes fiddly to apply.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
lib/littlefs/lfs1.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/littlefs/lfs1.c b/lib/littlefs/lfs1.c
|
||||
index 6a3fd6700..ec18dc470 100644
|
||||
--- a/lib/littlefs/lfs1.c
|
||||
+++ b/lib/littlefs/lfs1.c
|
||||
@@ -2141,7 +2141,7 @@ int lfs1_format(lfs1_t *lfs1, const struct lfs1_config *cfg) {
|
||||
.d.elen = sizeof(superblock.d) - sizeof(superblock.d.magic) - 4,
|
||||
.d.nlen = sizeof(superblock.d.magic),
|
||||
.d.version = LFS1_DISK_VERSION,
|
||||
- .d.magic = {"littlefs"},
|
||||
+ .d.magic = {'l', 'i', 't', 't', 'l', 'e', 'f', 's'},
|
||||
.d.block_size = lfs1->cfg->block_size,
|
||||
.d.block_count = lfs1->cfg->block_count,
|
||||
.d.root = {lfs1->root[0], lfs1->root[1]},
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From e292d49b2d421d10f5151e60d3ec593c29e8b0df Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Epler <jepler@unpythonic.net>
|
||||
Date: Sat, 27 Sep 2025 19:29:49 -0500
|
||||
Subject: [PATCH 1/5] py/misc: Don't warn about a GNU extension for static
|
||||
assert macro.
|
||||
|
||||
This warning was enabled by default on clang 17.0.0 on macOS 26. Disable
|
||||
it, because we want to make these checks at compile-time even if it
|
||||
requires an extension.
|
||||
|
||||
Fixes issue #18116.
|
||||
|
||||
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
||||
---
|
||||
py/misc.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/py/misc.h b/py/misc.h
|
||||
index 96b13c151..c1b47f378 100644
|
||||
--- a/py/misc.h
|
||||
+++ b/py/misc.h
|
||||
@@ -51,6 +51,9 @@ typedef unsigned int uint;
|
||||
#define MP_STRINGIFY(x) MP_STRINGIFY_HELPER(x)
|
||||
|
||||
// Static assertion macro
|
||||
+#if __clang__
|
||||
+#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
|
||||
+#endif
|
||||
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
|
||||
// In C++ things like comparing extern const pointers are not constant-expressions so cannot be used
|
||||
// in MP_STATIC_ASSERT. Note that not all possible compiler versions will reject this. Some gcc versions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
From 3f9037e0f94acff12c53bb59068dadc731e8b7c3 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:36:05 +1000
|
||||
Subject: [PATCH 2/5] py/emitinlinethumb: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
py/emitinlinethumb.c | 108 +++++++++++++++++++++----------------------
|
||||
1 file changed, 54 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c
|
||||
index 7818bb4f4..d6596337a 100644
|
||||
--- a/py/emitinlinethumb.c
|
||||
+++ b/py/emitinlinethumb.c
|
||||
@@ -150,27 +150,27 @@ typedef struct _reg_name_t { byte reg;
|
||||
byte name[3];
|
||||
} reg_name_t;
|
||||
static const reg_name_t reg_name_table[] = {
|
||||
- {0, "r0\0"},
|
||||
- {1, "r1\0"},
|
||||
- {2, "r2\0"},
|
||||
- {3, "r3\0"},
|
||||
- {4, "r4\0"},
|
||||
- {5, "r5\0"},
|
||||
- {6, "r6\0"},
|
||||
- {7, "r7\0"},
|
||||
- {8, "r8\0"},
|
||||
- {9, "r9\0"},
|
||||
- {10, "r10"},
|
||||
- {11, "r11"},
|
||||
- {12, "r12"},
|
||||
- {13, "r13"},
|
||||
- {14, "r14"},
|
||||
- {15, "r15"},
|
||||
- {10, "sl\0"},
|
||||
- {11, "fp\0"},
|
||||
- {13, "sp\0"},
|
||||
- {14, "lr\0"},
|
||||
- {15, "pc\0"},
|
||||
+ {0, {'r', '0' }},
|
||||
+ {1, {'r', '1' }},
|
||||
+ {2, {'r', '2' }},
|
||||
+ {3, {'r', '3' }},
|
||||
+ {4, {'r', '4' }},
|
||||
+ {5, {'r', '5' }},
|
||||
+ {6, {'r', '6' }},
|
||||
+ {7, {'r', '7' }},
|
||||
+ {8, {'r', '8' }},
|
||||
+ {9, {'r', '9' }},
|
||||
+ {10, {'r', '1', '0' }},
|
||||
+ {11, {'r', '1', '1' }},
|
||||
+ {12, {'r', '1', '2' }},
|
||||
+ {13, {'r', '1', '3' }},
|
||||
+ {14, {'r', '1', '4' }},
|
||||
+ {15, {'r', '1', '5' }},
|
||||
+ {10, {'s', 'l' }},
|
||||
+ {11, {'f', 'p' }},
|
||||
+ {13, {'s', 'p' }},
|
||||
+ {14, {'l', 'r' }},
|
||||
+ {15, {'p', 'c' }},
|
||||
};
|
||||
|
||||
#define MAX_SPECIAL_REGISTER_NAME_LENGTH 7
|
||||
@@ -368,20 +368,20 @@ typedef struct _cc_name_t { byte cc;
|
||||
byte name[2];
|
||||
} cc_name_t;
|
||||
static const cc_name_t cc_name_table[] = {
|
||||
- { ASM_THUMB_CC_EQ, "eq" },
|
||||
- { ASM_THUMB_CC_NE, "ne" },
|
||||
- { ASM_THUMB_CC_CS, "cs" },
|
||||
- { ASM_THUMB_CC_CC, "cc" },
|
||||
- { ASM_THUMB_CC_MI, "mi" },
|
||||
- { ASM_THUMB_CC_PL, "pl" },
|
||||
- { ASM_THUMB_CC_VS, "vs" },
|
||||
- { ASM_THUMB_CC_VC, "vc" },
|
||||
- { ASM_THUMB_CC_HI, "hi" },
|
||||
- { ASM_THUMB_CC_LS, "ls" },
|
||||
- { ASM_THUMB_CC_GE, "ge" },
|
||||
- { ASM_THUMB_CC_LT, "lt" },
|
||||
- { ASM_THUMB_CC_GT, "gt" },
|
||||
- { ASM_THUMB_CC_LE, "le" },
|
||||
+ { ASM_THUMB_CC_EQ, { 'e', 'q' }},
|
||||
+ { ASM_THUMB_CC_NE, { 'n', 'e' }},
|
||||
+ { ASM_THUMB_CC_CS, { 'c', 's' }},
|
||||
+ { ASM_THUMB_CC_CC, { 'c', 'c' }},
|
||||
+ { ASM_THUMB_CC_MI, { 'm', 'i' }},
|
||||
+ { ASM_THUMB_CC_PL, { 'p', 'l' }},
|
||||
+ { ASM_THUMB_CC_VS, { 'v', 's' }},
|
||||
+ { ASM_THUMB_CC_VC, { 'v', 'c' }},
|
||||
+ { ASM_THUMB_CC_HI, { 'h', 'i' }},
|
||||
+ { ASM_THUMB_CC_LS, { 'l', 's' }},
|
||||
+ { ASM_THUMB_CC_GE, { 'g', 'e' }},
|
||||
+ { ASM_THUMB_CC_LT, { 'l', 't' }},
|
||||
+ { ASM_THUMB_CC_GT, { 'g', 't' }},
|
||||
+ { ASM_THUMB_CC_LE, { 'l', 'e' }},
|
||||
};
|
||||
|
||||
typedef struct _format_4_op_t { byte op;
|
||||
@@ -389,21 +389,21 @@ typedef struct _format_4_op_t { byte op;
|
||||
} format_4_op_t;
|
||||
#define X(x) (((x) >> 4) & 0xff) // only need 1 byte to distinguish these ops
|
||||
static const format_4_op_t format_4_op_table[] = {
|
||||
- { X(ASM_THUMB_FORMAT_4_EOR), "eor" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSL), "lsl" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSR), "lsr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ASR), "asr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ADC), "adc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_SBC), "sbc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ROR), "ror" },
|
||||
- { X(ASM_THUMB_FORMAT_4_TST), "tst" },
|
||||
- { X(ASM_THUMB_FORMAT_4_NEG), "neg" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMP), "cmp" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMN), "cmn" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ORR), "orr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MUL), "mul" },
|
||||
- { X(ASM_THUMB_FORMAT_4_BIC), "bic" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MVN), "mvn" },
|
||||
+ { X(ASM_THUMB_FORMAT_4_EOR), {'e', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSL), {'l', 's', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSR), {'l', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ASR), {'a', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ADC), {'a', 'd', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_SBC), {'s', 'b', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ROR), {'r', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_TST), {'t', 's', 't' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_NEG), {'n', 'e', 'g' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMP), {'c', 'm', 'p' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMN), {'c', 'm', 'n' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ORR), {'o', 'r', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MUL), {'m', 'u', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_BIC), {'b', 'i', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MVN), {'m', 'v', 'n' }},
|
||||
};
|
||||
#undef X
|
||||
|
||||
@@ -428,10 +428,10 @@ typedef struct _format_vfp_op_t {
|
||||
char name[3];
|
||||
} format_vfp_op_t;
|
||||
static const format_vfp_op_t format_vfp_op_table[] = {
|
||||
- { 0x30, "add" },
|
||||
- { 0x34, "sub" },
|
||||
- { 0x20, "mul" },
|
||||
- { 0x80, "div" },
|
||||
+ { 0x30, {'a', 'd', 'd' }},
|
||||
+ { 0x34, {'s', 'u', 'b' }},
|
||||
+ { 0x20, {'m', 'u', 'l' }},
|
||||
+ { 0x80, {'d', 'i', 'v' }},
|
||||
};
|
||||
|
||||
// shorthand alias for whether we allow ARMv7-M instructions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 03778e6bd734eb86aa86bc80356099e8225e1869 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:34:37 +1000
|
||||
Subject: [PATCH 3/5] extmod/moductypes: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
Also split out the duplicate string to a top-level array (probably the
|
||||
duplicate string literal was interned, so unlikely to have any impact.)
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
extmod/moductypes.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
|
||||
index 00a69a275..ab6f4fa78 100644
|
||||
--- a/extmod/moductypes.c
|
||||
+++ b/extmod/moductypes.c
|
||||
@@ -277,15 +277,18 @@ static mp_obj_t uctypes_struct_sizeof(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uctypes_struct_sizeof_obj, 1, 2, uctypes_struct_sizeof);
|
||||
|
||||
+static const char type2char[16] = {
|
||||
+ 'B', 'b', 'H', 'h', 'I', 'i', 'Q', 'q',
|
||||
+ '-', '-', '-', '-', '-', '-', 'f', 'd'
|
||||
+};
|
||||
+
|
||||
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
return mp_binary_get_val(struct_type, type2char[val_type], p, &p);
|
||||
}
|
||||
|
||||
static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
mp_binary_set_val(struct_type, type2char[val_type], val, p, &p);
|
||||
}
|
||||
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
From 3f69689b6685b2a901ebfeea27b00549b895c237 Mon Sep 17 00:00:00 2001
|
||||
From: Alessandro Gatti <a.gatti@frob.it>
|
||||
Date: Tue, 28 Jan 2025 14:58:29 +0100
|
||||
Subject: [PATCH 4/5] py/emitinlinextensa: Simplify register name lookup.
|
||||
|
||||
This commit changes the Xtensa inline assembly parser to use a slightly
|
||||
simpler (and probably a tiny bit more efficient) way to look up register
|
||||
names when decoding instruction parameters.
|
||||
|
||||
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
||||
---
|
||||
py/emitinlinextensa.c | 49 +++++++++----------------------------------
|
||||
1 file changed, 10 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinextensa.c b/py/emitinlinextensa.c
|
||||
index 57056d597..fed259cfc 100644
|
||||
--- a/py/emitinlinextensa.c
|
||||
+++ b/py/emitinlinextensa.c
|
||||
@@ -115,50 +115,21 @@ static bool emit_inline_xtensa_label(emit_inline_asm_t *emit, mp_uint_t label_nu
|
||||
return true;
|
||||
}
|
||||
|
||||
-typedef struct _reg_name_t { byte reg;
|
||||
- byte name[3];
|
||||
-} reg_name_t;
|
||||
-static const reg_name_t reg_name_table[] = {
|
||||
- {0, "a0\0"},
|
||||
- {1, "a1\0"},
|
||||
- {2, "a2\0"},
|
||||
- {3, "a3\0"},
|
||||
- {4, "a4\0"},
|
||||
- {5, "a5\0"},
|
||||
- {6, "a6\0"},
|
||||
- {7, "a7\0"},
|
||||
- {8, "a8\0"},
|
||||
- {9, "a9\0"},
|
||||
- {10, "a10"},
|
||||
- {11, "a11"},
|
||||
- {12, "a12"},
|
||||
- {13, "a13"},
|
||||
- {14, "a14"},
|
||||
- {15, "a15"},
|
||||
+static const qstr_short_t REGISTERS[16] = {
|
||||
+ MP_QSTR_a0, MP_QSTR_a1, MP_QSTR_a2, MP_QSTR_a3, MP_QSTR_a4, MP_QSTR_a5, MP_QSTR_a6, MP_QSTR_a7,
|
||||
+ MP_QSTR_a8, MP_QSTR_a9, MP_QSTR_a10, MP_QSTR_a11, MP_QSTR_a12, MP_QSTR_a13, MP_QSTR_a14, MP_QSTR_a15
|
||||
};
|
||||
|
||||
-// return empty string in case of error, so we can attempt to parse the string
|
||||
-// without a special check if it was in fact a string
|
||||
-static const char *get_arg_str(mp_parse_node_t pn) {
|
||||
- if (MP_PARSE_NODE_IS_ID(pn)) {
|
||||
- qstr qst = MP_PARSE_NODE_LEAF_ARG(pn);
|
||||
- return qstr_str(qst);
|
||||
- } else {
|
||||
- return "";
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static mp_uint_t get_arg_reg(emit_inline_asm_t *emit, const char *op, mp_parse_node_t pn) {
|
||||
- const char *reg_str = get_arg_str(pn);
|
||||
- for (mp_uint_t i = 0; i < MP_ARRAY_SIZE(reg_name_table); i++) {
|
||||
- const reg_name_t *r = ®_name_table[i];
|
||||
- if (reg_str[0] == r->name[0]
|
||||
- && reg_str[1] == r->name[1]
|
||||
- && reg_str[2] == r->name[2]
|
||||
- && (reg_str[2] == '\0' || reg_str[3] == '\0')) {
|
||||
- return r->reg;
|
||||
+ if (MP_PARSE_NODE_IS_ID(pn)) {
|
||||
+ qstr node_qstr = MP_PARSE_NODE_LEAF_ARG(pn);
|
||||
+ for (size_t i = 0; i < MP_ARRAY_SIZE(REGISTERS); i++) {
|
||||
+ if (node_qstr == REGISTERS[i]) {
|
||||
+ return i;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
+
|
||||
emit_inline_xtensa_error_exc(emit,
|
||||
mp_obj_new_exception_msg_varg(&mp_type_SyntaxError,
|
||||
MP_ERROR_TEXT("'%s' expects a register"), op));
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From e4180843f881c3327c998630edad06a104976370 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 14:34:09 +1000
|
||||
Subject: [PATCH 5/5] lib/littlefs: Fix string initializer in lfs1.c.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
It would be preferable to just disable this warning, but Clang
|
||||
-Wunknown-warning-option kicks in even when disabling warnings so this
|
||||
becomes fiddly to apply.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
lib/littlefs/lfs1.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/littlefs/lfs1.c b/lib/littlefs/lfs1.c
|
||||
index 6a3fd6700..ec18dc470 100644
|
||||
--- a/lib/littlefs/lfs1.c
|
||||
+++ b/lib/littlefs/lfs1.c
|
||||
@@ -2141,7 +2141,7 @@ int lfs1_format(lfs1_t *lfs1, const struct lfs1_config *cfg) {
|
||||
.d.elen = sizeof(superblock.d) - sizeof(superblock.d.magic) - 4,
|
||||
.d.nlen = sizeof(superblock.d.magic),
|
||||
.d.version = LFS1_DISK_VERSION,
|
||||
- .d.magic = {"littlefs"},
|
||||
+ .d.magic = {'l', 'i', 't', 't', 'l', 'e', 'f', 's'},
|
||||
.d.block_size = lfs1->cfg->block_size,
|
||||
.d.block_count = lfs1->cfg->block_count,
|
||||
.d.root = {lfs1->root[0], lfs1->root[1]},
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 611ae9adbc89bd7b4b0a4bfb004fc3fa2bd1860e Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Epler <jepler@unpythonic.net>
|
||||
Date: Sat, 27 Sep 2025 19:29:49 -0500
|
||||
Subject: [PATCH 1/4] py/misc: Don't warn about a GNU extension for static
|
||||
assert macro.
|
||||
|
||||
This warning was enabled by default on clang 17.0.0 on macOS 26. Disable
|
||||
it, because we want to make these checks at compile-time even if it
|
||||
requires an extension.
|
||||
|
||||
Fixes issue #18116.
|
||||
|
||||
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
||||
---
|
||||
py/misc.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/py/misc.h b/py/misc.h
|
||||
index e05fbe61a..46495a56d 100644
|
||||
--- a/py/misc.h
|
||||
+++ b/py/misc.h
|
||||
@@ -51,6 +51,9 @@ typedef unsigned int uint;
|
||||
#define MP_STRINGIFY(x) MP_STRINGIFY_HELPER(x)
|
||||
|
||||
// Static assertion macro
|
||||
+#if __clang__
|
||||
+#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
|
||||
+#endif
|
||||
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
|
||||
// In C++ things like comparing extern const pointers are not constant-expressions so cannot be used
|
||||
// in MP_STATIC_ASSERT. Note that not all possible compiler versions will reject this. Some gcc versions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
From 877d65891ac7b46156999cd2004779658ab4b763 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:36:05 +1000
|
||||
Subject: [PATCH 2/4] py/emitinlinethumb: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
py/emitinlinethumb.c | 108 +++++++++++++++++++++----------------------
|
||||
1 file changed, 54 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c
|
||||
index 7818bb4f4..d6596337a 100644
|
||||
--- a/py/emitinlinethumb.c
|
||||
+++ b/py/emitinlinethumb.c
|
||||
@@ -150,27 +150,27 @@ typedef struct _reg_name_t { byte reg;
|
||||
byte name[3];
|
||||
} reg_name_t;
|
||||
static const reg_name_t reg_name_table[] = {
|
||||
- {0, "r0\0"},
|
||||
- {1, "r1\0"},
|
||||
- {2, "r2\0"},
|
||||
- {3, "r3\0"},
|
||||
- {4, "r4\0"},
|
||||
- {5, "r5\0"},
|
||||
- {6, "r6\0"},
|
||||
- {7, "r7\0"},
|
||||
- {8, "r8\0"},
|
||||
- {9, "r9\0"},
|
||||
- {10, "r10"},
|
||||
- {11, "r11"},
|
||||
- {12, "r12"},
|
||||
- {13, "r13"},
|
||||
- {14, "r14"},
|
||||
- {15, "r15"},
|
||||
- {10, "sl\0"},
|
||||
- {11, "fp\0"},
|
||||
- {13, "sp\0"},
|
||||
- {14, "lr\0"},
|
||||
- {15, "pc\0"},
|
||||
+ {0, {'r', '0' }},
|
||||
+ {1, {'r', '1' }},
|
||||
+ {2, {'r', '2' }},
|
||||
+ {3, {'r', '3' }},
|
||||
+ {4, {'r', '4' }},
|
||||
+ {5, {'r', '5' }},
|
||||
+ {6, {'r', '6' }},
|
||||
+ {7, {'r', '7' }},
|
||||
+ {8, {'r', '8' }},
|
||||
+ {9, {'r', '9' }},
|
||||
+ {10, {'r', '1', '0' }},
|
||||
+ {11, {'r', '1', '1' }},
|
||||
+ {12, {'r', '1', '2' }},
|
||||
+ {13, {'r', '1', '3' }},
|
||||
+ {14, {'r', '1', '4' }},
|
||||
+ {15, {'r', '1', '5' }},
|
||||
+ {10, {'s', 'l' }},
|
||||
+ {11, {'f', 'p' }},
|
||||
+ {13, {'s', 'p' }},
|
||||
+ {14, {'l', 'r' }},
|
||||
+ {15, {'p', 'c' }},
|
||||
};
|
||||
|
||||
#define MAX_SPECIAL_REGISTER_NAME_LENGTH 7
|
||||
@@ -368,20 +368,20 @@ typedef struct _cc_name_t { byte cc;
|
||||
byte name[2];
|
||||
} cc_name_t;
|
||||
static const cc_name_t cc_name_table[] = {
|
||||
- { ASM_THUMB_CC_EQ, "eq" },
|
||||
- { ASM_THUMB_CC_NE, "ne" },
|
||||
- { ASM_THUMB_CC_CS, "cs" },
|
||||
- { ASM_THUMB_CC_CC, "cc" },
|
||||
- { ASM_THUMB_CC_MI, "mi" },
|
||||
- { ASM_THUMB_CC_PL, "pl" },
|
||||
- { ASM_THUMB_CC_VS, "vs" },
|
||||
- { ASM_THUMB_CC_VC, "vc" },
|
||||
- { ASM_THUMB_CC_HI, "hi" },
|
||||
- { ASM_THUMB_CC_LS, "ls" },
|
||||
- { ASM_THUMB_CC_GE, "ge" },
|
||||
- { ASM_THUMB_CC_LT, "lt" },
|
||||
- { ASM_THUMB_CC_GT, "gt" },
|
||||
- { ASM_THUMB_CC_LE, "le" },
|
||||
+ { ASM_THUMB_CC_EQ, { 'e', 'q' }},
|
||||
+ { ASM_THUMB_CC_NE, { 'n', 'e' }},
|
||||
+ { ASM_THUMB_CC_CS, { 'c', 's' }},
|
||||
+ { ASM_THUMB_CC_CC, { 'c', 'c' }},
|
||||
+ { ASM_THUMB_CC_MI, { 'm', 'i' }},
|
||||
+ { ASM_THUMB_CC_PL, { 'p', 'l' }},
|
||||
+ { ASM_THUMB_CC_VS, { 'v', 's' }},
|
||||
+ { ASM_THUMB_CC_VC, { 'v', 'c' }},
|
||||
+ { ASM_THUMB_CC_HI, { 'h', 'i' }},
|
||||
+ { ASM_THUMB_CC_LS, { 'l', 's' }},
|
||||
+ { ASM_THUMB_CC_GE, { 'g', 'e' }},
|
||||
+ { ASM_THUMB_CC_LT, { 'l', 't' }},
|
||||
+ { ASM_THUMB_CC_GT, { 'g', 't' }},
|
||||
+ { ASM_THUMB_CC_LE, { 'l', 'e' }},
|
||||
};
|
||||
|
||||
typedef struct _format_4_op_t { byte op;
|
||||
@@ -389,21 +389,21 @@ typedef struct _format_4_op_t { byte op;
|
||||
} format_4_op_t;
|
||||
#define X(x) (((x) >> 4) & 0xff) // only need 1 byte to distinguish these ops
|
||||
static const format_4_op_t format_4_op_table[] = {
|
||||
- { X(ASM_THUMB_FORMAT_4_EOR), "eor" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSL), "lsl" },
|
||||
- { X(ASM_THUMB_FORMAT_4_LSR), "lsr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ASR), "asr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ADC), "adc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_SBC), "sbc" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ROR), "ror" },
|
||||
- { X(ASM_THUMB_FORMAT_4_TST), "tst" },
|
||||
- { X(ASM_THUMB_FORMAT_4_NEG), "neg" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMP), "cmp" },
|
||||
- { X(ASM_THUMB_FORMAT_4_CMN), "cmn" },
|
||||
- { X(ASM_THUMB_FORMAT_4_ORR), "orr" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MUL), "mul" },
|
||||
- { X(ASM_THUMB_FORMAT_4_BIC), "bic" },
|
||||
- { X(ASM_THUMB_FORMAT_4_MVN), "mvn" },
|
||||
+ { X(ASM_THUMB_FORMAT_4_EOR), {'e', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSL), {'l', 's', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_LSR), {'l', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ASR), {'a', 's', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ADC), {'a', 'd', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_SBC), {'s', 'b', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ROR), {'r', 'o', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_TST), {'t', 's', 't' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_NEG), {'n', 'e', 'g' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMP), {'c', 'm', 'p' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_CMN), {'c', 'm', 'n' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_ORR), {'o', 'r', 'r' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MUL), {'m', 'u', 'l' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_BIC), {'b', 'i', 'c' }},
|
||||
+ { X(ASM_THUMB_FORMAT_4_MVN), {'m', 'v', 'n' }},
|
||||
};
|
||||
#undef X
|
||||
|
||||
@@ -428,10 +428,10 @@ typedef struct _format_vfp_op_t {
|
||||
char name[3];
|
||||
} format_vfp_op_t;
|
||||
static const format_vfp_op_t format_vfp_op_table[] = {
|
||||
- { 0x30, "add" },
|
||||
- { 0x34, "sub" },
|
||||
- { 0x20, "mul" },
|
||||
- { 0x80, "div" },
|
||||
+ { 0x30, {'a', 'd', 'd' }},
|
||||
+ { 0x34, {'s', 'u', 'b' }},
|
||||
+ { 0x20, {'m', 'u', 'l' }},
|
||||
+ { 0x80, {'d', 'i', 'v' }},
|
||||
};
|
||||
|
||||
// shorthand alias for whether we allow ARMv7-M instructions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 5692229faee3b5cb8beca027e3240662e4f31629 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 13:34:37 +1000
|
||||
Subject: [PATCH 3/4] extmod/moductypes: Refactor string literal as array
|
||||
initializer.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
Also split out the duplicate string to a top-level array (probably the
|
||||
duplicate string literal was interned, so unlikely to have any impact.)
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
extmod/moductypes.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
|
||||
index bf4579765..54abce79e 100644
|
||||
--- a/extmod/moductypes.c
|
||||
+++ b/extmod/moductypes.c
|
||||
@@ -277,15 +277,18 @@ static mp_obj_t uctypes_struct_sizeof(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uctypes_struct_sizeof_obj, 1, 2, uctypes_struct_sizeof);
|
||||
|
||||
+static const char type2char[16] = {
|
||||
+ 'B', 'b', 'H', 'h', 'I', 'i', 'Q', 'q',
|
||||
+ '-', '-', '-', '-', '-', '-', 'f', 'd'
|
||||
+};
|
||||
+
|
||||
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
return mp_binary_get_val(struct_type, type2char[val_type], p, &p);
|
||||
}
|
||||
|
||||
static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
|
||||
char struct_type = big_endian ? '>' : '<';
|
||||
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||
mp_binary_set_val(struct_type, type2char[val_type], val, p, &p);
|
||||
}
|
||||
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 629e4e36cd4b3c1931dba3fb81ebf45a8cf755cd Mon Sep 17 00:00:00 2001
|
||||
From: Angus Gratton <angus@redyak.com.au>
|
||||
Date: Fri, 9 May 2025 14:34:09 +1000
|
||||
Subject: [PATCH 4/4] lib/littlefs: Fix string initializer in lfs1.c.
|
||||
|
||||
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||
|
||||
It would be preferable to just disable this warning, but Clang
|
||||
-Wunknown-warning-option kicks in even when disabling warnings so this
|
||||
becomes fiddly to apply.
|
||||
|
||||
This work was funded through GitHub Sponsors.
|
||||
|
||||
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||
---
|
||||
lib/littlefs/lfs1.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/littlefs/lfs1.c b/lib/littlefs/lfs1.c
|
||||
index 6a3fd6700..ec18dc470 100644
|
||||
--- a/lib/littlefs/lfs1.c
|
||||
+++ b/lib/littlefs/lfs1.c
|
||||
@@ -2141,7 +2141,7 @@ int lfs1_format(lfs1_t *lfs1, const struct lfs1_config *cfg) {
|
||||
.d.elen = sizeof(superblock.d) - sizeof(superblock.d.magic) - 4,
|
||||
.d.nlen = sizeof(superblock.d.magic),
|
||||
.d.version = LFS1_DISK_VERSION,
|
||||
- .d.magic = {"littlefs"},
|
||||
+ .d.magic = {'l', 'i', 't', 't', 'l', 'e', 'f', 's'},
|
||||
.d.block_size = lfs1->cfg->block_size,
|
||||
.d.block_count = lfs1->cfg->block_count,
|
||||
.d.root = {lfs1->root[0], lfs1->root[1]},
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 1e39ecccb5550e3fdcff67582e9e0d8010dbb0aa Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Epler <jepler@unpythonic.net>
|
||||
Date: Sat, 27 Sep 2025 19:29:49 -0500
|
||||
Subject: [PATCH] py/misc: Don't warn about a GNU extension for static assert
|
||||
macro.
|
||||
|
||||
This warning was enabled by default on clang 17.0.0 on macOS 26. Disable
|
||||
it, because we want to make these checks at compile-time even if it
|
||||
requires an extension.
|
||||
|
||||
Fixes issue #18116.
|
||||
|
||||
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
|
||||
---
|
||||
py/misc.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/py/misc.h b/py/misc.h
|
||||
index 86ac2ec9a..16e2cf9da 100644
|
||||
--- a/py/misc.h
|
||||
+++ b/py/misc.h
|
||||
@@ -56,6 +56,9 @@ typedef unsigned int uint;
|
||||
#define MP_STRINGIFY(x) MP_STRINGIFY_HELPER(x)
|
||||
|
||||
// Static assertion macro
|
||||
+#if __clang__
|
||||
+#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
|
||||
+#endif
|
||||
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
|
||||
// In C++ things like comparing extern const pointers are not constant-expressions so cannot be used
|
||||
// in MP_STATIC_ASSERT. Note that not all possible compiler versions will reject this. Some gcc versions
|
||||
--
|
||||
2.46.2.windows.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user