panda-re / lava

LAVA: Large-scale Automated Vulnerability Addition
Other
371 stars 60 forks source link

undefined reference to 'typeinfo for llvm::cl::GenericOptionValue' #43

Closed DanielGuoVT closed 4 years ago

DanielGuoVT commented 4 years ago

Hi there, I tried to compile lava but got several "undefined reference to 'typeinfo xxxxx'" errors in executing /lava/panda/src/build.sh by running 'python setup.py' under the lava directory.

It seems to be a RTTI problem so I compiled llvm3.3 with RTTI disabled and tried to insert "-fno-rtti" into the cxx_flags in configure but it failed.

Here is the detailed runtime information:

...... Building with default gcc/g++. Using protobuf 2.6.1. Found LLVM on /home/sjguo/git-repos/lava/external/llvm/build -- LLVM SUPPORT IS ENABLED Install prefix /home/sjguo/git-repos/lava/panda/src/install BIOS directory /home/sjguo/git-repos/lava/panda/src/install/share/qemu binary directory /home/sjguo/git-repos/lava/panda/src/install/bin library directory /home/sjguo/git-repos/lava/panda/src/install/lib module directory /home/sjguo/git-repos/lava/panda/src/install/lib/qemu libexec directory /home/sjguo/git-repos/lava/panda/src/install/libexec include directory /home/sjguo/git-repos/lava/panda/src/install/include config directory /home/sjguo/git-repos/lava/panda/src/install/etc local state directory /home/sjguo/git-repos/lava/panda/src/install/var Manual directory /home/sjguo/git-repos/lava/panda/src/install/share/man ELF interp prefix /usr/gnemul/qemu-%M Source path /home/sjguo/git-repos/lava/panda/src Extra plugins path C compiler cc Host C compiler cc C++ compiler c++ Objective-C compiler clang ARFLAGS rv CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g QEMU_CFLAGS -I/usr/include/pixman-1 -I$(SRC_PATH)/dtc/libfdt -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wendif-labels -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong LDFLAGS -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g -rdynamic make make install install python python2 -B smbd /usr/sbin/smbd module support no host CPU x86_64 host big endian no target list x86_64-softmmu tcg debug enabled no gprof enabled no sparse enabled no strip binaries yes profiler no static build no pixman system SDL support no GTK support no GTK GL support no VTE support no TLS priority NORMAL GNUTLS support no GNUTLS rnd no libgcrypt no libgcrypt kdf no nettle no nettle kdf no libtasn1 no curses support no virgl support no curl support no mingw32 support no Audio drivers oss Block whitelist (rw) Block whitelist (ro) VirtFS support no VNC support yes VNC SASL support no VNC JPEG support no VNC PNG support no xen support no brlapi support no bluez support no Documentation no PIE yes vde support no netmap support no Linux AIO support no ATTR/XATTR support yes Install blobs yes KVM support yes HAX support no RDMA support no LLVM support yes TCG interpreter no fdt support yes preadv support yes fdatasync yes madvise yes posix_madvise yes libcap-ng support no vhost-net support no vhost-scsi support yes vhost-vsock support yes Trace backends log spice support no rbd support no xfsctl support no smartcard support no libusb no usb net redir no OpenGL support no OpenGL dmabufs no libiscsi support no libnfs support no build guest agent no QGA VSS support no QGA w32 disk info no QGA MSI support no seccomp support no coroutine backend ucontext coroutine pool yes debug stack usage no GlusterFS support no Archipelago support no gcov gcov gcov enabled no TPM support yes libssh2 support no TPM passthrough yes QOM debugging yes lzo support no snappy support no bzip2 support no NUMA host support no tcmalloc support no jemalloc support no avx2 optimization yes replication support yes GEN config-host.h GEN qemu-options.def GEN trace/generated-tcg-tracers.h GEN trace/generated-helpers-wrappers.h GEN trace/generated-helpers.h GEN module_block.h CHK version_gen.h CC block.o CC os-posix.o CC vl.o GEN x86_64-softmmu/config-target.h GEN trace/generated-helpers.c LINK x86_64-softmmu/panda/tools/helper_call_modifier LINK x86_64-softmmu/qemu-system-x86_64 panda/tools/helper_call_modifier.o:(.data.rel.ro._ZTIN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTIN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x10): undefined reference to typeinfo for llvm::cl::GenericOptionValue' panda/tools/helper_call_modifier.o:(.data.rel.ro._ZTIN4llvm18ValueMapCallbackVHIPKNS_5ValueENS_6WeakVHENS_14ValueMapConfigIS3_EEEE[_ZTIN4llvm18ValueMapCallbackVHIPKNS_5ValueENS_6WeakVHENS_14ValueMapConfigIS3_EEEE]+0x10): undefined reference totypeinfo for llvm::CallbackVH' collect2: error: ld returned 1 exit status /home/sjguo/git-repos/lava/panda/src/rules.mak:127: recipe for target 'panda/tools/helper_call_modifier' failed make[1]: [panda/tools/helper_call_modifier] Error 1 make[1]: Waiting for unfinished jobs.... panda/llvm/tcg-llvm.o:(.data.rel.ro._ZTI17TJITMemoryManager[_ZTI17TJITMemoryManager]+0x10): undefined reference to typeinfo for llvm::SectionMemoryManager' panda/llvm/helper_runtime.o:(.data.rel.ro._ZTIN4llvm26PandaCallMorphFunctionPassE[_ZTIN4llvm26PandaCallMorphFunctionPassE]+0x10): undefined reference totypeinfo for llvm::FunctionPass' collect2: error: ld returned 1 exit status Makefile:213: recipe for target 'qemu-system-x86_64' failed make[1]: [qemu-system-x86_64] Error 1 Makefile:324: recipe for target 'subdir-x86_64-softmmu' failed make: [subdir-x86_64-softmmu] Error 2 sjguo@osboxes:~/git-repos/lava/panda/src$

Did someone else also get this problem before?

DanielGuoVT commented 4 years ago

Problem solved by following the instructions from https://github.com/panda-re/panda/blob/master/panda/docs/compile.md#llvm

mrexodia commented 2 years ago

https://github.com/panda-re/panda/blob/11774e71ec2989fc3ae83c20f437ce5e9f58b5a9/panda/docs/compile.md#llvm