问题描述
我正在尝试使用yocto项目将Meta-java层添加到基本图像。我按照以下步骤进行了配置。
克隆元Java存储库git clone git://git.yoctoproject.org/Meta-java
添加图层
source Meta-agl/scripts/aglsetup.sh
bitbake-layers add-layer ../Meta-java
通过将以下内容添加到 build / conf / local.conf 文件来配置项目。
PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
使用以下内容更新local.conf文件
IMAGE_INSTALL_append = " openjre-8"
构建图像。
cd build
bitbake agl-image-minimal
在“ bitbake”命令上运行此命令时,出现以下错误。
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.46.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "x86_64-agl-linux"
MACHINE = "qemux86-64"
disTRO = "poky-agl"
disTRO_VERSION = "9.99.3"
TUNE_FEATURES = "m64 corei7"
TARGET_FPU = ""
Meta-oe
Meta-multimedia
Meta-networking
Meta-python
Meta-filesystems = "HEAD:cc6fc6b1641ab23089c1e3bba11e0c6394f0867c"
Meta-agl-profile-core
Meta-agl-distro
Meta-agl-bsp = "HEAD:cb90a88d382971a146c4b7413bb6df6563cef7d1"
Meta-security = "HEAD:982a29bbb7ef32475aea7c4bb56c620065a50927"
Meta-perl = "HEAD:cc6fc6b1641ab23089c1e3bba11e0c6394f0867c"
Meta-security
Meta-app-framework = "HEAD:cb90a88d382971a146c4b7413bb6df6563cef7d1"
Meta
Meta-poky = "HEAD:4e931b1d05018923dc145cd97f6f965f5cb6e1a5"
Meta-java = "master:3b65eea96eddde97169ca5e00be01a9dbd257786"
Initialising tasks: 100% |##############################################################################################################################################################| Time: 0:00:02
sstate summary: Wanted 7 Found 0 Missed 7 Current 2107 (0% match,99% complete)
NOTE: Executing Tasks
ERROR: openjre-8-265-r0 do_compile: oe_runmake Failed
ERROR: openjre-8-265-r0 do_compile: Execution of '/home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/temp/run.do_compile.9058' Failed with exit code 1:
/home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga//make/Main.gmk:43: Running shell command
+ /home/agl-yocto/build/tmp/hosttools/rm -f /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/build/build.log.old
/home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga//make/Main.gmk:44: Running shell command
+ /home/agl-yocto/build/tmp/hosttools/mv /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/build/build.log /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/build/build.log.old
<<Other output>>
<<Other output>>
<<Other output>>
:::
:::
<<Other output>>
<<Other output>>
<<Other output>>
| g++: error: unrecognized command line option ‘-fmacro-prefix-map=/home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0=/usr/src/debug/openjre-8/265-r0’
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/adlparse.o' Failed
| make[6]: *** [../generated/adfiles/adlparse.o] Error 1
| make[6]: *** Waiting for unfinished jobs....
| make[6]: *** [../generated/adfiles/formsopt.o] Error 1
| make[6]: *** [../generated/adfiles/dict2.o] Error 1
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/formsopt.o' Failed
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/dict2.o' Failed
| make[6]: *** [../generated/adfiles/archDesc.o] Error 1
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/archDesc.o' Failed
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/arena.o' Failed
| make[6]: *** [../generated/adfiles/arena.o] Error 1
| make[6]: *** [../generated/adfiles/dfa.o] Error 1
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/dfa.o' Failed
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/forms.o' Failed
| make[6]: *** [../generated/adfiles/forms.o] Error 1
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/adlc.make:228: recipe for target '../generated/adfiles/filebuff.o' Failed
| make[6]: *** [../generated/adfiles/filebuff.o] Error 1
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/makefiles/top.make:91: recipe for target 'ad_stuff' Failed
| make[5]: *** [ad_stuff] Error 2
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga/hotspot/make/linux/Makefile:284: recipe for target 'product' Failed
| make[4]: *** [product] Error 2
| Makefile:230: recipe for target 'generic_build2' Failed
| make[3]: *** [generic_build2] Error 2
| Makefile:177: recipe for target 'product' Failed
| make[2]: *** [product] Error 2
| HotspotWrapper.gmk:44: recipe for target '/home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/build/hotspot/_hotspot.timestamp' Failed
| make[1]: *** [/home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/build/hotspot/_hotspot.timestamp] Error 2
| /home/agl-yocto/build/tmp/work/corei7-64-agl-linux/openjre-8/265-r0/jdk8u-jdk8u265-ga//make/Main.gmk:109: recipe for target 'hotspot-only' Failed
| make: *** [hotspot-only] Error 2
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/agl-yocto/Meta-java/recipes-core/openjdk/openjre-8_265.bb:do_compile) Failed with exit code '1'
NOTE: Tasks Summary: Attempted 5486 tasks of which 5485 didn't need to be rerun and 1 Failed.
Summary: 1 task Failed:
/home/agl-yocto/Meta-java/recipes-core/openjdk/openjre-8_265.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown,returning a non-zero exit code.
解决方法
该错误是由于旧版GCC引起的。只是发布对我有用的东西。
检查您的GCC版本
gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation,Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See this note from the below link for more details:
https://www.yoctoproject.org/pipermail/meta-virtualization/2019-February/004028.html
将您的GCC版本升级到8。
遵循此处描述的步骤:https://askubuntu.com/questions/1028601/install-gcc-8-only-on-ubuntu-18-04sudo apt install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
gcc --version
gcc (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation,Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
编译openjdk-8
bitbake openjdk-8 -c compile
=> It should work with out any errors.