我的构建和主机平台是带有 suse Linux 的 X86_64。我的目标平台是 arm-linux-gnueabi。
我用版本 3.6.0 的 clang 编译源代码。编译器使用 -target = arm-linux-gnueabi 运行
我失败了以下信息
/usr/include/pthread.h:655:6: error: 'regparm' is not valid on this platform
__cleanup_fct_attribute;
^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/bits/pthreadtypes.h:222:50: note: expanded from macro '__cleanup_fct_attribute'
# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
^ ~
问题是什么?
最佳答案
你的问题是什么? 'regparm' 是 x86-only 属性,所以这里的编译器是正确的,你的代码被破坏了。很可能您没有为目标平台使用正确的 header 。
关于clang - 我遇到了此错误消息 : 'regparm' is not valid on this platform,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37812531/