首先,下载lrzsz-0.12.20.tar.gz源码包,并解压

然后,按如下步骤编译(只能动态链接,静态链接会出错):

$ ./configure 
$ make CC=arm-none-linux-gnueabi-gcc

在源码的src/目录下会有lrz和lsz两个可执行文件

接下来,需要找到lrz和lsz所用到的动态库:
$ file src/lrz  
src/lrz: ELF 32-bit LSB executable, ARM, version 1 (SYSV),   dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped  
$ arm-none-linux-gnueabi-readelf -a src/lrz | grep Shared  
0x00000001 (NEEDED) Shared library: [ libnsl.so.1]  
0x00000001 (NEEDED) Shared library: [ libc.so.6]  
$ locate libnsl  
/lib/i386-linux-gnu/libnsl-2.15.so  
/lib/i386-linux-gnu/libnsl.so.1  
/lib/x86_64-linux-gnu/libnsl-2.15.so  
/lib/x86_64-linux-gnu/libnsl.so.1  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/armv4t/lib/libnsl-2.8.so  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/armv4t/lib/libnsl.so.1  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libnsl.a  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libnsl.so  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/lib/libnsl-2.8.so 
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/lib/libnsl.so.1 
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/thumb2/lib/libnsl-2.8.so  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/thumb2/lib/libnsl.so.1  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/thumb2/usr/lib/libnsl.a  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/thumb2/usr/lib/libnsl.so  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/usr/lib/libnsl.a  
/opt/armv6/codesourcery/arm-none-linux-gnueabi/libc/usr/lib/libnsl.so  
/usr/lib/x86_64-linux-gnu/libnsl.a  
/usr/lib/x86_64-linux-gnu/libnsl.so 

最后,把lrz、lsz和库文件一起拷贝到开发板上,验证OK!

Logo

更多推荐