← index #5515Issue #4455
Related · medium · value 2.293
QUERY · ISSUE

Got "mpy-cross : Malformed Mach-o file" error when make firmware on MacOS Catalina

openby pointcloudAIopened 2020-01-10updated 2020-01-22

I want to build firmware on MacOS Canalina but got "Malformed Mach-o file" error.

The problem is from "mpy-cross"

My detail process as below :

I had set up ~/edp-idf and ~/esp/xtensa-esp32-elf

On ~/.bashrc :
export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH export IDF_PATH=~/esp/esp-idf
Then go to ports/esp32 and perform "make V=1", but got "Malformed Mach-o file" error as below :
../../mpy-cross/mpy-cross -o build/frozen_mpy/flashbdev.mpy -s flashbdev.py modules/flashbdev.py make: ../../mpy-cross/mpy-cross: Malformed Mach-o file make: *** [build/frozen_mpy/flashbdev.mpy] Error 1

Then , i try :
cd mpy-cross
make clean make

The result as below:
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. rm -f mpy-cross rm -f mpy-cross.map rm -rf build CC gccollect.c LINK mpy-cross BFD: mpy-cross: unknown load command 0x32 text data bss dec hex filename 130999 13512 860 145371 237db mpy-cross
Then perform :
"./mpy-cross --help"
But got
Killed: 9

CANDIDATE · ISSUE

mpy-cross broken on macOS Mojave

closedby annejanopened 2019-02-01updated 2023-07-31

It compiles fine, but won't run

./mpy-cross 
dyld: malformed mach-o image: missing LC_DYSYMTAB
Abort trap: 6

I have tried not stripping by removing ,-dead_strip from the Makefile to no avail . .

 ./mpy-cross 
Killed: 9

NB: This is not the same issue as #2941 since this is on the current master.

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