i.MX6 Yocto工程简介与分析

i.MX6Yocto工程简介与分析

按照NXP官方网站的说法,i.MX6的源码都发布在Yocto Project Freescale i.MX6 release工程里了。The FSL Yocto Project Community BSP (freescale.github.io)是一个社区驱动的在Yocto Project里提供相关i.MX6单板支持和维BoardSupport Packagemetalayer社区。使用OpenEmbedded-Core 和 Poky Yocto版本,提供如下主要3个主要meta layer:

meta-freescale: 提供基本BSP支持。

meta-freescale-3rdparty: 第三方和合作伙伴板级支持。

meta-freescale-distro: 提供和版本发布、包管理相关的支持。

 

该社区最近发布的版本为2.0版本Jethro(对于imx-4.0)、2.1版本Krogoth (对于imx-4.1)和2.2版本Morty (对于imx-4.2)。我们选用imx-4.1.15-2.0.0这个稳定分支。

 

1、YoctoProject简介

术语 yocto 是最小的SI 单元。作为一个前缀,yocto表示10^-24。YoctoProject是一个开源的协作软件,提供模板、工具和方法帮你创建定制的 Linux 系统和嵌入式产品,而无需关心硬件体系,支持ARM, PPC, MIPS,x86 (32 & 64 bit)硬件体系架构。适合嵌入式Linux开发人员使用。查看Yocto Project Quick Start。

在整个Yocto Project中,这些部分被称为项目,包括构建工具、称为核心配方的构建指令元数据、库、实用程序和图形用户界面 (GUI)。

Poky是YoctoProject的参考发布版本。它包括OpenEmbedded构建系统(BitBake and OpenEmbedded Core)和一系列metadata,帮助开发者构建自己的distro。Poky 这一名称也指使用参考构建系统得到的默认 Linux 发行版,它可能极其小 (core-image-minimal),也可能是带有 GUI 的整个Linux 系统 (core-image-sato),它是一个关于搭建编译你自己制定的Linux发布版本的一个源代码用例。

 

BitBake 是一个构建引擎,像所有的build工具一样(比如make,ant,jam)控制如何去构建系统并且解决构建依赖。BitBake不是基于固定依赖关系的makefile,而是收集和管理大量没有依赖关系的描述文件(称为包的配方recipes),然后自动按照正确的顺序进行构建。它读取recipes配方并通过获取程序包来密切关注它们、构建它们并将结果纳入可引导映像。BitBake 由 Yocto Project 和OpenEmbedded 项目共同维护。

 

 OpenEmbedded,简称OE,它用来构建和管理嵌入式开发系统(交叉编译、安装、打包)。2004年10月7日ChrisLarson把OE分成了两个项目。一个是BitBake(构建任务的执行者),一个是OpenEmbedded(实际上是为BitBake提供元数据)。YoctoProject使用的OE称为OpenEmbedded-Core,是一些脚本(shell和Python脚本)和用来交叉编译、安装和打包的metadata(元数据)构成的自动构建系统。

 

metadata元数据集按层进行排列,每一层都可以为下面的层提供单独的功能。基层是 OpenEmbedded-Core 或oe-core,提供了所有构建项目所必需的常见配方、类和相关功能。然后可以通过在 oe-core 之上添加新层来定制构建。OpenEmbedded-Core 由Yocto Project 和 OpenEmbedded 项目共同维护。将 Yocto Project 与 OpenEmbedded 分开的层是meta-yocto 层,该层提供了 Poky 发行版配置和一组核心的参考 BSP。

metadata元数据集包含如下部分:

recipes(配方):(.bb/.bbappend)组件的逻辑单元的构建规范,用来获取源代码、构建和打包组件;

class:(.bbclass)包括各个recipes之间共享的相同的功能;

configuration:(.conf)定义Poky如何的各种配置文件;

layers:一系列相同的recipes,就像meta-fsl-arm。

 

板卡支持包BSP含为特定板卡或架构构建 Linux 必备的基本程序包和驱动程序。这通常由生产板卡的硬件制造商维护。

 

2、Freescalei.MX6 Yocto Project搭建

a)基本软硬件环境要求

虽然按照《i.MX Yocto Project User's Guide》中所说Ubuntu 12.04和14.04版本均可,但是为了以后升级和维护的便利,强烈建议使用14.04版本!内存要2G以上(注意不是包括2G,因为内存太小编译可能有问题),磁盘空间至少80G以上,推荐120G,CPU至少双核。强烈不推荐虚拟机的方式,直接在硬盘上安装Ubuntu,除非你的磁盘性能很高。

 

