Build error:undefined reference to `stime' on Yocto Warrior


Sourabh Hegde
 

Hello All,

When I execute the bitbake for my custom image recipe I hit the below issue related to "qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'".

DEBUG: Executing shell function do_compile
NOTE: make -j 8 LD=ld  AR=ar OBJCOPY=objcopy LDFLAGS=-L/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/recipe-sysroot-native/usr/lib                         -L/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/recipe-sysroot-native/lib                         -Wl,-O1 -fuse-ld=bfd
  LINK    i386-linux-user/qemu-i386
  LINK    mipsel-linux-user/qemu-mipsel
  LINK    arm-linux-user/qemu-arm
  LINK    mips-linux-user/qemu-mips
  LINK    ppc-linux-user/qemu-ppc
  GEN     x86_64-linux-user/config-target.h
  LINK    sh4-linux-user/qemu-sh4
  CC      x86_64-linux-user/exec.o
  CC      x86_64-linux-user/tcg/tcg.o
  CC      x86_64-linux-user/tcg/tcg-op.o
/root/build-rauc/tmp-glibc/hosttools/ld.bfd: linux-user/syscall.o: in function `do_syscall1':
/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-arm] Error 1
make: *** [Makefile:483: subdir-arm-linux-user] Error 2
make: *** Waiting for unfinished jobs....
  CC      x86_64-linux-user/tcg/tcg-op-vec.o
/root/build-rauc/tmp-glibc/hosttools/ld.bfd: linux-user/syscall.o: in function `do_syscall1':
/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-i386] Error 1
make: *** [Makefile:483: subdir-i386-linux-user] Error 2
  CC      x86_64-linux-user/tcg/tcg-op-gvec.o
/root/build-rauc/tmp-glibc/hosttools/ld.bfd: linux-user/syscall.o: in function `do_syscall1':
/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-sh4] Error 1
make: *** [Makefile:483: subdir-sh4-linux-user] Error 2
  CC      x86_64-linux-user/tcg/tcg-common.o
/root/build-rauc/tmp-glibc/hosttools/ld.bfd: linux-user/syscall.o: in function `do_syscall1':
/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-ppc] Error 1
make: *** [Makefile:483: subdir-ppc-linux-user] Error 2
  CC      x86_64-linux-user/tcg/optimize.o
/root/build-rauc/tmp-glibc/hosttools/ld.bfd: linux-user/syscall.o: in function `do_syscall1':
/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-mipsel] Error 1
make: *** [Makefile:483: subdir-mipsel-linux-user] Error 2
  CC      x86_64-linux-user/fpu/softfloat.o
/root/build-rauc/tmp-glibc/hosttools/ld.bfd: linux-user/syscall.o: in function `do_syscall1':
/root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/syscall.c:7404: undefined reference to `stime'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-mips] Error 1
make: *** [Makefile:483: subdir-mips-linux-user] Error 2
  CC      x86_64-linux-user/disas.o
  GEN     x86_64-linux-user/gdbstub-xml.c
  CC      x86_64-linux-user/gdbstub.o
  CC      x86_64-linux-user/thunk.o
  CC      x86_64-linux-user/accel/stubs/hax-stub.o
  CC      x86_64-linux-user/accel/stubs/hvf-stub.o
  CC      x86_64-linux-user/accel/stubs/whpx-stub.o
  CC      x86_64-linux-user/accel/stubs/kvm-stub.o
  CC      x86_64-linux-user/accel/tcg/tcg-runtime.o
  CC      x86_64-linux-user/accel/tcg/tcg-runtime-gvec.o
  CC      x86_64-linux-user/accel/tcg/cpu-exec.o
  CC      x86_64-linux-user/accel/tcg/cpu-exec-common.o
  CC      x86_64-linux-user/accel/tcg/translate-all.o
  CC      x86_64-linux-user/accel/tcg/translator.o
  CC      x86_64-linux-user/accel/tcg/user-exec.o
  CC      x86_64-linux-user/accel/tcg/user-exec-stub.o
  CC      x86_64-linux-user/linux-user/main.o
  CC      x86_64-linux-user/linux-user/syscall.o
  CC      x86_64-linux-user/linux-user/strace.o
  CC      x86_64-linux-user/linux-user/mmap.o
  CC      x86_64-linux-user/linux-user/signal.o
  CC      x86_64-linux-user/linux-user/elfload.o
In file included from /usr/include/string.h:495,
                 from /root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/include/qemu/osdep.h:84,
                 from /root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/elfload.c:2:
In function ‘strncpy’,
    inlined from ‘fill_psinfo’ at /root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/elfload.c:3158:12,
    inlined from ‘fill_note_info’ at /root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/elfload.c:3340:5,
    inlined from ‘elf_core_dump’ at /root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/qemu-3.1.1.1/linux-user/elfload.c:3489:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC      x86_64-linux-user/linux-user/linuxload.o
  CC      x86_64-linux-user/linux-user/uaccess.o
  CC      x86_64-linux-user/linux-user/uname.o
  CCAS    x86_64-linux-user/linux-user/safe-syscall.o
  CC      x86_64-linux-user/linux-user/x86_64/signal.o
  CC      x86_64-linux-user/linux-user/x86_64/cpu_loop.o
  CC      x86_64-linux-user/linux-user/exit.o
  CC      x86_64-linux-user/linux-user/fd-trans.o
  CC      x86_64-linux-user/target/i386/helper.o
  CC      x86_64-linux-user/target/i386/cpu.o
  CC      x86_64-linux-user/target/i386/gdbstub.o
  CC      x86_64-linux-user/target/i386/xsave_helper.o
  CC      x86_64-linux-user/target/i386/translate.o
  CC      x86_64-linux-user/target/i386/bpt_helper.o
  CC      x86_64-linux-user/target/i386/cc_helper.o
  CC      x86_64-linux-user/target/i386/excp_helper.o
  CC      x86_64-linux-user/target/i386/fpu_helper.o
  CC      x86_64-linux-user/target/i386/int_helper.o
  CC      x86_64-linux-user/target/i386/mem_helper.o
  CC      x86_64-linux-user/target/i386/misc_helper.o
  CC      x86_64-linux-user/target/i386/mpx_helper.o
  CC      x86_64-linux-user/target/i386/seg_helper.o
  CC      x86_64-linux-user/target/i386/smm_helper.o
  CC      x86_64-linux-user/target/i386/svm_helper.o
  CC      x86_64-linux-user/target/i386/sev-stub.o
  GEN     trace/generated-helpers.c
  CC      x86_64-linux-user/trace/control-target.o
  CC      x86_64-linux-user/gdbstub-xml.o
  CC      x86_64-linux-user/trace/generated-helpers.o
  LINK    x86_64-linux-user/qemu-x86_64
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /root/build-rauc/tmp-glibc/work/x86_64-linux/qemu-native/3.1.1.1-r0/temp/log.do_compile.5584)


I am using "Warrior" version due to limitation from other meta-layers. I have read that above issue is fixed in newer versions of Yocto. But how can i fix this in Warrior? Is there any workaround?

Can someone please help me resolve it?

Your help will be much appreciated.

Thanks in advance.

Join yocto@lists.yoctoproject.org to automatically receive all group messages.