RFR: 8324834: Use _LARGE_FILES on AIX [v2]

Magnus Ihse Bursie ihse at openjdk.org
Wed Jan 31 08:55:02 UTC 2024


On Tue, 30 Jan 2024 12:25:47 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> In the same spirit as [JDK-8318696](https://bugs.openjdk.org/browse/JDK-8318696), we should adapt the AIX-specific code in hotspot so it uses the well-defined posix `<foo>` functions, instead of `<foo>64`. By setting the define _LARGE_FILES, this will make `<foo>` behave as `<foo>64`, just as _FILE_OFFSET_BITS=64 does on gcc. (Reference: https://www.ibm.com/docs/en/aix/7.1?topic=volumes-writing-programs-that-access-large-files)
>> 
>> In theory, it should not even be necessary to set this, since we only compile for 64-bit AIX platforms, and this is only relevant on 32-bit platforms. But let's add the define anyway, for good measure. It shows at least that we have thought about the matter. :-)
>> 
>> I have not been able to test this on AIX. I hope someone with AIX access can take this for a spin.
>> 
>> The reason I'm doing this is for [JDK-8324539](https://bugs.openjdk.org/browse/JDK-8324539). After both these bugs are fixed, there will be no more `<foo>64` function calls in the code base.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert "8324753: [AIX] adjust os_posix after JDK-8318696"
>   
>   This reverts commit 8950d68ddb36d35831fbb4b98969cd0537527070.

The define is set in `CFLAGS_OS_DEF_JVM`, which definitely is passed to the compiler when building hotspot. I suspect this worry of yours were more directed at the change for the JDK, [JDK-8324539](https://bugs.openjdk.org/browse/JDK-8324539): Do not use LFS64 symbols in JDK libs. In that PR, the define is set in `CFLAGS_OS_DEF_JDK`, which also is passed to the compiler for all JDK native libs. (If it weren't, large files on AIX would not be the only thing to break.)

And also, to turn this "intransparency" on its head: if someone where to introduce a new call to `open` in a JDK library, with the current solution someone of the AIX maintainers would need to spot it, and change it to a `open64` on AIX. With this new solution, all platforms will work properly with the plain POSIX `open`. I think in the long run, that is going to prove less error-prone.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17611#issuecomment-1918650414
PR Comment: https://git.openjdk.org/jdk/pull/17611#issuecomment-1918654229


More information about the hotspot-runtime-dev mailing list