b)建立Ubuntu 14.04所需要的包

建立Ubuntu 14.04开发包之前,最好把Ubuntu在SoftwareUpdater里更新到最新。

sudo apt-get update

sudo apt-get install gawk wget git-corediffstat unzip texinfo gcc-multilib \

build-essential chrpath socatlibsdl1.2-dev

 

sudo apt-get install libsdl1.2-devxterm sed cvs subversion coreutils texi2html \

docbook-utils python-pysqlite2 help2manmake gcc g++ desktop-file-utils \

libgl1-mesa-dev libglu1-mesa-devmercurial autoconf automake groff curl lzop asciidoc

 

sudo apt-get install u-boot-tools

 

c)下载repo

mkdir ~/bin (this step may not beneeded if the bin folder already exists)

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo> ~/bin/repo

参考文档1给出的地址需要才能下载,所以换个地址:

curlhttp://php.webtutor.pl/en/wp-content/uploads/2011/09/repo > ~/bin/repo

chmod a+x ~/bin/repo

vi ~/.bashrc 在尾部加:

export PATH=~/bin:$PATH

 

d)配置git

git config --global user.name"Your Name"

git config --global user.email"Your Email"

git config --list

 

e) Yocto Project Setup

cd ~

mkdir imx6 && cd imx6

mkdir fsl-release-bsp && cdfsl-release-bsp

repo init -ugit://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth –m imx-4.1.15-2.0.0.xml --repo-url=https://gerrit-google.tuna.tsinghua.edu.cn/git-repo

//repo可能找不到,export PATH=~/bin:$PATH下,要是不行,可使用Ubuntu的提示:sudo apt-get installphablet-tools

repo sync  //时间可能比较长,依赖于你的网络。

 

3、ImageBuild

a)Build configurations

Freescale提供了一个脚本fsl-setup-release.sh,能大大简化构建配置。

DISTRO= MACHINE= source fsl-setup-release.sh -b

指定要生成的distribution,固定为以下内容的一个:

fsl-imx-x11      只支持X11 graphics

fsl-imx-wayland  只支持Waylandweston graphics

fsl-imx-xwayland 支持 Waylandgraphics 和X11

fsl-imx-fb       只支持Frame Buffer graphics ,不支持X11和Wayland

 

指定板子型号,可在sources/meta-fsl-arm/conf/machine看到所有的支持型号,fsl-setup-release.sh脚本会根据MACHINE指定的内容从sources/meta-fsl-arm/conf/machine里面的文件选择对应的.conf进行编译,有下面的值:

imx23evk

imx28evk

imx51evk

imx53ard

imx53qsb

imx6dlsabreauto

imx6dlsabresd

imx6qdlsolo

imx6qpsabreauto

imx6qpsabresd

imx6qsabreauto

imx6qsabresd

imx6slevk

imx6sll_all

imx6sllevk

imx6slllpddr2arm2

imx6slllpddr3arm2

imx6solosabreauto

imx6solosabresd

imx6sx14x14arm2

imx6sx17x17arm2

imx6sx19x19ddr3arm2

imx6sx19x19lpddr2arm2

imx6sx_all

imx6sxsabreauto

imx6sxsabresd

imx6ul14x14ddr3arm2

imx6ul14x14lpddr2arm2

imx6ul7d

imx6ul9x9evk

imx6ulevk

imx6ull14x14ddr3arm2

imx6ull14x14evk

imx6ull9x9evk

imx7d12x12ddr3arm2

imx7d12x12lpddr3arm2

imx7d19x19ddr3arm2

imx7d19x19lpddr2arm2

imx7d19x19lpddr3arm2

imx7dsabresd

ls1021atwr

twr-vf65gs10

 

是编译的目录,我们可以任意指定一个目录名,编译的时候将在当前目录下新建这个目录。

 

当执行该脚本之后,会在目录下生成配置文件。在/conf/local.conf会指定DL_DIR的内容,该路径用于下载并保存编译所需要的包。在bitbake在编译的时候会先去该路径查看有没有所需的包,如果没有,就从网上下载到该目录下。一般情况下这些包都是固定的,在团队开发中可由一人先下载,之后共享出来,然后每个人将DL_DIR指定到该共享文件夹就可以省去网上下载的麻烦。

