首页 > 解决方案 > meta-java 构建失败,“目标 'hotspot-only' 的配方失败”

问题描述

我正在尝试使用 yocto 项目将 meta-java 层添加到基础映像中。我按照以下步骤进行配置。

克隆 Meta-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.

有人可以帮忙解决这个错误吗?提前致谢。

标签: javayoctobitbake

解决方案


该错误是由于较旧的 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-04
sudo 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.

推荐阅读