diff --git a/unix/Makefile b/unix/Makefile index ac1baf3d00e92c35a7750c7a6c17eebbc8788946..07a75f7adb79bc740a7b286ff0a7574f62b6f8da 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -20,6 +20,16 @@ else LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref endif +ifeq ($(MICROPY_FORCE_32BIT),1) +CFLAGS += -m32 +LDFLAGS += -m32 +ifeq ($(MICROPY_MOD_FFI),1) +ifeq ($(UNAME_S),Linux) +CFLAGS_MOD += -I/usr/include/i686-linux-gnu +endif +endif +endif + ifeq ($(MICROPY_USE_READLINE),1) CFLAGS_MOD += -DMICROPY_USE_READLINE=1 LDFLAGS_MOD += -lreadline diff --git a/unix/mpconfigport.mk b/unix/mpconfigport.mk index bfb01a71f141f59134ad06d775edd8ed82d470dc..352d010676c28dabeac67481c34c6e071e6fedbd 100644 --- a/unix/mpconfigport.mk +++ b/unix/mpconfigport.mk @@ -1,5 +1,8 @@ # Enable/disable modules and 3rd-party libs to be included in interpreter +# Build 32-bit binaries on a 64-bit host +MICROPY_FORCE_32BIT = 0 + # Linking with GNU readline causes binary to be licensed under GPL MICROPY_USE_READLINE = 1