I'm having troubles installing the "cffi" package as linker fails because of "-lgcc" is not available (package gcc-multilink is not available).
It fails with "/usr/bin/ld: cannot find -lgcc" error.
To reproduce do the following:
* flash clean ubuntu image on pico ultra w board
* install apt packages: python3.10-venv and libffi-dev
* create virtual environment
* activate virtual environment
* execute "pip install cffi"
This is the complete output:
Code: Select all
(env) master@luckfox:/srv/env$ pip install cffi
Collecting cffi
Using cached cffi-1.17.0.tar.gz (516 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pycparser (from cffi)
Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: cffi
Building wheel for cffi (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for cffi (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [50 lines of output]
/usr/bin/ld: cannot find -lgcc: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
collect2: error: ld returned 1 exit status
Note: will not use '__sync_synchronize()' in the C code
***** The above error message can be safely ignored.
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-cpython-310
creating build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/cparser.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/_imp_emulation.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/ffiplatform.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/vengine_gen.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/recompiler.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/lock.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/pkgconfig.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/setuptools_ext.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/model.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/error.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/cffi_opcode.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/backend_ctypes.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/api.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/verifier.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/_shimmed_dist_utils.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/commontypes.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/__init__.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/vengine_cpy.py -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/_cffi_include.h -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/parse_c_type.h -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/_embedding.h -> build/lib.linux-armv7l-cpython-310/cffi
copying src/cffi/_cffi_errors.h -> build/lib.linux-armv7l-cpython-310/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-cpython-310
creating build/temp.linux-armv7l-cpython-310/src
creating build/temp.linux-armv7l-cpython-310/src/c
arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/srv/env/include -I/usr/include/python3.10 -c src/c/_cffi_backend.c -o build/temp.linux-armv7l-cpython-310/src/c/_cffi_backend.o
In file included from src/c/cffi1_module.c:20,
from src/c/_cffi_backend.c:8027:
src/c/call_python.c:211:5: warning: #warning "no definition for read_barrier(), missing synchronization for multi-thread initialization in embedded mode" [-Wcpp]
211 | # warning "no definition for read_barrier(), missing synchronization for\
| ^~~~~~~
arm-linux-gnueabihf-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-armv7l-cpython-310/src/c/_cffi_backend.o -L/usr/lib/arm-linux-gnueabihf -lffi -o build/lib.linux-armv7l-cpython-310/_cffi_backend.cpython-310-arm-linux-gnueabihf.so
/usr/bin/ld: cannot find -lgcc: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
collect2: error: ld returned 1 exit status
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cffi
Failed to build cffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)