我一直在尝试编译C库,但我从数学库中收到此错误 我正在使用Android NDK r13b和android API 21作为sysroot进行编译
/usr/include/bits/mathinline.h:769:3: error: inconsistent operand
constraints in an 'asm'
__asm __volatile ("fnstcw %3\n\t" \
^
/usr/include/bits/mathinline.h:503:5: note: in definition of macro '__inline_mathcodeNP_'
code; \
^
/usr/include/bits/mathinline.h:764:1: note: in expansion of macro '__inline_mathcodeNP'
__inline_mathcodeNP (ceil, __x, \
完整的代码在这里......
__inline_mathcodeNP (floor, __x, \
register long double __value; \
register int __ignore; \
unsigned short int __cw; \
unsigned short int __cwtmp; \
__asm __volatile ("fnstcw %3\n\t" \
"movzwl %3, %1\n\t" \
"andl $0xf3ff, %1\n\t" \
"orl $0x0400, %1\n\t" /* rounding down */ \
"movw %w1, %2\n\t" \
"fldcw %2\n\t" \
"frndint\n\t" \
"fldcw %3" \
: "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \
"=m" (__cw) \
: "0" (__x)); \
return __value)
__inline_mathcodeNP (ceil, __x, \
register long double __value; \
register int __ignore; \
unsigned short int __cw; \
unsigned short int __cwtmp; \
__asm __volatile ("fnstcw %3\n\t" \
"movzwl %3, %1\n\t" \
"andl $0xf3ff, %1\n\t" \
"orl $0x0800, %1\n\t" /* rounding up */ \
"movw %w1, %2\n\t" \
"fldcw %2\n\t" \
"frndint\n\t" \
"fldcw %3" \
: "=t" (__value), "=&q" (__ignore), "=m" (__cwtmp), \
"=m" (__cw) \
: "0" (__x)); \
return __value)
我正在使用arm-linux-androideabi-gcc-4.9作为我的编译器,显然正在编译ARM android ...感谢您阅读并度过美好的一天
编辑:我意识到这是一个已经存在的问题,但是让我真正感到奇怪的是它发生在标准数学库上,甚至不是我自己或第三方库
Edit2:经过更多的研究,我发现在Android NDK中找不到位/ mathinline,这很奇怪...