3

When I use -fsanitize=address to link some object into a binary, g++ says the two lib in the title do not exist.

My g++ version is:

    $ /opt/rh/devtoolset-2/root/usr/bin/g++ -v
    Using built-in specs.
    COLLECT_GCC=/opt/rh/devtoolset-2/root/usr/bin/g++
    COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
    Target: x86_64-redhat-linux
    Configured with: ../configure --prefix=/opt/rh/devtoolset-2/root/usr --mandir=/opt/rh/devtoolset-2/root/usr/share/man --infodir=/opt/rh/devtoolset-2/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.8.2-20140120/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
    Thread model: posix
    gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC)

Do I need to manually compile libasan if I use g++?

yugr
  • 19,769
  • 3
  • 51
  • 96
zuanyg
  • 71
  • 1
  • 1
  • 5

1 Answers1

2

Sanitizer runtimes typically come in a separate package. E.g. on Debian you'll need to install libasanN ("N" depends on your GCC version).

yugr
  • 19,769
  • 3
  • 51
  • 96
  • Hm, I'm pretty sure that missing libs are due to missing libasan package on OP's system. The same [answer](https://bugzilla.redhat.com/show_bug.cgi?id=1303766) has been provided in official RedHat BZ. – yugr Nov 13 '16 at 19:23