← index #13385PR #3987
Related · high · value 0.655
QUERY · ISSUE

Compiling with FROZEN_MANIFEST fails to build mpy-cross if it hasn't been built separately first

openby damzopened 2024-01-08updated 2024-01-08
bug

Compiling with FROZEN_MANIFEST fails to build mpy-cross if it hasn't been built separately first.

Reproducer

(on current master)

git clean -fdx && echo "" > manifest.py && make -C ports/unix submodules && make -C ports/unix FROZEN_MANIFEST="$PWD/manifest.py"

Fails linking with:

LINK build/mpy-cross
/usr/bin/ld: build/py/qstr.o: in function `qstr_init':
qstr.c:(.text.qstr_init+0x7): undefined reference to `mp_qstr_frozen_const_pool'
collect2: error: ld returned 1 exit status

Bisect

Bisect points to f01d5fb657159f1afa9d41cf39830d17b791a67e as the culprit.

I assume the problem is that the mpy-cross Makefile inherits the wrong CFLAGS? Also, interestingly cmake-based ports have the same problem.

CANDIDATE · PULL REQUEST

mpy-cross/Makefile: Also undefine MICROPY_FORCE_32BIT and CROSS_COMPILE.

closedby pfalconopened 2018-07-29updated 2018-08-14

mpy-cross is a host, not target binary. It should not be build with the
target compiler, compiler options and other settings. For example,

If someone currently tries to build from pristine checkout the unix port
with the following command:

make CROSS_COMPILE=arm-linux-gnueabihf-

then mpy-cross will be built with arm-linux-gnueabihf-gcc and of course
won't run on the host, leading to overall build failure.

This situation was worked around for some options in 1d8c3f4cff1, so add
MICROPY_FORCE_32BIT and CROSS_COMPILE to that set too.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied