Got "mpy-cross : Malformed Mach-o file" error when make firmware on MacOS Catalina
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
mpy-cross broken on macOS Mojave
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.