如题。我在给 R329 开发板编译 Tina Linux 时用 menuconfig 选中了 net-snmp 包,导致 make 整个系统时报错:
aarch64-openwrt-linux-gnu-gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -I/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/target/usr/include -I/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/target/include -I/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/usr/include -I/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/include -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -Os -pipe -fno-caller-saves -fno-caller-saves -Wno-unused-result -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -c snmpd.c -o snmpd.o >/dev/null 2>&1
/bin/sh ../libtool --mode=link aarch64-openwrt-linux-gnu-gcc -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -Os -pipe -fno-caller-saves -fno-caller-saves -Wno-unused-result -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.26/CORE
-o snmpd snmpd.lo -L../snmplib/.libs -L../snmplib -L./.libs -L./helpers/.libs -L./helpers -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/target/usr/lib -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/target/lib -L/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/usr/lib -L/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/lib -znow -zrelro -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/toolchain/usr/lib -lm -lc libnetsnmpagent.la helpers/libnetsnmphelpers.la libnetsnmpmibs.la ../snmplib/libnetsnmp.la -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
aarch64-openwrt-linux-gnu-gcc -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -Os -pipe -fno-caller-saves -fno-caller-saves -Wno-unused-result -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z -Wl,now -Wl,-z -Wl,relro -fpic -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -o snmpd .libs/snmpd.o -znow -zrelro -Wl,-E -fstack-protector-strong -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/.libs -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/helpers/.libs -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/snmplib/.libs -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/snmplib -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/helpers -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/target/usr/lib -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/target/lib -L/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/usr/lib -L/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/lib -L/home/fengshuo/R329-Tina-jishu/out/r329-evb5/staging_dir/toolchain/usr/lib ./.libs/libnetsnmpagent.so helpers/.libs/libnetsnmphelpers.so ./.libs/libnetsnmpmibs.so /home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/helpers/.libs/libnetsnmphelpers.so /home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/.libs/libnetsnmpagent.so /home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/snmplib/.libs/libnetsnmp.so ../snmplib/.libs/libnetsnmp.so -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lc -lcrypt -Wl,--rpath -Wl,/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/.libs -Wl,--rpath -Wl,/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent/helpers/.libs -Wl,--rpath -Wl,/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/snmplib/.libs
/home/fengshuo/R329-Tina-jishu/prebuilt/gcc/linux-x86/aarch64/toolchain-sunxi-glibc/toolchain/bin/../lib/gcc/aarch64-openwrt-linux-gnu/6.4.1/../../../../aarch64-openwrt-linux-gnu/bin/ld: cannot find -lperl
collect2: error: ld returned 1 exit status
Makefile:394: recipe for target 'snmpd' failed
make[4]: *** [snmpd] Error 1
make[4]: Leaving directory '/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/agent'
Makefile:511: recipe for target 'subdirs' failed
make[3]: *** [subdirs] Error 1
make[3]: Leaving directory '/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4'
Makefile:254: recipe for target '/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/.built' failed
make[2]: *** [/home/fengshuo/R329-Tina-jishu/out/r329-evb5/compile_dir/target/net-snmp-5.4.4/.built] Error 2
make[2]: Leaving directory '/home/fengshuo/R329-Tina-jishu/package/network/net-snmp'
package/Makefile:192: recipe for target 'package/network/net-snmp/install' failed
make[1]: *** [package/network/net-snmp/install] Error 2
make[1]: Leaving directory '/home/fengshuo/R329-Tina-jishu'
/home/fengshuo/R329-Tina-jishu/build/toplevel.mk:304: recipe for target 'package/network/net-snmp/install' failed
make: *** [package/network/net-snmp/install] Error 2
提示找不到 perl 库。我试了:
- 在用来编译的主机上安装
libperl-dev
包
- 执行
make package/network/net-snmp/clean
清空生成的文件,然后执行 make package/network/net-snmp/install
单独重新编译这个包
都没有用。请各位大佬帮忙看看是什么问题,谢谢。