Skip to content

Commit 360b9b2

Browse files
committed
tools/makemanifest.py: Allow passing flags to mpy-tool.py
Use it to remain with the default MPZ_DIG_SIZE = 32 on 64-bit builds.
1 parent 63b8b79 commit 360b9b2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

ports/unix/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
267267
# freeze, then invoke make with FROZEN_MANIFEST=manifest.py (be sure to build from scratch).
268268
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
269269
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
270-
CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
270+
ifneq ($(MICROPY_FORCE_32BIT),1)
271+
MPY_TOOL_FLAGS += "-mmpz-dig-size=32"
272+
endif
271273
MPY_CROSS_FLAGS += -mcache-lookup-bc
272274
endif
273275

py/mkrules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ $(HEADER_BUILD):
139139
ifneq ($(FROZEN_MANIFEST),)
140140
# to build frozen_content.c from a manifest
141141
$(BUILD)/frozen_content.c: FORCE $(BUILD)/genhdr/qstrdefs.generated.h
142-
$(Q)$(MAKE_MANIFEST) -o $@ -v "MPY_DIR=$(TOP)" -v "MPY_LIB_DIR=$(MPY_LIB_DIR)" -v "PORT_DIR=$(shell pwd)" -v "BOARD_DIR=$(BOARD_DIR)" -b "$(BUILD)" $(if $(MPY_CROSS_FLAGS),-f"$(MPY_CROSS_FLAGS)",) $(FROZEN_MANIFEST)
142+
$(Q)$(MAKE_MANIFEST) -o $@ -v "MPY_DIR=$(TOP)" -v "MPY_LIB_DIR=$(MPY_LIB_DIR)" -v "PORT_DIR=$(shell pwd)" -v "BOARD_DIR=$(BOARD_DIR)" -b "$(BUILD)" $(if $(MPY_CROSS_FLAGS),-f"$(MPY_CROSS_FLAGS)",) $(if $(MPY_TOOL_FLAGS),--mpy-tool-flags="$(MPY_TOOL_FLAGS)",) $(FROZEN_MANIFEST)
143143

144144
ifneq ($(FROZEN_DIR),)
145145
$(error FROZEN_DIR cannot be used in conjunction with FROZEN_MANIFEST)

tools/makemanifest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def main():
248248
"-f", "--mpy-cross-flags", default="", help="flags to pass to mpy-cross"
249249
)
250250
cmd_parser.add_argument("-v", "--var", action="append", help="variables to substitute")
251+
cmd_parser.add_argument('--mpy-tool-flags', default='', help='flags to pass to mpy-tool')
251252
cmd_parser.add_argument("files", nargs="+", help="input manifest list")
252253
args = cmd_parser.parse_args()
253254

@@ -341,6 +342,7 @@ def main():
341342
"-q",
342343
args.build_dir + "/genhdr/qstrdefs.preprocessed.h",
343344
]
345+
+ args.mpy_tool_flags.split()
344346
+ mpy_files
345347
)
346348
if res != 0:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy