【发布时间】:2019-01-30 01:17:05
【问题描述】:
我试图在 Centos 5 中构建 OpenJDK 9。我使用过
sh ./configure --disable-warnings-as-errors
make all
我收到以下错误。
Building target 'all' in configuration 'linux-x86_64-normal-server-release'
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
/usr/bin/objcopy: '/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so': No such file
gmake[3]: *** [/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so] Error 1
gmake[2]: *** [java.base-libs] Error 2
ERROR: Build failed for target 'all' in configuration 'linux-x86_64-normal-
server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_java.base_libjava_BUILD_LIBJAVA_link:
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
* All command lines available in /root/jdk9/build/linux-x86_64-normal-
server-release/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See common/doc/building.html#troubleshooting for assistance.
make[1]: *** [main] Error 2
make: *** [all] Error 2
我还尝试了其他 make 目标,例如 make images 和 make install。但仍然得到同样的错误。我的 GCC 版本是我手动安装的 gcc (GCC) 4.4.7,因为默认情况下 Centos 5 有一个旧版本。
【问题讨论】:
-
Centos5 于 2007 年 4 月 12 日发布 - 是时候更新了吗?
-
是的,很遗憾,出于商业原因,我们仍然必须支持它。
-
我的最终目标是在 CentOS5 上构建 jdk11。所以我通过注释掉对 fallocate64 的引用来解决这个问题。然后我使用jdk9构建jdk10,然后构建jdk11。我使用 GCC 4.8.2、Beanutils 2.18 和来自 people.centos.org/tru/devtools-2/5/x86_64/RPMS 的其他依赖项在 CentOS5 上构建 OpenJDK 11。
标签: java makefile redhat-openjdk