Skip to content

Commit 571d5a3

Browse files
committed
New config option MICROPY_FORCE_32BIT (defaulted to 0)
Makes it easier for 64-bit unix hosts to build 32-bit unix binaries (for testing)
1 parent 3b108e7 commit 571d5a3

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

unix/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ else
2020
LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
2121
endif
2222

23+
ifeq ($(MICROPY_FORCE_32BIT),1)
24+
CFLAGS += -m32
25+
LDFLAGS += -m32
26+
ifeq ($(MICROPY_MOD_FFI),1)
27+
ifeq ($(UNAME_S),Linux)
28+
CFLAGS_MOD += -I/usr/include/i686-linux-gnu
29+
endif
30+
endif
31+
endif
32+
2333
ifeq ($(MICROPY_USE_READLINE),1)
2434
CFLAGS_MOD += -DMICROPY_USE_READLINE=1
2535
LDFLAGS_MOD += -lreadline

unix/mpconfigport.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Enable/disable modules and 3rd-party libs to be included in interpreter
22

3+
# Build 32-bit binaries on a 64-bit host
4+
MICROPY_FORCE_32BIT = 0
5+
36
# Linking with GNU readline causes binary to be licensed under GPL
47
MICROPY_USE_READLINE = 1
58

0 commit comments

Comments
 (0)