在Fedora 22上,Makefile错误地解释了gcc版本



我刚刚在我的Fedora 22机器上安装了英特尔Pin,我试图在/source/tools中使用make运行makefile。但是,当我运行它时,我得到以下两个重复多次的错误:

error: #error This kit requires gcc 3.4 or later
error: #error The C++ ABI of your compiler does not match the ABI of the pin kit.
但是,我的gcc版本是
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC) 

所以我对发生了什么有点困惑。我该如何解决这个问题?

注释出source/include/pin/compiler_version_check2.H中的违规行似乎对我起了作用:

#if !defined(__GXX_ABI_VERSION) || CC_USED_ABI_VERSION != __GXX_ABI_VERSION
#error The C++ ABI of your compiler does not match the ABI of the pin kit.
#endif

#if CC_USED_ABI_VERSION != __GXX_ABI_VERSION
#error This kit requires gcc 3.4 or later
#endif

我也遇到过同样的问题。GCC 5.1引入了一个新的ABI,它不再与GCC -3.4+兼容。我建议您下载新版本的pin,它可以很好地与新版本的gcc一起编译。

另一个解决方案是将宏_GLIBCXX_USE_CXX11_ABI设置为0,这样编译器将使用旧的ABI。在PIN目录下有一些Makefile配置,您可以在其中为PIN工具设置CXX标志。

关于gcc的双ABI的更多信息:https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

新版本的PIN可以在这里找到https://software.intel.com/en-us/articles/pintool-downloads。最近一次发布是在2016年3月24日。

这个错误:

error: #error The C++ ABI of your compiler does not match the ABI of the pin kit.

可能是完全正确的,但我猜另一个错误消息做了一个愚蠢的假设——任何ABI不匹配都是因为您的系统有比早的ABI 。但是,这是双向的,现在,你有一个ABI不匹配,因为当然GCC 5.1比新得多

Fedora Magazine的一些背景:Fedora中的GCC 5(什么是ABI,当我们更改它时会发生什么?)

最新更新