我正在研究GCC112
compile farm
,这是一台Linux PPC64le机器。我正在测试IBM XL C/C++,并在一些使用EPOW8的AES代码中捕获编译失败。这个代码在过去几年里一直有效。失败是新的。
编译失败是:
$ CXX=xlC make aes-simd.o
xlC -DNDEBUG -g2 -O3 -qrtti -qpic -qarch=pwr8 -qaltivec -c aes-simd.cpp
In file included from aes-simd.cpp:29:
./ppc-simd.h:443:16: error: use of undeclared identifier
'__builtin_crypto_vcipher'; did you mean '__builtin_vec_vcipher'?
return (T1)__builtin_crypto_vcipher((uint64x2_p)state, (uint64x2_p)key);
__builtin_crypto_vcipher
是GCC内置的。进入那条路的唯一方法是
__xlc__
和
__xlC__
未定义:
template <class T1, class T2>
inline T1 VectorEncrypt(const T1& state, const T2& key)
{
#if defined(__xlc__) || defined(__xlC__)
return (T1)__vcipher((uint8x16_p)state, (uint8x16_p)key);
#elif defined(__GNUC__)
return (T1)__builtin_crypto_vcipher((uint64x2_p)state, (uint64x2_p)key);
#else
_ASSERT(0);
#endif
}
检查预处理器宏:
$ xlC -qshowmacros -qarch=pwr8 -qaltivec -E aes-simd.cpp | grep -i xlc
#define __XLC_BUILTIN_VAARG__ 1
看起来几乎所有的预处理器宏都消失了。一个宏
__XLC_BUILTIN_VAARG__
是不对的。
IBM XL C/C++预处理器宏发生了什么事,我怎样才能使它们恢复?
$ xlC -qversion
IBM XL C/C++ for Linux, V13.1.6 (Community Edition)
Version: 13.01.0006.0001
/opt/ibm/xlC/13.1.6/bin/.orig/xlC