/conf/bblayers.conf会指定所需要的layers。bitbake在启动时会执行bitbake.conf,bitbake.conf会装载用户提供的local.conf。然后根据用户在local.conf中定义的硬件平台MACHINE和发布目标DISTRO装载machine子目录和distro子目录的配置文件。machine子目录里是硬件平台相关的配置文件。distro子目录里是与发布目标相关的配置文件。配置文件负责设置bitbake内部使用的环境变量。这些变量会影响整个构建过程。

 

每次新打开一个窗口,都要进行一次source操作。

#sourcesetup-environment

 

我们使用的是

DISTRO=fsl-imx-x11 MACHINE= imx6qsabresd source fsl-setup-release.sh–b build-x11

 

b)选择一个镜像编译

可供选择的镜像名字如下表格:

Image name

Target

Provided by layer

core-image-minimal

A small image that only allows a device to boot.

poky

core-image-base

A console-only image that fully supports the target device hardware.

poky

core-image-sato

An image with Sato, a mobile environment and visual style for mobile devices. The image supports X11 with a Sato theme and uses Pimlico applications. It contains a terminal, an editor and a file manager.

poky

fsl-image-machine-test

An FSL Community i.MX core image with console environment - no GUI interface.

meta-fsl-demos

fsl-image-gui

Builds a Freescale image with a GUI without any Qt content.

meta-fsl-bsp-release/imx/meta-sdk

fsl-image-qt5

Builds an opensource Qt 5 image. These images are only supported for i.MX SoC with hardware graphics. They are not supported on the i.MX 6UltraLite, i.MX 6UltraLiteLite,and i.MX 7Dual.

meta-fsl-bsp-release/imx/meta-sdk

 

我们一般使用core-image-base和fsl-image-gui吧。

c)编译镜像

bitbake  image-name

我们使用的是bitbake fsl-image-gui

然后漫长的等待,因为要下载7000+个源码包,并把它们编译完全。

 

4、编译完成后源码目录粗略分析

├── build-x11   //编译目录

│   ├── cache //编译缓存

│   ├── conf //配置

│   ├── sstate-cache  //保存状态,如果没有改变下次不再重新编译包

│   │   └── Ubuntu-14.04

│   └── tmp  //镜像,代码

│       ├── buildstats  //编译时状态记录,如果中断可以续编

│       │   ├── 20171116021902

│       │   └── 20171116063407

│       ├── cache   //编译过程中的缓存

│       │   └── default-glibc

│       ├── deploy  //生成的镜像、文件系统及安装插件

│       │   ├── images

│       │   ├── licenses

│       │   └── rpm

│       ├── log  //编译生成的日志文件

│       │   └── cooker

│       ├── sstate-control  //编译完成的包会在这里建立文件以标识

│       ├── stamps

│       │   ├── all-poky-linux

│       │   ├── cortexa9hf-neon-mx6qdl-poky-linux-gnueabi

│       │   ├── cortexa9hf-neon-poky-linux-gnueabi

│       │   ├── imx6qsabresd-poky-linux-gnueabi

│       │   ├── work-shared

│       │   └── x86_64-linux

│       ├── sysroots    //缓存的工具连,但是用不了

│       │   ├── imx6qsabresd

│       │   ├── imx6qsabresd-tcbootstrap

│       │   └── x86_64-linux

│       ├── work  //代码都在这里

│       │   ├── all-poky-linux

│       │   ├── cortexa9hf-neon-mx6qdl-poky-linux-gnueabi

│       │   ├── cortexa9hf-neon-poky-linux-gnueabi

│       │   ├── imx6qsabresd-poky-linux-gnueabi

│       │   └── x86_64-linux

│       └── work-shared

│           ├── gcc-5.3.0-r0

│           └── imx6qsabresd

