msys: сбой установки pip cffi из-за неопределенных ссылок - PullRequest
0 голосов
/ 09 января 2020

Я пытаюсь установить cffi на MSYS2.

Если я пытаюсь pip install cffi на 64-битной оболочке MinGW, я получаю следующее:

$ pip install cffi
Collecting cffi
  Using cached https://files.pythonhosted.org/packages/2d/bf/960e5a422db3ac1a5e612cb35ca436c3fc985ed4b7ed13a1b4879006f450/cffi-1.13.2.tar.gz
Requirement already satisfied: pycparser in /usr/lib/python3.7/site-packages (from cffi) (2.19)
Installing collected packages: cffi
    Running setup.py install for cffi ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.exe -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_urs91r/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_urs91r/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-iaocmo6y/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-y_urs91r/cffi/
    Complete output (114 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7
    creating build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/api.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/commontypes.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/cparser.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/error.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/ffiplatform.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/lock.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/model.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/pkgconfig.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/recompiler.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/vengine_gen.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/verifier.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/__init__.py -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/_cffi_include.h -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/parse_c_type.h -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/_embedding.h -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    copying cffi/_cffi_errors.h -> build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7
    creating build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c
    x86_64-pc-msys-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O2 -pipe -march=x86-64 -mtune=generic -O2 -pipe -march=x86-64 -mtune=generic -O2 -pipe -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -IC:/msys64/mingw64/lib/libffi-3.2.1/include -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o
    In file included from /usr/include/python3.7m/unicodeobject.h:58,
                     from /usr/include/python3.7m/Python.h:99,
                     from c/_cffi_backend.c:2:
    c/ffi_obj.c: In function ‘ffi_getctype’:
    c/ffi_obj.c:635:56: warning: array subscript has type ‘char’ [-Wchar-subscripts]
      635 |     while (replace_with[0] != 0 && isspace(replace_with[0]))
          |                                            ~~~~~~~~~~~~^~~
    c/ffi_obj.c:638:56: warning: array subscript has type ‘char’ [-Wchar-subscripts]
      638 |     while (replace_with_len > 0 && isspace(replace_with[replace_with_len - 1]))
          |                                            ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
    gcc -shared -Wl,--enable-auto-image-base -pipe -L. -pipe -L. build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o -LC:/msys64/mingw64/lib/../lib -L/usr/lib/python3.7/config -L/usr/lib -lffi -lpython3.7m -o build/lib.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/_cffi_backend.cpython-37m.dll
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `_realize_name':
    /tmp/pip-install-y_urs91r/cffi/c/realize_c_type.c:290: undefined reference to `stpcpy'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `_testfunc5':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:7196: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:7196: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `dl_close_lib':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4325: undefined reference to `dlclose'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `dl_dealloc':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4209: undefined reference to `dlclose'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `cdlopen_close_ignore_errors':
    /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:27: undefined reference to `dlclose'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `b_do_dlopen':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4434: undefined reference to `dlopen'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4440: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `cdlopen_close':
    /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:32: undefined reference to `dlclose'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:33: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `cdlopen_close_ignore_errors':
    /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:27: undefined reference to `dlclose'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `b_load_library':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4461: undefined reference to `dlclose'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `dl_load_function':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4249: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4250: undefined reference to `dlsym'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4252: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `cdlopen_fetch':
    /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:14: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:15: undefined reference to `dlsym'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/cdlopen.c:17: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `restore_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:278: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `save_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:277: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `b_set_errno':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:6840: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `save_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:277: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `b_set_errno':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:6842: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o:/tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:278: more undefined references to `__errno' follow
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `dl_read_variable':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4278: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4279: undefined reference to `dlsym'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4281: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `ffi_getctype':
    /tmp/pip-install-y_urs91r/cffi/c/ffi_obj.c:635: undefined reference to `__locale_ctype_ptr'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/ffi_obj.c:638: undefined reference to `__locale_ctype_ptr'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `restore_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:278: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `save_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:277: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `dl_write_variable':
    /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4306: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4307: undefined reference to `dlsym'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/_cffi_backend.c:4309: undefined reference to `dlerror'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `save_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:277: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `restore_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:278: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `save_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:277: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `restore_errno_only':
    /tmp/pip-install-y_urs91r/cffi/c/misc_thread_common.h:278: undefined reference to `__errno'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build/temp.mingw64_nt-10.0-17763-3.0.7-338.x86_64-x86_64-3.7/c/_cffi_backend.o: in function `more_core':
    /tmp/pip-install-y_urs91r/cffi/c/malloc_closure.h:132: undefined reference to `mmap'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: /tmp/pip-install-y_urs91r/cffi/c/malloc_closure.h:103: undefined reference to `sysconf'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/usr/lib/libpthread.a(t-d000035.o):fake:(.text+0x2): undefined reference to `__imp___getreent'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/usr/lib/libpthread.a(t-d001093.o):fake:(.text+0x2): undefined reference to `__imp_pthread_getspecific'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/usr/lib/libpthread.a(t-d001095.o):fake:(.text+0x2): undefined reference to `__imp_pthread_key_create'
    C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/usr/lib/libpthread.a(t-d001137.o):fake:(.text+0x2): undefined reference to `__imp_pthread_setspecific'
    collect2.exe: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.exe -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_urs91r/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_urs91r/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-iaocmo6y/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
...