我在运行 Suse Linux Enterprise Server 11 SP2 的 Itanium 服务器上构建 openjdk7 时遇到了一些棘手的问题。
我已成功安装 Sun JDK 1.6 update 33 作为安装的 Bootstrap 。而且,我已经下载了源代码并将 openJDK7 安装源解压到一个目录中。我的构建通过了所有 make sanity
检查,看起来已经准备就绪。
我已取消设置 JAVA_HOME,声明 LANG=C,并将构建指向引导 JDK。
然后我调用 make ALLOW_DOWNLOADS=false ALT_BOOTDIR=/usr/java/jdk1.6.0_33 ALT_DROPS_DIR=~/openjdk_src/sourcedrop
构建运行正常大约 5-10 分钟,然后我收到一串关于未找到 SSL 库的错误。
这发生在 jaxws 源代码树中构建的以下部分中,并且似乎与 SSL 有关:
[javac] Compiling 2735 source files to /root/openjdk_src/openjdk/build/linux-ia64/jaxws/build/classes
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java:54: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HttpsURLConnection;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java:55: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HostnameVerifier;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java:56: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.SSLSession;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:54: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HostnameVerifier;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:55: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HttpsURLConnection;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:56: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.SSLSession;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:218: error: cannot find symbol
[javac] private static class HttpClientVerifier implements HostnameVerifier {
[javac] ^
[javac] symbol: class HostnameVerifier
[javac] location: class MetadataFinder
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:219: error: cannot find symbol
[javac] public boolean verify(String s, SSLSession sslSession) {
[javac] ^
[javac] symbol: class SSLSession
[javac] location: class HttpClientVerifier
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/developer/JAXWSProperties.java:32: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HostnameVerifier;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/developer/JAXWSProperties.java:33: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HttpsURLConnection;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/developer/JAXWSProperties.java:34: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.SSLSocketFactory;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:39: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.SSLSocketFactory;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:40: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HttpsURLConnection;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:41: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.HostnameVerifier;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:42: error: package javax.net.ssl does not exist
[javac] import javax.net.ssl.SSLSession;
[javac] ^
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:302: error: cannot find symbol
[javac] private static class HttpClientVerifier implements HostnameVerifier {
[javac] ^
[javac] symbol: class HostnameVerifier
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:303: error: cannot find symbol
[javac] public boolean verify(String s, SSLSession sslSession) {
[javac] ^
[javac] symbol: class SSLSession
[javac] location: class HttpClientVerifier
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:154: error: cannot find symbol
[javac] if (conn instanceof HttpsURLConnection) {
[javac] ^
[javac] symbol: class HttpsURLConnection
[javac] location: class WSEntityResolver
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java:156: error: cannot find symbol
[javac] ((HttpsURLConnection) conn).setHostnameVerifier(new HttpClientVerifier());
[javac] ^
[javac] symbol: class HttpsURLConnection
[javac] location: class WSEntityResolver
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:207: error: cannot find symbol
[javac] if (httpConnection instanceof HttpsURLConnection) {
[javac] ^
[javac] symbol: class HttpsURLConnection
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:223: error: cannot find symbol
[javac] ((HttpsURLConnection) httpConnection).setHostnameVerifier(new HttpClientVerifier());
[javac] ^
[javac] symbol: class HttpsURLConnection
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:227: error: cannot find symbol
[javac] HostnameVerifier verifier =
[javac] ^
[javac] symbol: class HostnameVerifier
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:228: error: cannot find symbol
[javac] (HostnameVerifier) context.invocationProperties.get(JAXWSProperties.HOSTNAME_VERIFIER);
[javac] ^
[javac] symbol: class HostnameVerifier
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:230: error: cannot find symbol
[javac] ((HttpsURLConnection) httpConnection).setHostnameVerifier(verifier);
[javac] ^
[javac] symbol: class HttpsURLConnection
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:234: error: cannot find symbol
[javac] SSLSocketFactory sslSocketFactory =
[javac] ^
[javac] symbol: class SSLSocketFactory
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:235: error: cannot find symbol
[javac] (SSLSocketFactory) context.invocationProperties.get(JAXWSProperties.SSL_SOCKET_FACTORY);
[javac] ^
[javac] symbol: class SSLSocketFactory
[javac] location: class HttpClientTransport
[javac] /root/openjdk_src/openjdk/build/linux-ia64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java:237: error: cannot find symbol
[javac] ((HttpsURLConnection) httpConnection).setSSLSocketFactory(sslSocketFactory);
[javac] ^
[javac] symbol: class HttpsURLConnection
[javac] location: class HttpClientTransport
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 27 errors
为了解决这个问题,我将 jsse.pack
解压到 jdk/jre/bin
中的 jsse.jar
中。
然后,如果我记得使用 make ALLOW_DOWNLOADS=false ALT_BOOTDIR=/usr/java/jdk1.6.0_33 ALT_DROPS_DIR=~/openjdk_src/sourcedrop DISABLE_HOTSPOT_OS_VERSION_CHECK=ok
来忽略架构。
当在虚拟机中生成 adlc 时,构建会失败:
Making adlc
g++ -Wl,-relax -Xlinker -O1 -Xlinker -export-dynamic -o ../generated/adfiles/adlc
../generated/adfiles/adlparse.o ../generated/adfiles/arch Desc.o
../generated/adfiles/arena.o ../generated/adfiles/dfa.o ../generated/adfiles/dict2.o
../generated/adfiles/filebuff.o ../generated/adfil es/forms.o
../generated/adfiles/formsopt.o ../generated/adfiles/formssel.o
../generated/adfiles/main.o
../generated/adfiles/adlc-opcodes.o ../ generated/adfiles/output_c.o
../generated/adfiles/output_h.o
make[6]: *** No rule to make target
`/root/openjdk_src/openjdk/hotspot/src/cpu/ia64/vm/.ad', needed by
`../generated/adfiles/linux_.ad'. Stop .
现在怎么办?什么是 adlc?为什么它不能构建?
请您参考如下方法:
我最近才偶然发现这个(仍然悬而未决)的问题,近几个月来尝试过类似的事情;并且也遇到(并解决)了同样的问题。
'adlc'是HotSpot的架构描述语言编译器,即 ADLC。 它用于生成HotSpot构建的Java执行引擎(解释器和JIT编译器)的源代码;基于处理“.ad
”文件。如果您获得要构建的 ADLC 工具,其“用法”如下所示:
$> ./adlc
Architecture Description Language Compiler
Usage: adlc [-doqwTs] [-#]* [-D<FLAG>[=<DEF>]] [-U<FLAG>] [-c<CPP_FILE_NAME>] [-h<HPP_FILE_NAME>] [-a<DFA_FILE_NAME>] [-v<GLOBALS_FILE_NAME>] <ADL_FILE_NAME>
d produce DFA debugging info
o no output produced, syntax and semantic checking only
q quiet mode, supresses all non-essential messages
w suppress warning messages
T make DFA as many subroutine calls
s output which instructions are cisc-spillable
D define preprocessor symbol
U undefine preprocessor symbol
c specify CPP file name (default: (null))
h specify HPP file name (default: (null))
a specify DFA output file name
v specify adGlobals output file name
# increment ADL debug level
您的构建问题是您无法避免“架构”检测! (事实上,您对“DISABLE_HOTSPOT_OS_VERSION_CHECK=ok”的使用甚至可能值得怀疑。)但是,它比(仅)更糟糕:IA64(除了Windows,直到Windows Server 2008 R2(扩展)支持结束......到2020年?)正在从Java 7 OpenJDK源代码树中删除,并且位已被删除/正在被主动删除(和/或没有得到维护?)。具体来说,这就是 Makefile
支持系统的某些 HotSpot/OpenJDK 构建配置组件的问题,该系统是指定所有架构资格来定位/处理 Linux Itanium/IA64 架构上所需的“.ad
”文件所必需的。具体来说,您缺少正确文件名扩展所需的某些关键定义:[...]/cpu/ia64/vm/.ad
和 ../generated/adfiles/linux_.ad
显然不是正确的、完全架构限定的文件/目标名称(因此未找到)。
上面涉及的文件/目标的正确名称实际上是 ../generated/adfiles/linux_ia64.ad
,它是通过目标名称中的环境变量替换而产生的,但缺少 ${arch_model}
的定义(另一个环境变量 ${os_arch_model}
也存在类似的情况)。这些在 [JDK_distribution]/hotspot/make
的 'linux
' 目录下的 'platform_ia64
' 中不存在(疏忽?)。简单回顾一下linux下的其他平台文件,你应该看到'arch_model
'应该采用'arch
'的值,即ia64
,同样,'os_arch_model
'采用与'os_arch
'相同的值,即linux_ia64
。
[Java7 JDK distribution]/hotspot/make $ cat platform_ia64
os_family = linux
arch = ia64
arch_model = ia64 # Added
os_arch = linux_ia64
os_arch_model = linux_ia64 # Added
lib_arch = ia64
compiler = gcc
gnu_dis_arch = ia64
sysdefs = -DLINUX -D_GNU_SOURCE -DIA64 -DCC_INTERP
mark_style = alignment
仅通过该修改/更正,您就应该能够成功完成 OpenJDK 构建的这些初始步骤。 (我可以通过 ADLC 构建,但后来在构建过程中失败,因为另一个源代码区域已从后来的 IA64 源代码中删除......)祝您好运!