对ARM进行交叉编译util-linux,libtool / ld没有从LDFLAGS路径中获取库

时间:2016-10-04 21:04:52

标签: linux arm cross-compiling embedded-linux

OS_COMP_DIR="/home/dev_team/prebuilt"  
export CROSS_COMPILE="arm-linux-gnueabi"  
export CPPFLAGS=" -I$OS_COMP_DIR/usr/include "  
export LDFLAGS=" -L$OS_COMP_DIR/usr/lib/"  
export AR="/usr/bin/arm-linux-gnueabi-gcc-ar-4.9"  
export AS="/usr/bin/arm-linux-gnueabi-as-4.9"  
export LD="/usr/bin/arm-linux-gnueabi-ld-4.9"  
export RANLIB="/usr/bin/arm-linux-gnueabi-gcc-ranlib-4.9"  
export CC="/usr/bin/arm-linux-gnueabi-gcc-4.9"  
export CPP="/usr/bin/arm-linux-gnueabi-cpp-4.9"  
export CXX="/usr/bin/arm-linux-gnueabi-g++-4.9"  
export NM="/usr/bin/arm-linux-gnueabi-nm"  
cd util-linux-2.28.2
./configure --build=i686-pc-linux-gnu --target=${CROSS_COMPILE} --host=${CROSS_COMPILE}
make V=1

构建时出现以下错误,即使所有这些库都在LDFLAGS中提到的目录中,也不知道“.libs”来自哪里

arm-linux-gnueabi-gcc-4.9: error: ./.libs/libmount.so: No such file or directory
arm-linux-gnueabi-gcc-4.9: error: /home/dev_team/workspace/util-linux-2.28.2/.libs/libblkid.so: No such file or directory
arm-linux-gnueabi-gcc-4.9: error: /home/dev_team/workspace/util-linux-2.28.2/.libs/libuuid.so:No such file or directory

如果有人知道解决方法,请帮助我,谢谢

1 个答案:

答案 0 :(得分:0)

您已在configure命令行中指定LDFLAGS

./configure --build=i686-pc-linux-gnu --target=${CROSS_COMPILE} --host=${CROSS_COMPILE} LDFLAGS=-L/home/dev_team/prebuilt/usr/lib/ make V=1

或者您可以添加到您的环境中:

export LD_LIBRARY_PATH=" -L$OS_COMP_DIR/usr/lib/"
export LIBRARY_PATH=" -L$OS_COMP_DIR/usr/lib/"