【问题标题】:do_compile of GNU Hello World fails in simple yocto recipeGNU Hello World 的 do_compile 在简单的 yocto 配方中失败
【发布时间】:2020-04-25 07:30:13
【问题描述】:

我写了一个简单的食谱来演示 autotools 类的功能。

SUMMARY = "GNU Helloworld application"
LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"

SRC_URI[md5sum] = "6cd0ffea3884a4e79330338dcc2987d6"
SRC_URI[sha256sum] = "31e066137a962676e89f69d1b65382de95a7ef7d914b8cb956f41ea72e0f516b"


SRC_URI = "${GNU_MIRROR}/hello/hello-2.10.tar.gz"
inherit autotools gettext

当我构建这个配方时,它在 do_compile 阶段失败

ERROR: hello-2.10-r0 do_compile: oe_runmake failed
ERROR: hello-2.10-r0 do_compile: Execution of '/home/lwl/Yocto_Training/build/tmp/work/core2-64-poky-linux/hello/2.10-r0/temp/run.do_compile.35391' failed with exit code 1:
rm -f lib/configmake.h-t && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
  echo '#define PREFIX "/usr"'; \
  echo '#define EXEC_PREFIX "/usr"'; \
  echo '#define BINDIR "/usr/bin"'; \
  echo '#define SBINDIR "/usr/sbin"'; \
  echo '#define LIBEXECDIR "/usr/libexec"'; \
  echo '#define DATAROOTDIR "/usr/share"'; \
  echo '#define DATADIR "/usr/share"'; \
  echo '#define SYSCONFDIR "/etc"'; \
  echo '#define SHAREDSTATEDIR "/com"'; \
  echo '#define LOCALSTATEDIR "/var"'; \
  echo '#define RUNSTATEDIR "/var/run"'; \
  echo '#define INCLUDEDIR "/usr/include"'; \
  echo '#define OLDINCLUDEDIR "/usr/include"'; \
  echo '#define DOCDIR "/usr/share/doc/hello"'; \
  echo '#define INFODIR "/usr/share/info"'; \
  echo '#define HTMLDIR "/usr/share/doc/hello"'; \
  echo '#define DVIDIR "/usr/share/doc/hello"'; \
  echo '#define PDFDIR "/usr/share/doc/hello"'; \
  echo '#define PSDIR "/usr/share/doc/hello"'; \
  echo '#define LIBDIR "/usr/lib"'; \
  echo '#define LISPDIR "/usr/share/emacs/site-lisp"'; \
  echo '#define LOCALEDIR "/usr/share/locale"'; \
  echo '#define MANDIR "/usr/share/man"'; \
  echo '#define MANEXT ""'; \
  echo '#define PKGDATADIR "/usr/share/hello"'; \
  echo '#define PKGINCLUDEDIR "/usr/include/hello"'; \
  echo '#define PKGLIBDIR "/usr/lib/hello"'; \
  echo '#define PKGLIBEXECDIR "/usr/libexec/hello"'; \
} | sed '/""/d' > lib/configmake.h-t && \
mv -f lib/configmake.h-t lib/configmake.h
rm -f lib/arg-nonnull.h-t lib/arg-nonnull.h && \
sed -n -e '/GL_ARG_NONNULL/,$p' \
  < ../hello-2.10/build-aux/snippet/arg-nonnull.h \
  > lib/arg-nonnull.h-t && \
mv lib/arg-nonnull.h-t lib/arg-nonnull.h
rm -f lib/c++defs.h-t lib/c++defs.h && \
sed -n -e '/_GL_CXXDEFS/,$p' \
  < ../hello-2.10/build-aux/snippet/c++defs.h \
  > lib/c++defs.h-t && \
mv lib/c++defs.h-t lib/c++defs.h
rm -f lib/warn-on-use.h-t lib/warn-on-use.h && \
sed -n -e '/^.ifndef/,$p' \
  < ../hello-2.10/build-aux/snippet/warn-on-use.h \
  > lib/warn-on-use.h-t && \
mv lib/warn-on-use.h-t lib/warn-on-use.h
/home/lwl/Yocto_Training/build/tmp/hosttools/mkdir -p lib/sys
/bin/bash: line 30: lib/configmake.h-t: No such file or directory
/bin/bash: line 1: lib/arg-nonnull.h-t: No such file or directory
/bin/bash: line 1: lib/c++defs.h-t: No such file or directory
Makefile:2734: recipe for target 'lib/configmake.h' failed
make: *** [lib/configmake.h] Error 1
make: *** Waiting for unfinished jobs....
Makefile:2873: recipe for target 'lib/arg-nonnull.h' failed
make: *** [lib/arg-nonnull.h] Error 1
Makefile:2881: recipe for target 'lib/c++defs.h' failed
make: *** [lib/c++defs.h] Error 1
rm -f lib/sys/types.h-t lib/sys/types.h && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_SYS_TYPES_H''@|<sys/types.h>|g' \
      -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \
      < ../hello-2.10/lib/sys_types.in.h; \
} > lib/sys/types.h-t && \
mv lib/sys/types.h-t lib/sys/types.h
WARNING: exit code 1 from a shell command.

我在食谱中犯了什么错误吗?

【问题讨论】:

    标签: yocto autotools bitbake


    【解决方案1】:

    请将 autotools-brokensep 类也添加到您的配方中,然后重试。

    inherit gettext autotools-brokensep
    

    如果由配方构建的软件不支持使用树外构建,您应该让配方继承 autotools-brokensep 类。 autotools-brokensep 类的行为与 autotools 类相同,但使用 B == S 构建。当树外构建支持不存在或被破坏时,此方法很有用。[1]

    这行得通吗?

    [1]https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#ref-classes-autotools

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-18
      • 2011-09-22
      • 2014-04-27
      • 2015-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-16
      相关资源
      最近更新 更多