Skip to content

Commit a669cbc

Browse files
committed
unix: Auto-detect MICROPY_EMIT_X64 and MICROPY_GCREGS_SETJMP.
If not set, MICROPY_EMIT_X64 is set only if on x86-64 machine. If not set, MICROPY_GCREGS_SETJMP is set when on MIPS.
1 parent 91fbea2 commit a669cbc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

unix/mpconfigport.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
// options to control how Micro Python is built
2828

2929
#define MICROPY_ALLOC_PATH_MAX (PATH_MAX)
30-
#ifndef MICROPY_EMIT_X64
31-
#define MICROPY_EMIT_X64 (1)
30+
#if !defined(MICROPY_EMIT_X64) && defined(__x86_64__)
31+
#define MICROPY_EMIT_X64 (1)
3232
#endif
3333
#define MICROPY_EMIT_THUMB (0)
3434
#define MICROPY_EMIT_INLINE_THUMB (0)
@@ -62,7 +62,11 @@
6262
// Define to 1 to use untested inefficient GC helper implementation
6363
// (if more efficient arch-specific one is not available).
6464
#ifndef MICROPY_GCREGS_SETJMP
65-
#define MICROPY_GCREGS_SETJMP (0)
65+
#ifdef __mips__
66+
#define MICROPY_GCREGS_SETJMP (1)
67+
#else
68+
#define MICROPY_GCREGS_SETJMP (0)
69+
#endif
6670
#endif
6771

6872
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)

0 commit comments

Comments
 (0)