我试图在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映像和。但还是会犯同样的错误。我的GCC版本是gcc ( Centos ) 4.4.7,这是我手动安装的,因为Centos 5在默认情况下有一个旧版本。
发布于 2022-03-08 14:04:31
通过查看假定位的手册页,我们发现描述提到假定位(3)是一个可移植的POSIX.1指定版本,以防mode参数具有默认值(0)。这同样适用于fallocate64。由于前面提到的所有错误都使用了默认的mode值,所以可以用posix_fallocate64()替换它们(而不是像在另一个注释中提到的那样将它们注释掉)。
指示的手册页说:
带有
fallocate=0的mode的这种默认行为与posix_fallocate(3)库函数的行为非常相似,并打算作为优化实现该函数的一种方法。
https://stackoverflow.com/questions/54432009
复制相似问题