【问题标题】:Compile QEMU under Windows 10 (64-bit) for Windows 10 (64-bit)在 Windows 10 (64-bit) 下为 Windows 10 (64-bit) 编译 QEMU
【发布时间】:2019-04-04 16:56:04
【问题描述】:

我设法使用这些命令在 Windows 10(64 位)下编译 QEMU(3.0.50)(基本上遵循these instructions):

./configure --enable-gtk --enable-sdl
make

但是,当在控制台中启动 qemu-system-x86_64.exe 时,什么也没有发生。我预计会出现一个窗口。启动 exe 后不久,我得到了提示。没有任何东西打印到控制台。没有必要的 DLL 丢失。可能是什么问题?

【问题讨论】:

  • 事件日志中有什么内容吗?
  • 啊。谢谢。好主意。是的。有一个事件:错误应用程序名称:qemu-system-x86_64.exe,版本:3.0.50.0,时间戳:0x00000000 错误模块名称:qemu-system-x86_64.exe,版本:3.0.50.0,时间戳:0x00000000 异常代码: 0xc0000005 故障偏移量: 0x00000000003da784
  • 如何找到崩溃的最佳原因?添加 ./configure --enable-debug 重新构建 QEMU 然后调试它?

标签: qemu


【解决方案1】:

最后我设法在 Windows 10 Home 64 位下编译和运行 QEMU。 有几个陷阱:

  1. 由于 mingw 中的编译器错误(请参阅 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86832 和 https://www.mail-archive.com/qemu-devel@nongnu.org/msg557409.html),您必须使用 --disable-stack-protector 配置 QEMU 并(一种解决方案)将函数 __stack_chk_fail 添加到源文件。李>
  2. 使用 --disable-werror 配置 QEMU。
  3. 从 makefile 中删除 Capstone 项目。

这是编译 qemu-system-x86_64.exe 的完整分步指南:

日期:2018-10-31

操作系统:Microsoft Windows 10 Home 64 位

指南基于:https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2

  • 下载 msys2 并将其安装到 C:\msys64: http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe
  • 启动 C:\msys64\mingw64.exe
  • 更新(然后关闭窗口并重新启动mingw64.exe):pacman -Syu
  • 更新:pacman -Su
  • 安装基本包:pacman -S base-devel mingw-w64-x86_64-toolchain git python
  • 安装 QEMU 特定数据包:pacman -S mingw-w64-x86_64-glib2 mingw-w64-x86_64-gtk3 mingw-w64-x86_64-SDL2
  • 获取 QEMU 源:
    • git clone git://git.qemu-project.org/qemu.git
    • cd qemu
    • git 子模块更新--init ui/keycodemapdb
    • git 子模块更新--init capstone
    • git 子模块更新--init dtc
  • 插入 无效__stack_chk_fail(无效); 无效__stack_chk_fail(无效) { } 到 qemu\util\oslib-win32.c 例如在第 44 行
  • 在 qemu\Makefile 中注释掉 (#) Capstone(第 508 行)
  • 构建 QEMU:
    • ./configure --enable-gtk --enable-sdl --target-list=x86_64-softmmu --disable-werror --disable-stack-protector
    • 制作
  • 在 qemu/x86_64-softmmu 中运行 ./qemu-system-x86_64 -L ./../pc-bios
  • 可选(以获得更好的性能):根据本指南安装 HAXM:https://www.qemu.org/2017/11/22/haxm-usage-windows/ 并使用选项 -accel hax 启动 QEMU

【讨论】:

  • 您可以添加 --disable-capstone 来配置参数,而不是注释掉 capstone 行。注释掉对我不起作用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2010-11-26
  • 2011-08-04
  • 1970-01-01
  • 1970-01-01
  • 2011-09-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多