└── sources  //repo下载的yocto

   ├── base //baseconfiguration for FSL Community BSP

   │   └── conf

   ├── meta-browser  //浏览器支持

   │   ├── classes

   │   ├── conf

   │   ├── recipes-browser

   │   │   └── chromium

   │   ├── recipes-gnome

   │   │   └── gnome-settings-daemon

   │   ├── recipes-mozilla

   │   │   ├── firefox

   │   │   ├── firefox-addon

   │   │   ├── firefox-l10n

   │   │   └── mozilla-devscripts

   │   └── scripts

   ├── meta-fsl-arm //Freescale ARM基础和Freescale ARM参考板支持

   │   ├── browser-layer

   │   │   └── recipes-browser

   │   ├── classes

   │   ├── conf

   │   │   └── machine

   │   ├── efl-layer

   │   │   └── recipes-efl

   │   ├── filesystem-layer

   │   │   └── recipes-fsl

   │   ├── openembedded-layer

   │   │   ├── recipes-benchmark

   │   │   ├── recipes-kernel

   │   │   └── recipes-support

   │   ├── qt4-layer

   │   │   └── recipes-qt4

   │   ├── qt5-layer

   │   │   └── recipes-qt

   │   ├── recipes-bsp

   │   │   ├── alsa-state

   │   │   ├── apptrk

   │   │   ├── barebox

   │   │   ├── change-file-endianess

   │   │   ├── elftosb

   │   │   ├── firmware-imx

   │   │   ├── formfactor

   │   │   ├── imx-bootlets

   │   │   ├── imx-kobs

   │   │   ├── imx-lib

   │   │   ├── imx-test

   │   │   ├── imx-uuc

   │   │   ├── imx-vpu

   │   │   ├── mxsldr

   │   │   ├── qe-ucode

   │   │   ├── rcw

   │   │   └── u-boot

   │   ├── recipes-core

   │   │   ├── packagegroup

   │   │   └── udev

   │   ├── recipes-devtools

   │   │   ├── cst

   │   │   ├── devregs

   │   │   ├── imx-usb-loader

   │   │   └── qemu

   │   ├── recipes-fsl

   │   │   ├── images

   │   │   └── packagegroups

   │   ├── recipes-graphics

   │   │   ├── cairo

   │   │   ├── clutter

   │   │   ├── cogl

   │   │   ├── drm

   │   │   ├── eglinfo

   │   │   ├── gtk+

   │   │   ├── images

   │   │   ├── imx-gpu-viv

   │   │   ├── mesa

   │   │   ├── piglit

   │   │   ├── wayland

   │   │   ├── xinput-calibrator

   │   │   ├── xorg-driver

   │   │   └── xorg-xserver

   │   ├── recipes-kernel

   │   │   ├── kernel-modules

   │   │   └── linux

   │   ├── recipes-multimedia

   │   │   ├── alsa

   │   │   ├── gstreamer

   │   │   ├── imx-codec

   │   │   ├── imx-parser

   │   │   ├── imx-vpuwrap

   │   │   ├── libimxvpuapi

   │   │   └── pulseaudio

   │   ├── SCR

   │   │   └── imx

   │   └── scripts

   │       └── lib

   ├── meta-fsl-arm-extra  //第三方和合作伙伴板级支持

   │   ├── conf

   │   │   └── machine

   │   ├── recipes-bsp

   │   │   ├── barebox

   │   │   ├── broadcom-nvram-config

   │   │   ├── formfactor

   │   │   ├── imx-bootlets

   │   │   ├── libmcc

   │   │   ├── libmcc2

   │   │   ├── mqxboot

   │   │   └── u-boot

   │   ├── recipes-core

   │   │   ├── init-ifupdown

   │   │   └── net-persistent-mac

   │   └── recipes-kernel

   │       ├── kernel-module-mcc-toradex

   │       ├── kernel-modules

   │       ├── linux

   │       └── linux-firmware

   ├── meta-fsl-bsp-release  // Freescale BSPrelease layer

   │   └── imx

   │       ├── classes

   │       ├── meta-bsp

   │       ├── meta-sdk

   │       └── tools

   ├── meta-fsl-demos  //额外的协助开发和测试板载能力

   │   ├── conf

   │   ├── recipes-fsl

   │   │   ├── fsl-rc-local

   │   │   ├── images

   │   │   └── packagegroups

   │   └── recipes-graphics

   │       ├── devil

   │       └── fsl-gpu-sdk

   ├── meta-openembedded  //OE核心层

   │   ├── contrib

   │   ├── meta-efl

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── recipes-core

   │   │   ├── recipes-devtools

   │   │   ├── recipes-efl

   │   │   ├── recipes-multimedia

   │   │   └── recipes-navigation

   │   ├── meta-filesystems

   │   │   ├── conf

   │   │   ├── recipes-filesystems

   │   │   ├── recipes-support

   │   │   └── recipes-utils

   │   ├── meta-gnome

   │   │   ├── conf

   │   │   ├── recipes-apps

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-devtools

   │   │   ├── recipes-extended

   │   │   ├── recipes-gnome

   │   │   ├── recipes-support

   │   │   └── site

   │   ├── meta-gpe

   │   │   ├── conf

   │   │   ├── recipes-graphics

   │   │   └── recipes-support

   │   ├── meta-initramfs

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── recipes-bsp

   │   │   ├── recipes-devtools

   │   │   └── recipes-kernel

   │   ├── meta-multimedia

   │   │   ├── conf

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-dvb

   │   │   ├── recipes-mediacentre

   │   │   ├── recipes-mkv

   │   │   ├── recipes-multimedia

   │   │   └── recipes-support

   │   ├── meta-networking

   │   │   ├── classes

    │   │   ├── conf

   │   │   ├── files

   │   │   ├── licenses

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-daemons

   │   │   ├── recipes-extended

   │   │   ├── recipes-filter

   │   │   ├── recipes-irc

   │   │   ├── recipes-kernel

   │   │   ├── recipes-netkit

   │   │   ├── recipes-protocols

   │   │   └── recipes-support

   │   ├── meta-oe

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── licenses

   │   │   ├── recipes-benchmark

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-core

   │   │   ├── recipes-devtools

   │   │   ├── recipes-extended

   │   │   ├── recipes-gnome

   │   │   ├── recipes-graphics

   │   │   ├── recipes-kernel

   │   │   ├── recipes-multimedia

   │   │   ├── recipes-navigation

   │   │   ├── recipes-sato

   │   │   ├── recipes-support

   │   │   ├── recipes-test

   │   │   └── site

   │   ├── meta-perl

   │   │   ├── conf

   │   │   ├── recipes-extended

   │   │   └── recipes-perl

   │   ├── meta-python

   │   │   ├── classes

   │   │   ├── conf

   │   │   ├── licenses

   │   │   ├── recipes-connectivity

   │   │   ├── recipes-devtools

   │   │   └── recipes-extended

   │   ├── meta-ruby

   │   │   ├── classes

   │   │   ├── conf

   │   │   └── recipes-devtools

   │   ├── meta-systemd

   │   │   ├── conf

   │   │   ├── oe-core

   │   │   └── recipes-core

   │   ├── meta-webserver

   │   │   ├── conf

   │   │   ├── licenses

   │   │   ├── recipes-httpd

   │   │   ├── recipes-php

   │   │   ├── recipes-support

   │   │   └── recipes-webadmin

   │   └── meta-xfce

   │       ├── classes

   │       ├── conf

   │       ├── recipes-apps

   │       ├── recipes-art

   │       ├── recipes-bindings

   │       ├── recipes-core

   │       ├── recipes-extended

   │       ├── recipes-multimedia

   │       ├── recipes-panel-plugins

   │       ├── recipes-support

   │       ├── recipes-thunar-plugins

   │       └── recipes-xfce

   ├── meta-qt5  //QT5支持

   │   ├── classes

   │   ├── conf

   │   ├── files

   │   ├── lib

   │   │   └── recipetool

   │   ├── licenses

   │   ├── recipes-devtools

   │   │   └── gdb

   │   └── recipes-qt

   │       ├── demo-extrafiles

   │       ├── examples

   │       ├── libconnman-qt

   │       ├── maliit

   │       ├── meta

   │       ├── packagegroups

   │       ├── qsiv

   │       ├── qt5

   │       ├── quazip

   │       └── tufao

   └── poky //基本Yocto Project的Poky版本

       ├── bitbake

       │   ├── bin

       │   ├── contrib

       │   ├── doc

       │   └── lib

       ├── documentation

       │   ├── adt-manual

       │   ├── bsp-guide

       │   ├── dev-manual

       │   ├── kernel-dev

       │   ├── mega-manual

       │   ├── profile-manual

       │   ├── ref-manual

       │   ├── sdk-manual

       │   ├── template

       │   ├── toaster-manual

       │   ├── tools

       │   └── yocto-project-qs

       ├── meta

       │   ├── classes

       │   ├── conf

       │   ├── files

       │   ├── lib

       │   ├── recipes-bsp

       │   ├── recipes-connectivity

       │   ├── recipes-core

       │   ├── recipes-devtools

       │   ├── recipes-extended

       │   ├── recipes-gnome

       │   ├── recipes-graphics

       │   ├── recipes-kernel

       │   ├── recipes-lsb4

       │   ├── recipes-multimedia

       │   ├── recipes-rt

       │   ├── recipes-sato

       │   ├── recipes-support

       │   └── site

       ├── meta-poky

       │   ├── classes

       │   ├── conf

       │   └── recipes-core

       ├── meta-selftest

       │   ├── classes

       │   ├── conf

       │   ├── files

       │   ├── lib

       │   └── recipes-test

       ├── meta-skeleton

       │   ├── conf

       │   ├── recipes-core

       │   ├── recipes-kernel

       │   ├── recipes-multilib

       │   └── recipes-skeleton

       ├── meta-yocto

       │   └── conf

       ├── meta-yocto-bsp

       │   ├── conf

       │   ├── lib

       │   ├── recipes-bsp

       │   ├── recipes-core

       │   ├── recipes-graphics

       │   └── recipes-kernel

       └── scripts

            ├── contrib

            ├── lib

            ├── native-intercept

            ├── postinst-intercepts

            ├── pybootchartgui

            └── tiny

