1

我目前正在使用以下configure命令为 armv7l-unknown-linux-gnueabihf 目标构建 Binutils 2.32:

chronos@localhost ~/Downloads/tarballs/binutils-2.32 $ ./configure --prefix=/usr/local/opt/arm-cross --target=armv7l-unknown-linux-gnueabihf --enable-shared --enable-host-shared --disable-static --enable-plugins --enable-gold=default --enable-ld --with-system-zlib

我跑了make -j3 && make install,没有出现错误。

但是,当我添加/usr/local/opt/arm-cross/bin到我的路径并运行armv7l-unknown-linux-gnueabihf-objdump时,发生了这个错误:

armv7l-unknown-linux-gnueabihf-objdump: can't set BFD default target to `armv7l-unknown-linux-gnueabihf': invalid bfd target

我该如何解决?我在 Stack Overflow 和 Google 上进行了搜索,但一无所获。

4

1 回答 1

1

您配置了--enable-shared --enable-host-shared --disable-static. 这意味着您需要确保 binutils 程序可以找到他们需要的共享对象。因此,除了 之外PATH,您还必须使用LD_LIBRARY_PATHBFD 库,或者以其他方式使 BFD 库可用于您的自定义 binutils 构建。

然而,这可能会影响其他已安装的 binutils 版本如何找到其 BFD 库,因此静态链接您的版本可能更容易。

于 2019-06-29T19:20:45.747 回答