obj/third_party/toybox/toys/pending/toybox.telnetd.o: In function `new_session‘:telnetd.c:

../../../vendor/zjzmyyjx/imx6ul_nand_linux/hals/utils/sys_param/hal_sys_param.c: In function ‘HalGetSerial’:
../../../vendor/zjzmyyjx/imx6ul_nand_linux/hals/utils/sys_param/hal_sys_param.c:100:15: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
     int ret = read(fd, strOrigin, STR_MAX - 1);
               ^~~~
               fread
../../../vendor/zjzmyyjx/imx6ul_nand_linux/hals/utils/sys_param/hal_sys_param.c:102:9: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
         close(fd);
         ^~~~~
         pclose
At top level:
../../../vendor/zjzmyyjx/imx6ul_nand_linux/hals/utils/sys_param/hal_sys_param.c:42:19: warning: ‘EMPTY_STR’ defined but not used [-Wunused-const-variable=]
 static const char EMPTY_STR[] = {""};
                   ^~~~~~~~~
[605/629] SOLINK ./libhal_sysparam.so
[606/629] SOLINK ./libhaltoken_shared.so
[607/629] gcc cross compiler obj/utils/native/lite/kv_store/src/kvstore_impl_posix/libutils_kv_store.kv_store.o
[608/629] SOLINK ./libtoken_shared.so
[609/629] SOLINK ./libsysparam.so
[610/629] STAMP obj/base/startup/syspara_lite/frameworks/token/token_notes.stamp
[611/629] SOLINK ./libutils_kv_store.so
[612/629] STAMP obj/base/startup/syspara_lite/frameworks/token/token.stamp
[613/629] STAMP obj/base/startup/syspara_lite/frameworks/parameter/parameter.stamp
[614/629] STAMP obj/base/startup/syspara_lite/frameworks/parameter/parameter_notes.stamp
[615/629] STAMP obj/utils/native/lite/kv_store/kv_store.stamp
[616/629] LINK ./bin/toybox
FAILED: bin/toybox unstripped/bin/toybox 
ccache arm-linux-gnueabihf-gcc -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -lm -lcrypt -mcpu=cortex-a7 -L. -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -pie  -Wl,--start-group obj/third_party/toybox/lib/toybox.args.o obj/third_party/toybox/lib/toybox.commas.o obj/third_party/toybox/lib/toybox.deflate.o obj/third_party/toybox/lib/toybox.dirtree.o obj/third_party/toybox/lib/toybox.env.o obj/third_party/toybox/lib/toybox.help.o obj/third_party/toybox/lib/toybox.lib.o obj/third_party/toybox/lib/toybox.linestack.o obj/third_party/toybox/lib/toybox.llist.o obj/third_party/toybox/lib/toybox.net.o obj/third_party/toybox/lib/toybox.password.o obj/third_party/toybox/lib/toybox.portability.o obj/third_party/toybox/lib/toybox.tty.o obj/third_party/toybox/lib/toybox.xwrap.o obj/third_party/toybox/toybox.main.o obj/third_party/toybox/toys/lsb/toybox.dmesg.o obj/third_party/toybox/toys/lsb/toybox.gzip.o obj/third_party/toybox/toys/lsb/toybox.hostname.o obj/third_party/toybox/toys/lsb/toybox.killall.o obj/third_party/toybox/toys/lsb/toybox.md5sum.o obj/third_party/toybox/toys/lsb/toybox.mknod.o obj/third_party/toybox/toys/lsb/toybox.mktemp.o obj/third_party/toybox/toys/lsb/toybox.mount.o obj/third_party/toybox/toys/lsb/toybox.passwd.o obj/third_party/toybox/toys/lsb/toybox.pidof.o obj/third_party/toybox/toys/lsb/toybox.seq.o obj/third_party/toybox/toys/lsb/toybox.su.o obj/third_party/toybox/toys/lsb/toybox.sync.o obj/third_party/toybox/toys/lsb/toybox.umount.o obj/third_party/toybox/toys/net/toybox.ftpget.o obj/third_party/toybox/toys/net/toybox.ifconfig.o obj/third_party/toybox/toys/net/toybox.microcom.o obj/third_party/toybox/toys/net/toybox.netcat.o obj/third_party/toybox/toys/net/toybox.netstat.o obj/third_party/toybox/toys/net/toybox.ping.o obj/third_party/toybox/toys/net/toybox.rfkill.o obj/third_party/toybox/toys/net/toybox.sntp.o obj/third_party/toybox/toys/net/toybox.tunctl.o obj/third_party/toybox/toys/other/toybox.acpi.o obj/third_party/toybox/toys/other/toybox.ascii.o obj/third_party/toybox/toys/other/toybox.base64.o obj/third_party/toybox/toys/other/toybox.blkid.o obj/third_party/toybox/toys/other/toybox.blockdev.o obj/third_party/toybox/toys/other/toybox.bzcat.o obj/third_party/toybox/toys/other/toybox.chroot.o obj/third_party/toybox/toys/other/toybox.chrt.o obj/third_party/toybox/toys/other/toybox.chvt.o obj/third_party/toybox/toys/other/toybox.clear.o obj/third_party/toybox/toys/other/toybox.count.o obj/third_party/toybox/toys/other/toybox.devmem.o obj/third_party/toybox/toys/other/toybox.dos2unix.o obj/third_party/toybox/toys/other/toybox.eject.o obj/third_party/toybox/toys/other/toybox.factor.o obj/third_party/toybox/toys/other/toybox.fallocate.o obj/third_party/toybox/toys/other/toybox.flock.o obj/third_party/toybox/toys/other/toybox.fmt.o obj/third_party/toybox/toys/other/toybox.free.o obj/third_party/toybox/toys/other/toybox.freeramdisk.o obj/third_party/toybox/toys/other/toybox.fsfreeze.o obj/third_party/toybox/toys/other/toybox.fsync.o obj/third_party/toybox/toys/other/toybox.help.o obj/third_party/toybox/toys/other/toybox.hexedit.o obj/third_party/toybox/toys/other/toybox.hwclock.o obj/third_party/toybox/toys/other/toybox.i2ctools.o obj/third_party/toybox/toys/other/toybox.inotifyd.o obj/third_party/toybox/toys/other/toybox.insmod.o obj/third_party/toybox/toys/other/toybox.ionice.o obj/third_party/toybox/toys/other/toybox.login.o obj/third_party/toybox/toys/other/toybox.losetup.o obj/third_party/toybox/toys/other/toybox.lsattr.o obj/third_party/toybox/toys/other/toybox.lsmod.o obj/third_party/toybox/toys/other/toybox.lspci.o obj/third_party/toybox/toys/other/toybox.lsusb.o obj/third_party/toybox/toys/other/toybox.makedevs.o obj/third_party/toybox/toys/other/toybox.mcookie.o obj/third_party/toybox/toys/other/toybox.mix.o obj/third_party/toybox/toys/other/toybox.mkpasswd.o obj/third_party/toybox/toys/other/toybox.mkswap.o obj/third_party/toybox/toys/other/toybox.modinfo.o obj/third_party/toybox/toys/other/toybox.mountpoint.o obj/third_party/toybox/toys/other/toybox.nbd_client.o obj/third_party/toybox/toys/other/toybox.nsenter.o obj/third_party/toybox/toys/other/toybox.oneit.o obj/third_party/toybox/toys/other/toybox.partprobe.o obj/third_party/toybox/toys/other/toybox.pivot_root.o obj/third_party/toybox/toys/other/toybox.pmap.o obj/third_party/toybox/toys/other/toybox.printenv.o obj/third_party/toybox/toys/other/toybox.pwdx.o obj/third_party/toybox/toys/other/toybox.readahead.o obj/third_party/toybox/toys/other/toybox.readlink.o obj/third_party/toybox/toys/other/toybox.realpath.o obj/third_party/toybox/toys/other/toybox.reboot.o obj/third_party/toybox/toys/other/toybox.reset.o obj/third_party/toybox/toys/other/toybox.rev.o obj/third_party/toybox/toys/other/toybox.rmmod.o obj/third_party/toybox/toys/other/toybox.setfattr.o obj/third_party/toybox/toys/other/toybox.setsid.o obj/third_party/toybox/toys/other/toybox.shred.o obj/third_party/toybox/toys/other/toybox.stat.o obj/third_party/toybox/toys/other/toybox.swapoff.o obj/third_party/toybox/toys/other/toybox.swapon.o obj/third_party/toybox/toys/other/toybox.switch_root.o obj/third_party/toybox/toys/other/toybox.sysctl.o obj/third_party/toybox/toys/other/toybox.tac.o obj/third_party/toybox/toys/other/toybox.taskset.o obj/third_party/toybox/toys/other/toybox.timeout.o obj/third_party/toybox/toys/other/toybox.truncate.o obj/third_party/toybox/toys/other/toybox.uptime.o obj/third_party/toybox/toys/other/toybox.usleep.o obj/third_party/toybox/toys/other/toybox.uuidgen.o obj/third_party/toybox/toys/other/toybox.vconfig.o obj/third_party/toybox/toys/other/toybox.vmstat.o obj/third_party/toybox/toys/other/toybox.w.o obj/third_party/toybox/toys/other/toybox.watch.o obj/third_party/toybox/toys/other/toybox.which.o obj/third_party/toybox/toys/other/toybox.xxd.o obj/third_party/toybox/toys/other/toybox.yes.o obj/third_party/toybox/toys/pending/toybox.bootchartd.o obj/third_party/toybox/toys/pending/toybox.diff.o obj/third_party/toybox/toys/pending/toybox.getty.o obj/third_party/toybox/toys/pending/toybox.mdev.o obj/third_party/toybox/toys/pending/toybox.more.o obj/third_party/toybox/toys/pending/toybox.route.o obj/third_party/toybox/toys/pending/toybox.telnetd.o obj/third_party/toybox/toys/posix/toybox.basename.o obj/third_party/toybox/toys/posix/toybox.cal.o obj/third_party/toybox/toys/posix/toybox.cat.o obj/third_party/toybox/toys/posix/toybox.chgrp.o obj/third_party/toybox/toys/posix/toybox.chmod.o obj/third_party/toybox/toys/posix/toybox.cksum.o obj/third_party/toybox/toys/posix/toybox.cmp.o obj/third_party/toybox/toys/posix/toybox.comm.o obj/third_party/toybox/toys/posix/toybox.cp.o obj/third_party/toybox/toys/posix/toybox.cpio.o obj/third_party/toybox/toys/posix/toybox.cut.o obj/third_party/toybox/toys/posix/toybox.date.o obj/third_party/toybox/toys/posix/toybox.df.o obj/third_party/toybox/toys/posix/toybox.dirname.o obj/third_party/toybox/toys/posix/toybox.du.o obj/third_party/toybox/toys/posix/toybox.echo.o obj/third_party/toybox/toys/posix/toybox.env.o obj/third_party/toybox/toys/posix/toybox.expand.o obj/third_party/toybox/toys/posix/toybox.false.o obj/third_party/toybox/toys/posix/toybox.file.o obj/third_party/toybox/toys/posix/toybox.find.o obj/third_party/toybox/toys/posix/toybox.getconf.o obj/third_party/toybox/toys/posix/toybox.grep.o obj/third_party/toybox/toys/posix/toybox.head.o obj/third_party/toybox/toys/posix/toybox.iconv.o obj/third_party/toybox/toys/posix/toybox.id.o obj/third_party/toybox/toys/posix/toybox.kill.o obj/third_party/toybox/toys/posix/toybox.link.o obj/third_party/toybox/toys/posix/toybox.ln.o obj/third_party/toybox/toys/posix/toybox.logger.o obj/third_party/toybox/toys/posix/toybox.ls.o obj/third_party/toybox/toys/posix/toybox.mkdir.o obj/third_party/toybox/toys/posix/toybox.mkfifo.o obj/third_party/toybox/toys/posix/toybox.nice.o obj/third_party/toybox/toys/posix/toybox.nl.o obj/third_party/toybox/toys/posix/toybox.nohup.o obj/third_party/toybox/toys/posix/toybox.od.o obj/third_party/toybox/toys/posix/toybox.paste.o obj/third_party/toybox/toys/posix/toybox.patch.o obj/third_party/toybox/toys/posix/toybox.printf.o obj/third_party/toybox/toys/posix/toybox.ps.o obj/third_party/toybox/toys/posix/toybox.pwd.o obj/third_party/toybox/toys/posix/toybox.renice.o obj/third_party/toybox/toys/posix/toybox.rm.o obj/third_party/toybox/toys/posix/toybox.rmdir.o obj/third_party/toybox/toys/posix/toybox.sed.o obj/third_party/toybox/toys/posix/toybox.sleep.o obj/third_party/toybox/toys/posix/toybox.sort.o obj/third_party/toybox/toys/posix/toybox.split.o obj/third_party/toybox/toys/posix/toybox.strings.o obj/third_party/toybox/toys/posix/toybox.tail.o obj/third_party/toybox/toys/posix/toybox.tar.o obj/third_party/toybox/toys/posix/toybox.tee.o obj/third_party/toybox/toys/posix/toybox.test.o obj/third_party/toybox/toys/posix/toybox.time.o obj/third_party/toybox/toys/posix/toybox.touch.o obj/third_party/toybox/toys/posix/toybox.true.o obj/third_party/toybox/toys/posix/toybox.tty.o obj/third_party/toybox/toys/posix/toybox.ulimit.o obj/third_party/toybox/toys/posix/toybox.uname.o obj/third_party/toybox/toys/posix/toybox.uniq.o obj/third_party/toybox/toys/posix/toybox.unlink.o obj/third_party/toybox/toys/posix/toybox.uudecode.o obj/third_party/toybox/toys/posix/toybox.uuencode.o obj/third_party/toybox/toys/posix/toybox.wc.o obj/third_party/toybox/toys/posix/toybox.who.o obj/third_party/toybox/toys/posix/toybox.xargs.o  -Wl,--end-group -o ./unstripped/bin/toybox  && ccache arm-linux-gnueabihf-strip --strip-unneeded "./unstripped/bin/toybox" -o "./bin/toybox"
obj/third_party/toybox/toys/pending/toybox.telnetd.o: In function `new_session':
telnetd.c:(.text.new_session+0x96): undefined reference to `forkpty'
collect2: error: ld returned 1 exit status
[617/629] SOLINK ./libability.so
[618/629] LINK test/unittest/startup/bin/init_test.bin
FAILED: test/unittest/startup/bin/init_test.bin test/unittest/startup/unstripped/bin/init_test.bin 
ccache arm-linux-gnueabihf-gcc -lstdc++ -lpthread -lm -lstdc++ -lm -pthread -mcpu=cortex-a7 -L. -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -pie -lm  -Wl,--start-group obj/base/startup/init_lite/services/log/init_test.init_log.o obj/base/startup/init_lite/services/src/init_test.init_adapter.o obj/base/startup/init_lite/services/src/init_test.init_capability.o obj/base/startup/init_lite/services/src/init_test.init_cmds.o obj/base/startup/init_lite/services/src/init_test.init_import.o obj/base/startup/init_lite/services/src/init_test.init_jobs.o obj/base/startup/init_lite/services/src/init_test.init_read_cfg.o obj/base/startup/init_lite/services/src/init_test.init_reboot.o obj/base/startup/init_lite/services/src/init_test.init_service.o obj/base/startup/init_lite/services/src/init_test.init_service_manager.o obj/base/startup/init_lite/services/src/init_test.init_service_socket.o obj/base/startup/init_lite/services/src/init_test.init_signal_handler.o obj/base/startup/init_lite/services/src/init_test.init_utils.o obj/base/startup/init_lite/services/test/unittest/common/init_test.cmd_func_test.o libhilog_shared.so libcjson_shared.so libsec_shared.so libs/libgtest_main.a libinitsync_shared.so libsysparam.so libhal_sysparam.so libs/libgtest.a  -Wl,--end-group -o test/unittest/startup/unstripped/bin/init_test.bin  && ccache arm-linux-gnueabihf-strip --strip-unneeded "test/unittest/startup/unstripped/bin/init_test.bin" -o "test/unittest/startup/bin/init_test.bin"
/home/openharmony/prebuilts/gcc/linux-x86/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libmbedtls.so, needed by libsysparam.so, not found (try using -rpath or -rpath-link)
libsysparam.so: undefined reference to `mbedtls_sha256_init'
libsysparam.so: undefined reference to `mbedtls_sha256_starts_ret'
libsysparam.so: undefined reference to `mbedtls_sha256_update_ret'
libsysparam.so: undefined reference to `mbedtls_sha256_finish_ret'
collect2: error: ld returned 1 exit status

这个报错可能是缺少某个东西导致。。。obj/third_party/toybox/toys/pending/toybox.telnetd.o: In function `new_session':
telnetd.c:(.text.new_session+0x96): undefined reference to `forkpty'

应该是这个forkpty

使用cmake编译工程代码出现undefined reference to `forkpty' 错误

forkpty 和openpty都在libutil.so文件中 通过nm  /usr/lib/libutil.so 可以看到其符号

原因:cmake版本过低。

解决方法: 1.添加编译选项 -util 手动链接这个底层库

                     2.升级cmake版本。我从3.5更新到了3.9,问题解决。
————————————————
版权声明:本文为CSDN博主「见习老中医」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_27468251/article/details/88059975

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值