2016-07-04 2 views
0

일부 개체를 이진 파일로 연결할 때 -fsanitize = address를 사용하면 g ++에서 제목의 두 lib가 존재하지 않는다고 말합니다. 내 g ++ 버전은 다음과 같습니다-lasan 및 libasan_preinit.o를 찾을 수 없음

$ /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) 

내가 g ++ 사용하는 경우 내가 수동으로 libasan을 컴파일해야합니까?

+0

어쨌든 #'yum install devtoolset-2-libasan-devel libssan'은 ... –

답변

0

일반적으로 Sanitizer 런타임은 별도의 패키지로 제공됩니다. 예 : 데비안에서 libasanN을 설치해야합니다 ("N"은 GCC 버전에 따라 다릅니다).

+0

이 질문에 대한 답변을 제공하지 않습니다. 비평하거나 저자의 설명을 요청하려면 게시물 아래에 의견을 남겨 둡니다. - [리뷰에서] (리뷰/저품절 포스트/14078321) – Wildcat

+0

흠, 나는 누락 된 libs가 OP 시스템에서 libasan 패키지가 누락 된 것으로 확신합니다. 공식 RedHat BZ에서 동일한 [answer] (https://bugzilla.redhat.com/show_bug.cgi?id=1303766)이 제공되었습니다. – yugr