首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在OpenJDK 9中构建CentOS5

在OpenJDK 9中构建CentOS5
EN

Stack Overflow用户
提问于 2019-01-30 01:17:05
回答 1查看 187关注 0票数 0

我试图在Centos 5中构建OpenJDK 9。

代码语言:javascript
复制
sh ./configure --disable-warnings-as-errors
make all

我得到了以下错误。

代码语言:javascript
复制
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映像和。但还是会犯同样的错误。我的GCC版本是gcc ( Centos ) 4.4.7,这是我手动安装的,因为Centos 5在默认情况下有一个旧版本。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-08 14:04:31

  1. 构建JDK至少需要GCC 5.0 (参见构建JDK: CC)。
  2. 这似乎是glibc版本中的一个问题(请参阅红帽-发行util-linux)。因此,将glibc更新到最新版本可能会解决这个问题。
  3. 如果您不想更新系统的glibc,下面是另一种选择:

通过查看假定位的手册页,我们发现描述提到假定位(3)是一个可移植的POSIX.1指定版本,以防mode参数具有默认值(0)。这同样适用于fallocate64。由于前面提到的所有错误都使用了默认的mode值,所以可以用posix_fallocate64()替换它们(而不是像在另一个注释中提到的那样将它们注释掉)。

指示的手册页说:

带有fallocate =0的mode的这种默认行为与posix_fallocate(3)库函数的行为非常相似,并打算作为优化实现该函数的一种方法。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54432009

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档