java - openjdk 编译异常

查看:117
本文介绍了java - openjdk 编译异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

1、手工编译openjdk,运行一半时出现以下异常。
2、环境:
系统:ubuntu 16.04 内核:4.10.0-28-generic
Bootstrap jdk: 在oracle 官网下载的 jdk1.7.0_80
编译的openjdk: openjdk-7u75-src-b13-18_dec_2014.zip

运行时先报了一个操作系统内核不正确,将校验内核脚本注释掉,继续运行报一下异常,这个问题是什么原因呢。
找了好多资料,注释掉test_gamma 也无效果。

all:
     [echo] +---------------------------------------+
     [echo] + Finishing ant project jaxws
     [echo] +---------------------------------------+

BUILD SUCCESSFUL
Total time: 1 second
make[2]: Leaving directory '/home/wangjianan/work/jdksource/openjdk/jaxws/make'
########################################################################
##### Leaving jaxws for target(s) all                              #####
########################################################################
##### Build time 00:00:01 jaxws for target(s) all                  #####
########################################################################

/bin/mkdir -p /home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir
/bin/mkdir -p /home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/import


########################################################################
########################################################################
##### Entering hotspot for target(s) all_product                   #####
########################################################################

cd  ./hotspot/make && \
    make JDK_TOPDIR=/home/wangjianan/work/jdksource/openjdk/jdk JDK_MAKE_SHARED_DIR=/home/wangjianan/work/jdksource/openjdk/jdk/make/common/shared EXTERNALSANITYCONTROL=true SOURCE_LANGUAGE_VERSION=7 TARGET_CLASS_VERSION=7 MILESTONE=internal BUILD_NUMBER=b00 JDK_BUILD_NUMBER=b00 FULL_VERSION=1.7.0-internal-wangjianan_2017_07_30_16_02-b00 PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0 JDK_MKTG_VERSION=7 JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 ARCH_DATA_MODEL=64 COOKED_BUILD_NUMBER=0 ALT_OUTPUTDIR=/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir ALT_EXPORT_PATH=/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/import BUILD_FLAVOR=product ALT_SLASH_JAVA=/NOT-SET ALT_BOOTDIR=/home/wangjianan/work/jdksource/jdk1.7.0_80 ALT_LANGTOOLS_DIST=/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/langtools/dist all_product
make[2]: Entering directory '/home/wangjianan/work/jdksource/openjdk/hotspot/make'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
cd /home/wangjianan/work/jdksource/openjdk/hotspot/make; \
make BUILD_FLAVOR=product VM_TARGET=product generic_build2 ALT_OUTPUTDIR=/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir
make[3]: Entering directory '/home/wangjianan/work/jdksource/openjdk/hotspot/make'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
mkdir -p /home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir
cd /home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir; \
    make -f /home/wangjianan/work/jdksource/openjdk/hotspot/make/linux/Makefile \
           LP64=1 JAVA_HOME=/home/wangjianan/work/jdksource/jdk1.7.0_80 OUTPUTDIR=/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir GAMMADIR=/home/wangjianan/work/jdksource/openjdk/hotspot MAKE_VERBOSE=y HOTSPOT_RELEASE_VERSION=24.75-b04 JRE_RELEASE_VERSION=1.7.0-internal-wangjianan_2017_07_30_16_02-b00 HOTSPOT_BUILD_VERSION= INCLUDE_TRACE=1 product
make[4]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
cd linux_amd64_compiler2/product && make -w " LP64=1 "
make[5]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
../generated/adfiles/adlc -DLINUX -D_GNU_SOURCE -DAMD64 -q -T -g -D_LP64 ../generated/adfiles/linux_x86_64.ad  \
 -c../generated/adfiles/mktmp2141/ad_x86_64.cpp -h../generated/adfiles/mktmp2141/ad_x86_64.hpp -a../generated/adfiles/mktmp2141/dfa_x86_64.cpp -v../generated/adfiles/mktmp2141/adGlobals_x86_64.hpp \
    || { rm -rf ../generated/adfiles/mktmp2141; exit 1; }
./adlc_updater ad_x86_64.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64.hpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_clone.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_expand.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_format.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_gen.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_misc.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_peephole.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater ad_x86_64_pipeline.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater adGlobals_x86_64.hpp ../generated/adfiles/mktmp2141 ../generated/adfiles
./adlc_updater dfa_x86_64.cpp ../generated/adfiles/mktmp2141 ../generated/adfiles
[ -f ../generated/adfiles/mktmp2141/made-change ] \
    || echo "Rescanned ../generated/adfiles/linux_x86_64.ad  but encountered no changes."
Rescanned ../generated/adfiles/linux_x86_64.ad  but encountered no changes.
rm -rf ../generated/adfiles/mktmp2141
make[6]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
if [ -d /home/wangjianan/work/jdksource/openjdk/hotspot/agent -a "x86" != "ia64" \
             -a "x86" != "zero" ] ; then \
   make -f sa.make /home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product/../generated/sa-jdi.jar; \
fi
make[7]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
make[7]: '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product/../generated/sa-jdi.jar' is up to date.
make[7]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
make[6]: 'precompiled.hpp.gch' is up to date.
make[6]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
make[6]: Entering directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
echo Linking launcher...
echo "**NOTICE** Dtrace support disabled: "/usr/include/sys/sdt.h not found""
Linking launcher...
gcc -m64 -Xlinker -O1 -Wl,--hash-style=both  -Xlinker -z -Xlinker noexecstack -m64 -Xlinker -export-dynamic  -L `pwd` -o gamma launcher/java_md.o launcher/jli_util.o launcher/wildcard.o launcher/java.o -ljvm -lm -ldl -lpthread
**NOTICE** Dtrace support disabled: /usr/include/sys/sdt.h not found
/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so: undefined reference to `void G1SATBCardTableModRefBS::write_ref_array_pre_work<oopDesc*>(oopDesc**, int)'
collect2: error: ld returned 1 exit status
/home/wangjianan/work/jdksource/openjdk/hotspot/make/linux/makefiles/launcher.make:83: recipe for target 'gamma' failed
make[6]: *** [gamma] Error 1
make[6]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
/home/wangjianan/work/jdksource/openjdk/hotspot/make/linux/makefiles/top.make:119: recipe for target 'the_vm' failed
make[5]: *** [the_vm] Error 2
make[5]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir/linux_amd64_compiler2/product'
/home/wangjianan/work/jdksource/openjdk/hotspot/make/linux/Makefile:290: recipe for target 'product' failed
make[4]: *** [product] Error 2
make[4]: Leaving directory '/home/wangjianan/work/jdksource/jdkBuild/openjdk_7u4/hotspot/outputdir'
Makefile:191: recipe for target 'generic_build2' failed
make[3]: *** [generic_build2] Error 2
make[3]: Leaving directory '/home/wangjianan/work/jdksource/openjdk/hotspot/make'
Makefile:151: recipe for target 'product' failed
make[2]: *** [product] Error 2
make[2]: Leaving directory '/home/wangjianan/work/jdksource/openjdk/hotspot/make'
make/hotspot-rules.gmk:111: recipe for target 'hotspot-build' failed
make[1]: *** [hotspot-build] Error 2
make[1]: Leaving directory '/home/wangjianan/work/jdksource/openjdk'
Makefile:251: recipe for target 'build_product_image' failed
make: *** [build_product_image] Error 2

解决方案

目前的解决办法是注释掉gamma,将所有的gamma行都注释掉,之前只注释gamma所有行是不生效的,详细信息可访问:http://www.oopmind.com

这篇关于java - openjdk 编译异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