在Linux64上为Windows64构建Qemu(ARM仿真)

时间:2015-09-21 06:42:48

标签: arm glib qemu windows64 cross-build

我正在尝试在QEmu中运行ARM VExpress的仿真。我的终端平台是Windows64。我的构建系统正在运行Linux64。 我正在使用QEmu版本2.3.0和x86_64-w64-mingw32工具链。

我在构建过程中遇到了很多问题,但我自己解决了一些问题。 其中一个是安装上的工具链没有包含一个glib库,我必须导入一个我从搜索互联网上获得的。 所以在添加了一些pkg-config文件并将这组glib复制到lib文件夹后,我得到了整个开始编译的东西。

我现在面临一个新问题。它正在检查librt,而工具链没有librt。 我有一个版本的librt并将其添加到toolchain lib文件夹,编译抛出以下错误。任何步骤的任何帮助都表示赞赏。

make  all-recursive
Making all in pixman
make[3]: Nothing to be done for 'all'.
Making all in demos
make[3]: Nothing to be done for 'all'.
Making all in test
make[3]: Nothing to be done for 'all'.
        CHK version_gen.h
  LINK  qemu-ga.exe
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(libglib_2_0_la-gutils.o):(.text+0x505): undefined reference to `__imp_CoTaskMemFree'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(libglib_2_0_la-gutils.o):(.text+0x613): undefined reference to `__imp_CoTaskMemFree'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(libglib_2_0_la-gutils.o):(.text+0x6a6): undefined reference to `__imp_CoTaskMemFree'
/usr/bin/x86_64-w64-mingw32-ld: /home/user/Downloads/mingw/glib/lib/libglib-2.0.a(libglib_2_0_la-gutils.o): bad reloc address 0x0 in section `.pdata'
collect2: error: ld returned 1 exit status
Makefile:288: recipe for target 'qemu-ga.exe' failed
make: *** [qemu-ga.exe] Error 1

编辑1:通过将-lole32添加到LIBS和LIBS_QGA头的config-host.mak文件来修复上述问题。

但现在面临问题

LINK  qemu-ga.exe
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o):(.text+0x14d8): undefined reference to `libintl_sprintf'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o):(.text+0x1507): undefined reference to `libintl_sprintf'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o):(.text+0x1536): undefined reference to `libintl_sprintf'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o):(.text+0x1565): undefined reference to `libintl_sprintf'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o):(.text+0x1594): undefined reference to `libintl_sprintf'
/home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o):(.text+0x15f2): more undefined references to `libintl_sprintf' follow
/usr/bin/x86_64-w64-mingw32-ld: /home/user/Downloads/mingw/glib/lib/libglib-2.0.a(giowin32.o): bad reloc address 0x0 in section `.data'
collect2: error: ld returned 1 exit status
Makefile:288: recipe for target 'qemu-ga.exe' failed
make: *** [qemu-ga.exe] Error 1

从此开始。

我从gettext包下载并编译了libintl,并手动将其安装在工具链中。对于libiconv和libffi也是如此。

现在,我收到以下错误。

LINK  arm-softmmu/qemu-system-arm.exe
numa.o: In function `numa_node_parse':
/home/user/qemu-2.3.0/numa.c:107: undefined reference to `__imp_g_ascii_table'
hw/arm/boot.o: In function `load_image_to_fw_cfg':
/home/user/qemu-2.3.0/hw/arm/boot.c:546: undefined reference to `g_file_get_contents'
../vl.o: In function `set_memory_options':
/home/user/qemu-2.3.0/vl.c:2666: undefined reference to `__imp_g_ascii_table'
../hw/core/loader.o: In function `load_image_gzipped_buffer':
/home/user/qemu-2.3.0/hw/core/loader.c:629: undefined reference to `g_file_get_contents'
../hw/nvram/fw_cfg.o: In function `read_splashfile':
/home/user/qemu-2.3.0/hw/nvram/fw_cfg.c:97: undefined reference to `g_file_get_contents'
collect2: error: ld returned 1 exit status
Makefile:182: recipe for target 'qemu-system-arm.exe' failed
make[1]: *** [qemu-system-arm.exe] Error 1
Makefile:173: recipe for target 'subdir-arm-softmmu' failed
make: *** [subdir-arm-softmmu] Error 2

尝试编译glib库以尝试解决此问题。 谢谢你的帮助。

0 个答案:

没有答案