angr/pyvex

Linking error due to multiple definitions on pyvex

Closed this issue · 2 comments

I've been having this issue for a couple of months now but have been using a docker container to keep working.

There's a weird multiple definitions error on linking that' I can't seem to find the root cause of.
I've included my GCC and ldd versions.

Requirement already satisfied: pycparser in /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages (from pyvex==8.20.7.27) (2.19)
Requirement already satisfied: cffi>=1.0.3 in /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages (from pyvex==8.20.7.27) (1.14.1)
Requirement already satisfied: archinfo==8.20.7.27 in /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages (from pyvex==8.20.7.27) (8.20.7.27)
Requirement already satisfied: bitstring in /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages (from pyvex==8.20.7.27) (3.1.6)
Requirement already satisfied: future in /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages (from pyvex==8.20.7.27) (0.18.2)
Installing collected packages: pyvex
  Attempting uninstall: pyvex
    Found existing installation: pyvex 8.20.7.27
    Uninstalling pyvex-8.20.7.27:
      Successfully uninstalled pyvex-8.20.7.27
  Running setup.py develop for pyvex
    ERROR: Command errored out with exit status 1:
     command: /home/gh0s1/.virtualenvs/angr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/gh0s1/Documents/angr-dev/pyvex/setup.py'"'"'; __file__='"'"'/home/gh0s1/Documents/angr-dev/pyvex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/gh0s1/Documents/angr-dev/pyvex/
    Complete output (10 lines):
    running develop
    Building libVEX
    cc -o libvex.so -shared -Ipub -Ipriv -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-declarations -Wwrite-strings -Wformat -Wformat-security -std=gnu99 -fstrict-aliasing -fPIC -DPYVEX  -g priv/ir_defs.o priv/ir_match.o priv/ir_opt.o priv/ir_inject.o priv/main_globals.o priv/main_util.o priv/s390_disasm.o priv/host_x86_defs.o priv/host_amd64_defs.o priv/host_arm_defs.o priv/host_arm64_defs.o priv/host_ppc_defs.o priv/host_s390_defs.o priv/host_mips_defs.o priv/host_x86_isel.o priv/host_amd64_isel.o priv/host_arm_isel.o priv/host_arm64_isel.o priv/host_ppc_isel.o priv/host_s390_isel.o priv/host_mips_isel.o priv/host_generic_maddf.o priv/host_generic_regs.o priv/host_generic_simd64.o priv/host_generic_simd128.o priv/host_generic_simd256.o priv/host_generic_reg_alloc2.o priv/host_generic_reg_alloc3.o priv/guest_generic_x87.o priv/guest_generic_bb_to_IR.o priv/guest_x86_helpers.o priv/guest_amd64_helpers.o priv/guest_arm_helpers.o priv/guest_arm64_helpers.o priv/guest_ppc_helpers.o priv/guest_s390_helpers.o priv/guest_mips_helpers.o priv/guest_x86_toIR.o priv/guest_amd64_toIR.o priv/guest_arm_toIR.o priv/guest_arm64_toIR.o priv/guest_ppc_toIR.o priv/guest_s390_toIR.o priv/guest_mips_toIR.o priv/multiarch_main_main.o
    /usr/bin/ld: priv/host_s390_isel.o:(.bss+0x0): multiple definition of `s390x_vec_op_t'; priv/host_s390_defs.o:(.bss+0x0): first defined here
    /usr/bin/ld: priv/guest_s390_helpers.o:(.bss+0x0): multiple definition of `s390x_vec_op_t'; priv/host_s390_defs.o:(.bss+0x0): first defined here
    /usr/bin/ld: priv/guest_s390_toIR.o:(.bss+0x8): multiple definition of `s390x_vec_op_t'; priv/host_s390_defs.o:(.bss+0x0): first defined here
    /usr/bin/ld: priv/multiarch_main_main.o:/home/gh0s1/Documents/angr-dev/vex/priv/guest_s390_defs.h:289: multiple definition of `s390x_vec_op_t'; priv/host_s390_defs.o:(.bss+0x0): first defined here
    collect2: error: ld returned 1 exit status
    make: *** [Makefile-gcc:85: libvex.so] Error 1
    error: Unable to build libVEX.
    ----------------------------------------
  Rolling back uninstall of pyvex
  Moving to /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages/pyvex-8.20.7.27.dist-info/
   from /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages/~yvex-8.20.7.27.dist-info
  Moving to /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages/pyvex/
   from /home/gh0s1/.virtualenvs/angr/lib/python3.8/site-packages/~yvex
ERROR: Command errored out with exit status 1: /home/gh0s1/.virtualenvs/angr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/gh0s1/Documents/angr-dev/pyvex/setup.py'"'"'; __file__='"'"'/home/gh0s1/Documents/angr-dev/pyvex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2 is available.
You should consider upgrading via the '/home/gh0s1/.virtualenvs/angr/bin/python3 -m pip install --upgrade pip' command.
┌[gh0s1@jubatus]
└[~/Documents/angr-dev]% ldd --version                                                                                                                                                                                                                                                              (env: angr) (git)-[master]
ldd (GNU libc) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
┌[gh0s1@jubatus]
└[~/Documents/angr-dev]% gcc -v                                                                                                                                                                                                                                                                     (env: angr) (git)-[master]
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (GCC)

This looks like your vex might be out of date. There was a problem with GCC 10, fixed in this commit: angr/vex@4b15a93

Fixed by make cleaning my vex. Thanks!