Build fails for port/unix mips/mipsel
Port, board and/or hardware
unix (mips/mipsel)
MicroPython version
The build process for the mipsel port of MicroPython failed with the following error:
mipsel-linux-gnu-gcc: error: build-standard/lib/libffi/out/lib/libffi.a: No such file or directory
make: *** [../../py/mkrules.mk:244: build-standard/micropython] Error 1
make: Leaving directory '/home/murphy/micropython/ports/unix'
Reproduction
Trying to make for unix (mipsel) in standalone mode
mipsel-linux-gnu-gcc
make -C mpy-cross
make -C ports/unix VARIANT=standard MICROPY_STANDALONE=1 CROSS_COMPILE=mips-linux-gnu- submodules
make -C ports/unix VARIANT=standard MICROPY_STANDALONE=1 CROSS_COMPILE=mips-linux-gnu- deplibs
Expected behaviour
No response
Observed behaviour
make -C ports/unix VARIANT=standard MICROPY_STANDALONE=1 CROSS_COMPILE=mips-linux-gnu- deplibs
make: Entering directory '/home/murphy/micropython/ports/unix'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
ls: cannot access 'build-standard/lib/libffi/include': No such file or directory
cd ../../lib/libffi; ./autogen.sh
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /usr/bin/autoconf
configure.ac:88: warning: The preprocessor macro STDC_HEADERS' is obsolete. configure.ac:88: Except in unusual embedded environments, you can safely include all configure.ac:88: ISO C90 headers unconditionally. configure.ac:123: warning: The macro AC_TRY_COMPILE' is obsolete.
configure.ac:123: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/asmcfi.m4:1: GCC_AS_CFI_PSEUDO_OP is expanded from...
configure.ac:123: the top level
configure.ac:437: warning: LT_PATH_LD is m4_require'd but not m4_defun'd
acinclude.m4:149: LIBFFI_CHECK_LINKER_FEATURES is expanded from...
acinclude.m4:251: LIBFFI_ENABLE_SYMVERS is expanded from...
configure.ac:437: the top level
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
Makefile.am:39: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:39: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:39: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:39: If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:39: its definition is in aclocal's search path.
autoreconf: error: automake failed with exit status: 1
make: *** [Makefile:291: ../../lib/libffi/configure] Error 1
make: *** Deleting file '../../lib/libffi/configure'
make: Leaving directory '/home/murphy/micropython/ports/unix'
### Additional Information
No, I've provided everything above.
### Code of Conduct
Yes, I agree
build failure on MacOS Intel
I'm trying to build the latest code from this repository on MacOS (mpy-cross/ and ports/unix/).
On Mac M1, RasPi Linux 32-bit, and Intel Linux 64-bit it all works as expected (make submodules deplibs, etc).
On the Intel Mac, however, mpy-cross/ builds ok, but ports/unix/ fails with:
$ make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-standard/genhdr
GEN build-standard/genhdr/mpversion.h
GEN build-standard/genhdr/moduledefs.h
GEN build-standard/genhdr/qstr.i.last
modffi.c:32:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
^~~~~~~
1 error generated.
Traceback (most recent call last):
File "/Users/jcw/code/git/micropython/ports/unix/../../py/makeqstrdefs.py", line 188, in <module>
preprocess()
On this machine, there's a libffi due to dependencies in several homebrew packages:
$ find /usr/local/ -name ffi.h
/usr/local//Cellar/libffi/3.4.2/include/ffi.h
$
On M1, homebrew works differently, and this header file is in a different place:
$ find /opt/Homebrew/ -name ffi.h
/usr/local//Cellar/libffi/3.4.2/include/ffi.h
$
There are instructions in brew info libffi how to export various settings (which I have on neither one).
But that should all be irrelevant, since libffi is a submodule in this repository anyway, I'd assume?
What's puzzling is that – apart from x86 vs arm – these two build environments are basically identical.
Update - in the python3 ../../py/makeqstrdefs.py ... command leading up to this, I see:
-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi
Which doesn't exist. Should that perhaps be .../MacOSX12.3.sdk/... ?
Update 2 - when changing 10.15 to 12.3 and running the command manually (and again fix it for CC modffi.c), the build completes properly and produces a functioning executable.