RFR: 8324539: Do not use LFS64 symbols in JDK libs
Magnus Ihse Bursie
ihse at openjdk.org
Mon Jan 29 12:06:39 UTC 2024
On Tue, 23 Jan 2024 15:42:55 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
> Similar to [JDK-8318696](https://bugs.openjdk.org/browse/JDK-8318696), we should use -D_FILE_OFFSET_BITS=64, and not -D_LARGEFILE64_SOURCE in the JDK native libraries.
I have searched the code base to the extend of my ability, looking for all `<foo>64` functions that are affected by _LARGEFILE64_SOURCE. (At one point, I also tried looking for `[a-z]+64` or something like that, but there was a myriad of hits...)
Also note that this will only make a change on 32-bit platforms -- all 64-bit platforms already use the 64-bit version of the file functions/structs. This significantly lowers the risk of this patch, since 32-bit support is not as critical as 64-bit support.
There is one change that merit highlighting: In `src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c`, I kept the dlsym lookup for `openat64`, `fstatat64` and `fdopendir64`, on non-BSD OSes (i.e. Linux and AIX), and on AIX, respectively. This seems to me to be the safest choice, as we do not need to know if a lookup of `openat` would yield a 32-bit or a 64-bit version. (I frankly don't know, but I'm guessing it would yield the 32-bit version.)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17538#issuecomment-1914554732
More information about the build-dev
mailing list