网站开发的广告词,服务器公司网站,设计网网站,福州网站维护公司在我的一个Cent OS7开发环境中#xff0c;按https://yeyongjin.blog.csdn.net/article/details/134178420的方法升级GCC版本到8.3.1。 这两天#xff0c;要用Google的addressSanitizer检验内存问题#xff0c;加上编译参数后#xff0c;却发现编译不通过。configure时直接退… 在我的一个Cent OS7开发环境中按https://yeyongjin.blog.csdn.net/article/details/134178420的方法升级GCC版本到8.3.1。 这两天要用Google的addressSanitizer检验内存问题加上编译参数后却发现编译不通过。configure时直接退出检查config.log,发现有这样的内容 configure:5166: checking whether the C compiler works configure:5188: gcc -I${INSTALL_DIR}/include -g -O0 -fsanitizeaddress -fno-omit-frame-pointer conftest.c 5 /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find libasan_preinit.o: No such file or directory /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find -lasan collect2: error: ld returned 1 exit status 显然在编译检测时发现ibasan连接时找不到文件。
检查一下系统里的安装情况 rpm -qa | grep asan
显示 系统是有安装libasan的但是版本和devtoolset版本不同。
解决方法安装devtoolset对应的版本
yum install devtoolset-8-libasan-devel
安装完毕后重新编译就成了。