我尝试根据JDK9 Buildme.md编译JDK9。
Description: Ubuntu 16.10
user:~/sandboxJDK/9jdk$java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
user:~/sandboxJDK/9jdk$javac -version
javac 1.8.0_131
我已经安装了这些依赖项:
sudo apt-get install build-essential
sudo apt-get install ant
sudo apt-get install libxrender-dev
sudo apt-get install xorg-dev
sudo apt-get install libasound2-dev
sudo apt-get install libcups2-dev
sudo apt-get install gawk zip libxtst-dev libxi-dev libxt-dev
bash ./configure --disable-warnings-as-errors
之后
The existing configuration has been successfully updated in
/home/user/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release
using default settings.
Configuration summary:
* Debug level: release
* HS debug level: product
* JDK variant: normal
* JVM variants: server
* OpenJDK target: OS: linux, CPU architecture: x86, address length: 64
* Version string: 9-internal+0-adhoc.xfwu.9jdk (9-internal)
Tools summary:
* Boot JDK: openjdk version "1.8.0_131" OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11) OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode) (at /usr/lib/jvm/java-8-openjdk-amd64)
* Toolchain: gcc (GNU Compiler Collection)
* C Compiler: Version 6.2.0 (at /usr/bin/gcc)
* C++ Compiler: Version 6.2.0 (at /usr/bin/g++)
Build performance summary:
* Cores to use: 64
* Memory limit: 128694 MB
然后我设置/取消设置
export LANG=C
unset JAVA_HOME
unset CLASSPATH
env
PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
LANG=C
_=/usr/bin/env
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/runtime/test_os.cpp:26:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_psAdaptiveSizePolicy.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/gc/parallel/test_psAdaptiveSizePolicy.cpp:28:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_psParallelCompact.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/gc/parallel/test_psParallelCompact.cpp:27:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_quicksort.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/utilities/test_quicksort.cpp:29:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_resourceHash.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/utilities/test_resourceHash.cpp:27:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_semaphore.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/runtime/test_semaphore.cpp:26:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_symbolTable.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/classfile/test_symbolTable.cpp:27:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_utf8.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/utilities/test_utf8.cpp:26:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* For target hotspot_variant-server_libjvm_gtest_objs_test_workerDataArray.o:
In file included from /home/xfwu/sandboxJDK/9jdk/test/fmw/gtest/include/gtest/gtest.h:54:0,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/unittest.hpp:31,
from /home/xfwu/sandboxJDK/9jdk/hotspot/test/native/gc/g1/test_workerDataArray.cpp:27:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
... (rest of output omitted)
* All command lines available in /home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===
=== Make failed targets repeated here ===
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_metachunk.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_memset_with_concurrent_readers.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_AltHashing.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_chunkedList.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_linkedlist.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/logTestFixture.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logDecorations.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_dependencyContext.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_json.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logMessageTest.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_globalDefinitions.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logDecorators.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logOutputList.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_utf8.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_guardedMemory.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_collectorPolicy.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_instanceKlass.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logFileOutput.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logTagSet.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_psAdaptiveSizePolicy.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_semaphore.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logConfiguration.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_g1CodeCacheRemSet.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_arrayOop.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_log.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_g1Predictions.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_classLoader.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_os.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_bitMap.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logStream.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_bitMap_setops.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_workerDataArray.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_bufferingOopClosure.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_globals.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_arguments.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_g1IHOPControl.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_freeRegionList.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_g1BiasedArray.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logTagLevelExpression.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logTag.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_collectedHeap.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_symbolTable.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logTagSetDescriptions.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_resourceHash.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_logLevel.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_gcTraceTime.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_quicksort.o' failed
lib/CompileGtest.gmk:64: recipe for target '/home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_psParallelCompact.o' failed
make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
=== End of repeated output ===
Hint: Try searching the build log for the name of the first failed target.
Hint: If caused by a warning, try configure --disable-warnings-as-errors.
/home/xfwu/sandboxJDK/9jdk/make/Init.gmk:291: recipe for target 'main' failed
make[1]: *** [main] Error 1
/home/xfwu/sandboxJDK/9jdk/make/Init.gmk:185: recipe for target 'all' failed
make: *** [all] Error 2
关于min max
的一篇相关帖子是https://bugs.openjdk.java.net/browse/JDK-8161145。
和
http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-July/023910.html
但是,它没有用。
make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
=== End of repeated output ===
Hint: Try searching the build log for the name of the first failed target.
Hint: If caused by a warning, try configure --disable-warnings-as-errors.
/home/xfwu/sandboxJDK/9jdk/make/Init.gmk:291: recipe for target 'main' failed
make[1]: *** [main] Error 1
/home/xfwu/sandboxJDK/9jdk/make/Init.gmk:185: recipe for target 'all' failed
make: *** [all] Error 2