1

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

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

我现在如何面临一个新问题。它正在检查 librt,而工具链没有 librt。我得到了一个 librt 版本并将其添加到工具链 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:通过在 LIBS 和 LIBS_QGA 头的 config-host.mak 文件中添加 -lole32 来修复上述问题。

但现在面临以下问题

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 库以尝试解决此问题。感谢您的任何帮助。

4

0 回答 0