没有downloads目录是因为我把它设置到其他地方了。

 

5、可能存在的问题

(1) bitbake编译时提示在TMPDIR或SSTATE_DIR创建一个长名文件失败

x@x:~/imx6/fsl-release-bsp/build-x11$ bitbake fsl-image-gui

NOTE: Your conf/bblayers.conf has been automatically updated.

ERROR: OE-core's config sanity checker detected a potential misconfiguration.

Either fix the cause of this error or at your own risk disable the checker(see sanity.conf).

Following is the list of potential problems / advisories:

 

Failed to create a file with a long name in TMPDIR. Please use afilesystem that does not unreasonably limit filename length.

Failed to create a file with a long name in SSTATE_DIR. Please use afilesystem that does not unreasonably limit filename length.

 

问题可能原因:# Check thatTMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)

 

解决方法:把用户目录去掉加密。

去掉加密步骤:

1)、备份主目录 sudo cp -rp /home/x /home/xx

2)、启动root登录,sudo passwd

3)、root登录进去新建一个账号z,useradd z //注意不用创建目录

4)、重启系统,用z账号shell登录进去,然后su切换到root账号

5)、root账号下删除x用户目录 rm -rf /home/x

在root用户下删除主目录时失败,提示的资源文件忙,这时重启一下机器用root用户登录系统,在删除就没有问题了。

