lsof
下载lsof-4.95.0版本解压后,使用./configure --help查看相关编译选项,根据提示,查看目录下面的
0XXCONFIG文件确认交叉编译能够配置的选项
编译选项配置
使用终端进入lsof-4.95.0目录,配置以下项目
export LSOF_HOST=“arm64”
export LSOF_INCLUDE=/usr/local/oecore-x86_64/sysroots/aarch64-oe-linux/usr/include
export LSOF_CC=“aarch64-oe-linux-gcc --sysroot=/usr/local/oecore-x86_64/sysroots/aarch64-oe-linux”
需要在CC配置中增加sysroot配置,否则编译会报以下错误
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/9.2.0/real-ld: cannot find crt1.o: No such file or directory
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/9.2.0/real-ld: cannot find crti.o: No such file or directory
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/9.2.0/real-ld: cannot find crtbegin.o: N