使用 Yocto Poky 为 Raspberry Pi2 构建 QtWebEngine - vcos_platform_types.h: 没有这样的文件或目录

Building QtWebEngine for Raspberry Pi2 using Yocto Poky - vcos_platform_types.h: No such file or directory

上下文

Yocto Poky fido 分支

mkdir -p ~/yocto/dl
cd ~/yocto
git clone -b fido git://git.yoctoproject.org/poky poky
cd poky
git clone git://git.yoctoproject.org/meta-raspberrypi 
git clone -b fido https://github.com/meta-qt5/meta-qt5.git
git clone -b fido git://git.openembedded.org/meta-openembedded
git clone -b fido https://bitbucket.org/embarcados/meta-embarcados.git

bblayer.conf & local.conf

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "6"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  ${TOPDIR}/../poky/meta-embarcados \
  ${TOPDIR}/../poky/meta-embarcados/meta-rpi \
  ${TOPDIR}/../poky/meta-raspberrypi \
  ${TOPDIR}/../poky/meta-qt5 \
  ${TOPDIR}/../poky/meta-openembedded/meta-oe \
  ${TOPDIR}/../poky/meta-openembedded/meta-ruby \
  /home/otto/yocto/poky/meta \
  /home/otto/yocto/poky/meta-yocto \
  /home/otto/yocto/poky/meta-yocto-bsp \
  "
BBLAYERS_NON_REMOVABLE ?= " \
  /home/otto/yocto/poky/meta \
  /home/otto/yocto/poky/meta-yocto \
  "

/home/otto/yocto/build/conf/local.conf 添加 MACHINE = "raspberrypi2"

建造

cd ~/yocto
. poky/oe-init-build-env build
bitbake -cclean qtwebengine; bitbake qtwebengine

失败并出现关于 vcos_platform_types.h

的以下错误
| FAILED: arm-poky-linux-gnueabi-g++  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/home/otto/yocto/build/tmp/sysroots/raspberrypi2 -MMD -MF obj/src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.ozone_platform_egltest.o.d -DV8_DEPRECATION_WARNINGS -DBLINK_SCALE_FILTERS_AT_RECORD_TIME -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES '-DOPENSSLDIR="/usr/lib/ssl"' -DOPENSSL_LOAD_CONF -DEGL_API_FB=1 -DLINUX=1 -DCHROMIUM_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_OZONE=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_EGLIMAGE=1 -DCLD_VERSION=2 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DOZONE_IMPLEMENTATION -DSK_ENABLE_INST_COUNT=0 -DSK_SUPPORT_GPU=1 '-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' -DSK_ENABLE_LEGACY_API_ALIASING=1 -DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1 -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT -DSK_SUPPORT_LEGACY_GETTOPDEVICE -DSK_SUPPORT_LEGACY_BITMAP_CONFIG -DSK_SUPPORT_LEGACY_DEVICE_VIRTUAL_ISOPAQUE -DSK_SUPPORT_LEGACY_N32_NAME -DSK_SUPPORT_LEGACY_SETCONFIG -DSK_IGNORE_ETC1_SUPPORT -DSK_IGNORE_GPU_DITHER -DSK_SUPPORT_LEGACY_GETTOTALCLIP -DSK_USE_POSIX_THREADS -DSK_DEFERRED_CANVAS_USES_FACTORIES=1 -DU_USING_ICU_NAMESPACE=0 -DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_FORTIFY_SOURCE=2 -Igen/shim_headers/icui18n/target -Igen/shim_headers/icuuc/target -Igen -I../../../src/3rdparty/chromium -I../../../src/3rdparty/chromium/skia/config -I../../../src/3rdparty/chromium/third_party/skia/src/core -I../../../src/3rdparty/chromium/third_party/skia/include/core -I../../../src/3rdparty/chromium/third_party/skia/include/effects -I../../../src/3rdparty/chromium/third_party/skia/include/pdf -I../../../src/3rdparty/chromium/third_party/skia/include/gpu -I../../../src/3rdparty/chromium/third_party/skia/include/lazy -I../../../src/3rdparty/chromium/third_party/skia/include/pathops -I../../../src/3rdparty/chromium/third_party/skia/include/pipe -I../../../src/3rdparty/chromium/third_party/skia/include/ports -I../../../src/3rdparty/chromium/third_party/skia/include/utils -I../../../src/3rdparty/chromium/skia/ext -fstack-protector --param=ssp-buffer-size=4  -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mthumb --sysroot=/home/otto/yocto/build/tmp/sysroots/raspberrypi2 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -O2 -pipe -g -feliminate-unused-debug-types -fvisibility-inlines-hidden -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -Wno-abi  -c ../../../src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.cc -o obj/src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.ozone_platform_egltest.o
| In file included from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos_assert.h:149:0,
|                  from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos.h:114,
|                  from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vmcs_host/vc_dispmanx.h:33,
|                  from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/EGL/eglplatform.h:110,
|                  from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/EGL/egl.h:36,
|                  from ../../../src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.cc:28:
| /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos_types.h:38:33: fatal error: vcos_platform_types.h: No such file or directory
|  #include "vcos_platform_types.h"
|                                  ^
| compilation terminated.
| ninja: build stopped: subcommand failed.
| make[3]: *** [invoke_ninja] Error 1
| make[3]: Leaving directory `/home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwebengine/5.4.1-r0/qtwebengine-opensource-src-5.4.1/src/core'
| make[2]: *** [sub-gyp_run-pro-make_first] Error 2
| make[2]: Leaving directory `/home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwebengine/5.4.1-r0/qtwebengine-opensource-src-5.4.1/src/core'
| make[1]: *** [sub-core-make_first] Error 2
| make[1]: Leaving directory `/home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwebengine/5.4.1-r0/qtwebengine-opensource-src-5.4.1/src'
| make: *** [sub-src-make_first] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwebengine/5.4.1-r0/temp/log.do_compile.24134)
ERROR: Task 754 (/home/otto/yocto/build/../poky/meta-qt5/recipes-qt/qt5/qtwebengine_5.4.1.bb, do_compile) failed with exit code '1'
Currently 3 running tasks (3091 of 4520):
0: qttools-5.4.1-r0 do_compile (pid 24033)
1: qtquick1-5.4.1-r0 do_package (pid 24131)
2: qtwebkit-examples-5.4.1-r0 do_compile (pid 24135)

在你自己的 .bbappend 中添加依赖项:

otto@marvin:~/yocto/poky$ more meta-embarcados/meta-rpi/recipes-qt/qt5/qtwebengine_%.bbappend

CXXFLAGS +=" -I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads \
             -I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux \
           "

# Do not get out of memory
LDFLAGS += "-Wl,--no-keep-memory"

问题讨论的很详细here

Tutorial to create Yocto distro for RPi2 that contains QT5.4