6)、重命名备份主目录xx为主目录x:mv /home/xx /home/x

7)、root账号下删除加密文件

rm -rf /home/.ecryptfs   

rm -rf /home/x/.ecryptfs

rm -rf /home/x/.Private

8)、账号x下取消root账号登录:sudo passwd -l root

9)、账号x下删除z账号:sudo userdel -rf z

(2) bitbake编译boost时提示virtual memory exhausted:

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: gcc.compile.c++ /home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/settings_parser.o

   "arm-poky-linux-gnueabi-g++" "-march=armv7-a""-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9""-Wl,-O1" "-Wl,--hash-style=gnu""-Wl,--as-needed""--sysroot=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd"  -ftemplate-depth-128  -O2 -pipe -g -feliminate-unused-debug-types-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0=/usr/src/debug/boost/1.60.0-r0-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/x86_64-linux=-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd=  -fvisibility-inlines-hidden -O3-finline-functions -Wno-inline -Wall -pthread -fPIC -fno-strict-aliasing-ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1-DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1-DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1-DBOOST_LOG_DYN_LINK=1 -DBOOST_LOG_SETUP_BUILDING_THE_LIB=1-DBOOST_LOG_SETUP_DLL -DBOOST_LOG_USE_NATIVE_SYSLOG-DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1-DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED-DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1-DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG-D_GNU_SOURCE=1 -D_XOPEN_SOURCE=600 -I"." -c -o "/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/settings_parser.o""libs/log/src/settings_parser.cpp"

