Gcc 为什么armv7l未知linux gnueabihf objdump给出;无效的bfd目标“;什么时候跑?

Gcc 为什么armv7l未知linux gnueabihf objdump给出;无效的bfd目标“;什么时候跑?,gcc,binutils,bfd,Gcc,Binutils,Bfd,我目前正在为armv7l未知linux gnueabihf目标构建Binutils 2.32,使用以下configure命令: chronos@localhost ~/Downloads/tarballs/binutils-2.32 $ ./configure --prefix=/usr/local/opt/arm-cross --target=armv7l-unknown-linux-gnueabihf --enable-shared --enable-host-shared --disabl

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

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&&makeinstall
,没有发生错误

但是,当我将
/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上搜索,没有找到任何结果。

您配置了
--启用共享--启用主机共享--禁用静态
。这意味着您需要确保binutils程序能够找到所需的共享对象。因此,除了
PATH
,您还必须使用
LD\u LIBRARY\u PATH
,或者使BFD库可用于您的自定义binutils构建

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