Skip to content

Commit 49159ef

Browse files
committed
Allow natmods to build again (they don't work, however)
1 parent 4a9632d commit 49159ef

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

supervisor/shared/translate/translate.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
#include "supervisor/shared/translate/compressed_string.h"
3434

3535
// Map MicroPython's error messages to our translations.
36-
#if defined(MICROPY_ENABLE_DYNRUNTIME) && MICROPY_ENABLE_DYNRUNTIME
37-
#define MP_ERROR_TEXT(x) (x)
38-
#else
36+
#if !defined(MICROPY_ENABLE_DYNRUNTIME) || !MICROPY_ENABLE_DYNRUNTIME
3937
#define MP_ERROR_TEXT(x) translate(x)
4038
#endif
4139

tools/mpy_ld.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -757,15 +757,13 @@ def link_objects(env, native_qstr_vals_len, native_qstr_objs_len):
757757
bytearray(native_qstr_vals_len * env.arch.qstr_entry_size),
758758
env.arch.qstr_entry_size,
759759
)
760-
env.sections.append(env.qstr_val_section)
761760

762761
# Create section to contain mp_native_obj_table
763762
env.obj_table_section = Section(
764763
".external.obj_table",
765764
bytearray(native_qstr_objs_len * env.arch.word_size),
766765
env.arch.word_size,
767766
)
768-
env.sections.append(env.qstr_obj_section)
769767

770768
# Resolve unknown symbols
771769
mp_fun_table_sec = Section(".external.mp_fun_table", b"", 0)
@@ -944,17 +942,6 @@ def build_mpy(env, entry_offset, fmpy, native_qstr_vals, native_qstr_objs):
944942
# MPY: machine code
945943
out.write_bytes(env.full_text)
946944

947-
# MPY: n_qstr_link (assumes little endian)
948-
out.write_uint(len(native_qstr_vals) + len(native_qstr_objs))
949-
for q in range(len(native_qstr_vals)):
950-
off = env.qstr_val_section.addr + q * env.arch.qstr_entry_size
951-
out.write_uint(off << 2)
952-
out.write_qstr(native_qstr_vals[q])
953-
for q in range(len(native_qstr_objs)):
954-
off = env.qstr_obj_section.addr + q * env.arch.word_size
955-
out.write_uint(off << 2 | 3)
956-
out.write_qstr(native_qstr_objs[q])
957-
958945
# MPY: scope_flags
959946
scope_flags = MP_SCOPE_FLAG_VIPERRELOC
960947
if len(env.full_rodata):
@@ -967,7 +954,6 @@ def build_mpy(env, entry_offset, fmpy, native_qstr_vals, native_qstr_objs):
967954
if len(env.full_rodata):
968955
rodata_const_table_idx = 1
969956
out.write_uint(len(env.full_rodata))
970-
out.write_bytes(env.full_rodata)
971957
if len(env.full_bss):
972958
bss_const_table_idx = 2
973959
out.write_uint(len(env.full_bss))

0 commit comments

Comments
 (0)