Yocto构建的JAVA安装错误

时间:2017-03-29 12:41:52

标签: java jvm embedded embedded-linux yocto

我在Poky Linux系统上安装Java时遇到了很多麻烦。我正在使用具有以下配置的Yocto构建我的系统:

的local.conf

MACHINE ??= "intel-corei7-64"

DISTRO ?= "poky"

PACKAGE_CLASSES ?= "package_rpm"

SDKMACHINE ?= "x86_64"

EXTRA_IMAGE_FEATURES ?= "debug-tweaks"

USER_CLASSES ?= "buildstats image-mklibs image-prelink"

PATCHRESOLVE = "noop"

BB_DISKMON_DIRS = "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"


PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"

CONF_VERSION = "1"

BB_NUMBER_THREADS = '12'
PARALLEL_MAKE = '-j 12'

# Java installation
CORE_IMAGE_EXTRA_INSTALL += "gtkperf libxslt" 
IMAGE_INSTALL_append = " openjdk-7-jre "

LICENSE_FLAGS_WHITELIST += "oracle_java" 
PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"

PREFERRED_VERSION_xserver-nodm-init = "1.0"

# OpenCV installation
CORE_IMAGE_EXTRA_INSTALL += "opencv opencv-samples libopencv-core-dev libopencv-highgui-dev libopencv-imgproc-dev libopencv-objdetect-dev libopencv-ml-dev"

bblayers.conf

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

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

BBLAYERS ?= " \
  $HOME/poky/meta \
  $HOME/poky/meta-poky \
  $HOME/poky/meta-yocto-bsp \
  $HOME/poky/meta-intel \
  $HOME/poky/meta-openembedded/meta-oe \
  $HOME/poky/meta-intel-realsense \
  $HOME/poky/meta-java \
  $HOME/poky/meta-oracle-java \
  "

我需要使用morty分支,因为我使用的是英特尔Realsense层,它只与4.8内核兼容

Build Configuration:
BB_VERSION        = "1.32.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "CentOSLinux-7.3.1611"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "intel-corei7-64"
DISTRO            = "poky"
DISTRO_VERSION    = "2.2.1"
TUNE_FEATURES     = "m64 corei7"
TARGET_FPU        = ""
meta              
meta-poky         
meta-yocto-bsp    = "morty:924e576b8930fd2268d85f0b151e5f68a3c2afce"
meta-intel        = "morty:6add41510412ca196efb3e4f949d403a8b6f35d7"
meta-oe           = "morty:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-intel-realsense = "morty:2c0dfe9690d2871214fba9c1c32980a5eb89a421"
meta-java         = "master:67e48693501bddb80745b9735b7b3d4d28dce9a1"
meta-oracle-java  = "morty:f44365f02b283c3fb362dc99e2e996d3f11e356e"

我收到以下错误:

ERROR: openjdk-7-jre-99b00-2.6.5-r6.1 do_compile: oe_runmake failed
ERROR: openjdk-7-jre-99b00-2.6.5-r6.1 do_compile: Function failed: do_compile (log file is located at /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/temp/log.do_compile.3780)
ERROR: Logfile of failure stored in: /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/temp/log.do_compile.3780
Log data follows:

然后几百行错误日志。 任何帮助表示赞赏。

编辑:来自log.do_compile文件

ERROR: oe_runmake failed
In file included from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/oops/constantPoolOop.hpp:29:0,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/oops/methodOop.hpp:33,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/runtime/frame.hpp:29,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/prims/jvmtiExport.hpp:33,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/runtime/thread.hpp:32,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/os/linux/vm/thread_linux.inline.hpp:30,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/memory/resourceArea.hpp:30,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/classfile/classFileParser.hpp:29,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/classfile/classLoader.hpp:28,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/classfile/systemDictionary.hpp:29,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciEnv.hpp:30,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciUtilities.hpp:28,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciNullObject.hpp:30,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciConstant.hpp:29,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp:36:
/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/oops/cpCacheOop.hpp: At global scope:
/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/oops/cpCacheOop.hpp:189:42: error: left operand of shift expression '(-1 << 28)' is negative [-fpermissive]
     option_bits_mask           = ~(((-1) << tos_state_shift) | (field_index_mask | parameter_size_mask))
                                    ~~~~~~^~~~~~~~~~~~~~~~~~~
/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/oops/cpCacheOop.hpp:189:104: error: enumerator value for 'option_bits_mask' is not an integer constant
     option_bits_mask           = ~(((-1) << tos_state_shift) | (field_index_mask | parameter_size_mask))
                                                                                                        ^
In file included from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciEnv.hpp:32:0,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciUtilities.hpp:28,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciNullObject.hpp:30,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/ci/ciConstant.hpp:29,
                 from /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/precompiled/precompiled.hpp:36:
/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/code/dependencies.hpp:169:59: error: left operand of shift expression '(-1 << 1)' is negative [-fpermissive]
     all_types           = ((1 << TYPE_LIMIT) - 1) & ((-1) << FIRST_TYPE),
                                                     ~~~~~~^~~~~~~~~~~~~~
/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/src/share/vm/code/dependencies.hpp:169:72: error: enumerator value for 'all_types' is not an integer constant
     all_types           = ((1 << TYPE_LIMIT) - 1) & ((-1) << FIRST_TYPE),
                                                                        ^
gmake[7]: *** [precompiled.hpp.gch] Error 1
gmake[7]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk.build/hotspot/outputdir/linux_amd64_zero/product'
gmake[6]: *** [the_vm] Error 2
gmake[6]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk.build/hotspot/outputdir/linux_amd64_zero/product'
gmake[5]: *** [productzero] Error 2
gmake[5]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk.build/hotspot/outputdir'
gmake[4]: *** [generic_buildzero] Error 2
gmake[4]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/make'
gmake[3]: *** [productzero] Error 2
gmake[3]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk/hotspot/make'
gmake[2]: *** [hotspot-build] Error 2
gmake[2]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk'
gmake[1]: *** [build_product_image] Error 2
gmake[1]: Leaving directory `/home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/icedtea-2.6.5/build/openjdk'
make: *** [Makefile:2451: stamps/icedtea.stamp] Error 2
ERROR: Function failed: do_compile (log file is located at /home/dalben/NewBuild/poky/filec/tmp/work/corei7-64-poky-linux/openjdk-7-jre/99b00-2.6.5-r6.1/temp/log.do_compile.3780)

1 个答案:

答案 0 :(得分:3)

我手动修补了生成这些错误的文件并构建了图像。它给出了一个新的错误,但成功地写了图像。已安装的Java:

root@intel-corei7-64:~# java -version
java version "1.7.0_99"
OpenJDK Runtime Environment (IcedTea 2.6.5) (99b00-2.6.5)
OpenJDK 64-Bit Zero VM (build 24.95-b01, interpreted mode)

解决方案是:

  1. 手动修补openjdk以下内容 this

  2. 使用较新版本的openjdk。这可以使用更多     最近提交的meta-java存储库或设置更新的     local.conf中的首选版本。

  3. 编辑:添加了指南链接。

    指南

    由于我在OpenSource项目中使用此图像,因此我就如何克服在构建过程中遇到的问题做了一些指导。 该指南可以在这里找到。

    更新:我升级了JRE和JDK版本。可以找到新指南here。对于你们中最勇敢的人来说,还有一个安装程序脚本。