我在我的英特尔 x86 机器上构建了 qemu v4.1.0 分支,构建良好。
如果我使用 raspian 在 raspberry pi 上构建,我会得到以下结果:
pi@pi205:~/git/qemu/qemu/build $ make
make[1]: Entering directory '/z/qemu/qemu/slirp'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/z/qemu/qemu/slirp'
CC migration/migration.o
/home/pi/git/qemu/qemu/migration/migration.c:2008:24: error: implicit conversion from 'long long' to 'double' changes value from 9223372
036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
value = MAX(0, MIN(INT64_MAX, value));
~~~~^~~~~~~~~~~~~~~~~
/usr/include/stdint.h:124:22: note: expanded from macro 'INT64_MAX'
# define INT64_MAX (__INT64_C(9223372036854775807))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdint.h:109:24: note: expanded from macro '__INT64_C'
# define __INT64_C(c) c ## LL
^~~~~~~
<scratch space>:73:1: note: expanded from here
9223372036854775807LL
^~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:336:23: note: expanded from macro 'MIN'
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
我知道 raspian 是 32 位的,但 64 位类型就是 64 位类型。我不明白为什么它在 x86 上运行,而在 arm 上运行不了...
相同的编译器,相同的一切。
有人尝试过这个并且让它发挥作用吗?