The meson-1.2.1 build fails because it can not find _ctypes
Python module. After investigating the ./configure
command output for building Python, you can see a line stating:
configure: WARNING: --with(out)-system-ffi is ignored on this platform
and after running make
for Python you can see output saying:
Following modules built successfully but were removed because they could not be imported:
_ctypes
but we mentioned libffi in one of the ./configure
options:
./configure --prefix=/usr --enable-shared --with-system-expat --with-system-ffi --enable-optimizations
So the root cause is in libffi installation that Python can not find it.
Going back to libffi make install
output we can see it says:
Libraries have been installed in:
/usr/lib/../lib64
but LFS at chapter 4.2 says:
The LFS editors have deliberately decided not to use a /usr/lib64
directory. Several steps are taken to be sure the toolchain will not
use it. If for any reason this directory appears (either because you
made an error in following the instructions, or because you installed
a binary package that created it after finishing LFS), it may break
your system. You should always be sure this directory does not exist.
So the solution is to go back and redo our work from chap 8.50 with rebuilding libffi and installing it in /usr/lib/
:
rm /usr/lib64/libffi.*
./configure --prefix=/usr --disable-static --libdir=/usr/lib --disable-multi-os-directory --with-gcc-arch=native
Notice the line in make install
output:
Libraries have been installed in:
/usr/lib
After configuring Python you still get the warning but this time the make
output doesn't mention removing _ctypes
.