compilation - binutils-gdb 编译找不到 ncurses
问题描述
我正在尝试根据本教程为 i686-elf 目标编译 binutils:
我刚刚添加了该--enable-tui
选项,以便我在 gdb 中获得支持。
我做了以下事情:
# get sources
git clone git://sourceware.org/git/binutils-gdb.git
# store settings
export PREFIX="`pwd`/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
# create build folder
mkdir build-binutils
cd build-binutils
# run configure
../binutils-gdb/configure -target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror --enable-tui
# make
make
这会运行一段时间并以以下错误终止:
checking for library containing socketpair... (cached) none required
checking for ld used by GCC... (cached) ld
checking if the linker (ld) is GNU ld... (cached) yes
checking for shared library run path origin... (cached) done
checking for iconv... (cached) yes
checking for iconv declaration... (cached)
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... (cached) no
configure: error: no enhanced curses library found; disable TUI
make[1]: *** [Makefile:11329: configure-gdb] Error 1
make[1]: Leaving directory '/home/noexpandtab/dev/build-binutils'
make: *** [Makefile:853: all] Error 2
对我来说,似乎找不到 ncurses 库。
我有一个 Debian 10 正在运行并安装了以下附加软件包:
libncurses-dev
ncurses-base
ncurses-doc
libncurses5-dev
我必须安装额外的软件包吗?还是我错过了配置脚本的一些选项?
解决方案
您正在交叉编译到与i686-elf
您正在运行的任何架构不同的架构 ( ) —$TARGET
问题中提到的。gdb 必须与为该架构构建的库链接。
Debian 提供了在当前架构上运行的ncurses 包,但没有为交叉编译的应用程序提供合适的包。所以你可以为自己做这件事。
交叉编译 ncurses 时,您必须记住它的一部分在当前架构上构建/运行(以生成源文件以供交叉编译器编译)。这在环境中定义为$BUILD_CC
(而不是),正如您在阅读mingw 交叉编译$CC
脚本时可能看到的那样。文件中有一个部分(在 ncurses 源中)概述了该过程。INSTALL
没有教程(无论如何这将是题外话),但其他人已经阅读了说明和交叉编译的 ncurses,正如最近的错误报告所证明的那样。
推荐阅读
- java - Springboot - 在 swagger 文档中引用另一个端点
- c++ - 当 cpu 加载存储在 L2 缓存中的值时会发生什么。它是否将其放入 L1 缓存中?
- django - 从 Django 媒体视频文件中提取图像
- php - 批量请求中的错误:[arg] 无法从 [long] 类型更改为 [float]
- docker - 创建 Pod 时图像拉取失败
- safari-app-extension - Safari App Extensions:注入的脚本可以从应用程序包中加载资源吗?
- google-chrome-devtools - Chrome - 由于目标被视为被动,无法在被动事件侦听器中阻止默认设置
- pip - pip install tensorflowjs 时出错 — 由于 EnvironmentError 无法安装软件包:[Errno 2] 没有这样的文件或目录:
- mysql - 如何在 MySQL 中每个条件选择一行?
- python - 如何设置断点()来启动 IPython shell?(Python 3.7+)