virtual memory exhausted:Cannot allocate memory

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: gcc.compile.c++ /home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/init_from_settings.o

   "arm-poky-linux-gnueabi-g++" "-march=armv7-a""-mfpu=neon" "-mfloat-abi=hard" "-mcpu=cortex-a9""-Wl,-O1" "-Wl,--hash-style=gnu""-Wl,--as-needed""--sysroot=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd"  -ftemplate-depth-128  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0=/usr/src/debug/boost/1.60.0-r0-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/x86_64-linux=-fdebug-prefix-map=/home/x/imx6/fsl-release-bsp/build-x11/tmp/sysroots/imx6qsabresd=  -fvisibility-inlines-hidden -O3-finline-functions -Wno-inline -Wall -pthread -fPIC -fno-strict-aliasing-ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1-DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1-DBOOST_DATE_TIME_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1-DBOOST_LOG_DYN_LINK=1 -DBOOST_LOG_SETUP_BUILDING_THE_LIB=1-DBOOST_LOG_SETUP_DLL -DBOOST_LOG_USE_NATIVE_SYSLOG-DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1-DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED-DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_DONT_USE_CHRONO=1-DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DDATE_TIME_INLINE -DNDEBUG-D_GNU_SOURCE=1 -D_XOPEN_SOURCE=600 -I"." -c -o "/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/boost_1_60_0/arm-poky-linux-gnueabi/boost/bin.v2/libs/log/build/8208f58b5e252bb068de8fecdebc659d/init_from_settings.o""libs/log/src/init_from_settings.cpp"

In file included from ./boost/smart_ptr/detail/atomic_count.hpp:80:0,

                 from./boost/smart_ptr/intrusive_ref_counter.hpp:19,

                 from./boost/log/attributes/attribute.hpp:21,

                 from./boost/log/attributes/attribute_value_set.hpp:26,

                 from./boost/log/core/record.hpp:21,

                 from./boost/log/core/core.hpp:23,

                 from./boost/log/core.hpp:20,

                 fromlibs/log/src/init_from_settings.cpp:53:

./boost/smart_ptr/detail/atomic_count_sync.hpp: In member function 'longint boost::detail::atomic_count::operator++()':

./boost/smart_ptr/detail/atomic_count_sync.hpp:49:5: warning: no returnstatement in function returning non-void [-Wreturn-type]

     }

     ^

In file included from ./boost/asio/ip/impl/address_v4.ipp:21:0,

                 from./boost/asio/ip/address_v4.hpp:240,

                 from./boost/asio/ip/address.hpp:21,

                 fromlibs/log/src/init_from_settings.cpp:65:

./boost/asio/error.hpp: At global scope:

./boost/asio/error.hpp:258:45: warning:'boost::asio::error::system_category' defined but not used [-Wunused-variable]

 static constboost::system::error_category& system_category

                                             ^

./boost/asio/error.hpp:260:45: warning:'boost::asio::error::netdb_category' defined but not used [-Wunused-variable]

 static constboost::system::error_category& netdb_category

                                             ^

./boost/asio/error.hpp:262:45: warning: 'boost::asio::error::addrinfo_category'defined but not used [-Wunused-variable]

 static constboost::system::error_category& addrinfo_category

                                             ^

./boost/asio/error.hpp:264:45: warning:'boost::asio::error::misc_category' defined but not used [-Wunused-variable]

 static constboost::system::error_category& misc_category

                                             ^

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: ...failed updating 1 target...

 

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

boost-1.60.0-r0 do_compile: + bb_exit_handler

+ ret=1

+ echo WARNING: exit code 1 from a shell command.

 

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

ERROR: boost-1.60.0-r0 do_compile: Function failed: do_compile (log fileis located at/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/temp/log.do_compile.8886)

Currently 1 running tasks (260 of 260):

0: boost-1.60.0-r0 do_compile (pid 8886)

ERROR: Logfile of failure stored in:/home/x/imx6/fsl-release-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/boost/1.60.0-r0/temp/log.do_compile.8886

Log data follows:

问题原因不清楚,可能是因为虚拟机内存(2GB)太小导致,也可能是虚拟机本身导致的。换成4GB内存和非虚拟机方式,问题不在重新。

 

6、参考文档:

1、《i.MX Yocto Project User's Guide》

2、FSL Community BSP:http://freescale.github.io

3、IBM Jeffrey Osier-Mixon:使用Yocto Project构建自定义嵌入式Linux发行版。
--------------------- 
作者:Gordon-Li 
来源:CSDN 
原文:https://blog.csdn.net/ligordon/article/details/78569994 
版权声明:本文为博主原创文章,转载请附上博文链接!

https://blog.csdn.net/ligordon/article/details/78569994

你可能感兴趣的:(Linux)