关于./xxx 提示not found问题
meiky 2012-02-22 11:11:59 板子原来是arm-linux-gcc 3.4.5编译器,一切正常。我想换成armv4t-crosstool-linux-gnueabi-
gcc4.1.1编译器.
用armv4t-crosstool-linux-gnueabi-gcc -o test test.c 后生成的文件放到板子上
-/bin/sh: ./test: not found。
于是我就cp -frd /usr/local/arm/4.1.1/armv4t-crosstool-linux-gnueabi/lib/* /nfsroot/lib/
就出现:
#ls
ls: error while loading shared libraries: libc.so.6: cannot handle TLS data
# ./test
-/bin/sh: ./test: Permission denied
怀疑是busy box用的编译器与现在的编译器不同,所以所需要的库文件也不同。于是我就的编译器的库文件另外放在/usr/lib:
cp -frd /usr/local/arm/4.1.1/armv4t-crosstool-linux-gnueabi/lib/* /nfsroot/usr/lib/
而且增加路径LD_LIBRARY_PATH=/usr/lib/:$LD_LIBRARY_PATH
结果还是not found
再接着,我就把busy box重新用armv4t-crosstool-linux-gnueabi-gcc编译出来,把bin sbin 的usr都拷过去,指令就都不能用。
如果我编译test的时候加上-static就没问题,证明肯定还是库问题。应该放哪些库在什么地方呢?????救助???