Skip to content

Commit 18c22fa

Browse files
committed
py: Treat -m32 flag as part of CC, LD, etc.
Indeed, this flag efectively selects architecture target, and must consistently apply to all compiles and links, including 3rd-party libraries, unlike CFLAGS, which have MicroPython-specific setting.
1 parent 5cb5246 commit 18c22fa

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

py/mkenv.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ PYTHON = python
4646

4747
AS = $(CROSS_COMPILE)as
4848
CC = $(CROSS_COMPILE)gcc
49+
CXX = $(CROSS_COMPILE)g++
4950
LD = $(CROSS_COMPILE)ld
5051
OBJCOPY = $(CROSS_COMPILE)objcopy
5152
SIZE = $(CROSS_COMPILE)size
5253
STRIP = $(CROSS_COMPILE)strip
54+
ifeq ($(MICROPY_FORCE_32BIT),1)
55+
CC += -m32
56+
CXX += -m32
57+
LD += -m32
58+
endif
5359

5460
all:
5561
.PHONY: all

unix/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
4747
ifeq ($(MICROPY_FORCE_32BIT),1)
4848
# Note: you may need to install i386 versions of dependency packages,
4949
# starting with linux-libc-dev:i386
50-
CFLAGS += -m32
51-
LDFLAGS += -m32
5250
ifeq ($(MICROPY_PY_FFI),1)
5351
ifeq ($(UNAME_S),Linux)
5452
CFLAGS_MOD += -I/usr/include/i686-linux-gnu

0 commit comments

Comments
 (0)