From 6628b542182b68e7741fb5828c7e021d09af7c03 Mon Sep 17 00:00:00 2001 From: M4x1m3 Date: Mon, 15 Feb 2021 14:56:41 +0100 Subject: [PATCH] [py] Fixed Illegal Instruction when building in debug --- python/port/mpconfigport.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/port/mpconfigport.h b/python/port/mpconfigport.h index a55925d82..fa3d71da6 100644 --- a/python/port/mpconfigport.h +++ b/python/port/mpconfigport.h @@ -146,3 +146,10 @@ extern const struct _mp_obj_module_t modturtle_module; { MP_ROM_QSTR(MP_QSTR_os), MP_ROM_PTR(&modos_module) }, \ { MP_ROM_QSTR(MP_QSTR_turtle), MP_ROM_PTR(&modturtle_module) }, \ +// Enable setjmp in debug mode. This is to avoid some optimizations done +// specifically for x86_64 using inline assembly, which makes the debug binary +// crash with an illegal instruction +#ifndef NDEBUG + #define MICROPY_NLR_SETJMP 1 +#endif +