java - Linking error when building OpenJDK8 with gcc 6 -
i trying build openjdk 8 gcc6:
$ hg clone http://hg.openjdk.java.net/jdk8 jdk8 $ cd jdk8 $ bash get_source.sh $ bash ./configure $ make images
as explained here or here, had update make files add following options gcc:
-wno-deprecated-declarations -wno-error=deprecated-declarations -wno-error=narrowing -fno-exceptions -fvisibility=hidden -fno-delete-null-pointer-checks -fno-lifetime-dse
it seems compiles fine now. however, when linking fails on following command:
/usr/bin/x86_64-linux-gnu-gcc-6 -xlinker --hash-style=both -xlinker -z -xlinker defs -shared -l/home/johnd/src/build_jdk/jdk8/jdk/lib/amd64 -l/home/johnd/src/build_jdk/jdk8/jdk/lib/amd64/server -xlinker -z -xlinker origin -xlinker -rpath -xlinker \$origin -xlinker -version-script=/home/johnd/src/build_jdk/jdk8/jdk/make/mapfiles/libzip/mapfile-vers -xlinker -soname=libzip.so -o /home/johnd/src/build_jdk/jdk8/jdk/lib/amd64/libzip.so /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/adler32.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/crc32.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/deflater.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/inflater.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/zipfile.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/compress.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/deflate.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/gzclose.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/gzlib.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/gzread.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/gzwrite.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/infback.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/inffast.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/inflate.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/inftrees.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/trees.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/uncompr.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/zadler32.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/zcrc32.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/zip_util.o /home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/zutil.o -ljvm -ljava
it gives following error:
/home/johnd/src/build_jdk/jdk8/jdk/objs/libzip/zipfile.o: in function `java_java_util_zip_zipfile_open': /home/johnd/src/build_jdk/jdk8/jdk/src/share/native/java/util/zip/zipfile.c:109: undefined reference `throwfilenotfoundexception' collect2: error: ld returned 1 exit status
this surprising since symbol `throwfilenotfoundexception' apparently defined in libjava given parameter linker.
$ nm ./jdk/lib/amd64/libjava.so | grep throw 000000000001b0cd t throwfilenotfoundexception 000000000001721b t throwioexception
any idea going on , how can fix it?
you seem have cloned jdk 8 ga sources (i.e. 2014). predate gcc6 2 years.
instead, please clone latest source code jdk 8 updates project, , try again, i.e.using hg.openjdk.java.net/jdk8u/jdk8u .
dalibor topic principal product manager java platform group @ oracle
Comments
Post a Comment