无法与MinGW交叉编译gdb

问题描述 投票:0回答:1

我正在尝试交叉编译 gdb,以便我可以调试我的 Windows 版本的程序。 我的主机系统是 Arch Linux(确切地说是 5.13.4-arch1-1)。

我正在使用官方存储库中的 MinGW。

$ i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我从 https://ftp.gnu.org/gnu/gdb/ (gdb-10.2.tar.gz) 下载了 gdb 的源代码。 我将它解压,

cd
进入目录并运行:

$ ./configure --host=i686-w64-mingw32
$ make

很长时间以来,它编译没有任何错误,然后:

  CXX    source-cache.o
source-cache.c:37:10: fatal error: srchilite/sourcehighlight.h: No such file or directory
   37 | #include <srchilite/sourcehighlight.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

虽然编译器已经编译了 gdbserver 和其他不同的程序,但我无法运行它们。 与葡萄酒一起推出

gdbserver.exe
会带来:

$ wine gdbserver.exe
0024:err:module:import_dll Library libgcc_s_dw2-1.dll (which is needed by L"Z:\\home\\udalny\\.local\\build\\gdb\\gdb-10.2\\gdbserver\\gdbserver.exe") not found
0024:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\udalny\\.local\\build\\gdb\\gdb-10.2\\gdbserver\\gdbserver.exe") not found
0024:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\udalny\\.local\\build\\gdb\\gdb-10.2\\gdbserver\\gdbserver.exe" failed, status c0000135

不是静态链接吗?

有人知道如何解决吗?

gdb mingw cross-compiling
1个回答
2
投票

如果可以不突出显示源代码,则可以使用

configure
标志
--disable-source-highlight
来避免问题。

© www.soinside.com 2019 - 2024. All rights reserved.