RFR: 8214976: Warn about uses of functions replaced for portability [v5]

David Holmes dholmes at openjdk.java.net
Mon Feb 14 22:49:14 UTC 2022


On Mon, 14 Feb 2022 19:48:46 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

>> Please review this new attempt to resolve JDK-8214976.  This fix adds Pragmas to generate compilation errors, when using gcc, if calling a native system function instead of the os:: version of the function.  The fix includes changes to calls in non-shared code because it is cleaner than adding PRAGMAs and, for some cases, the os:: version of a function has added value, such as asserts and RESTARTABLE.  This fix slightly changes the signature of os::abort() so it wouldn't conflict with native abort() functions.  Changes to Windows code is left for a future RFE.
>> 
>> This fix was tested with Mach5 tiers 1-2 on Linux, Mac OS, and Windows, Mach5 tiers 3-5 on Linux x64, and Mach5 builds of Zero, PPC, and s390.
>> 
>> Thanks, Harold
>
> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
> 
>   rename macro, fix semi-colon issue, fix zero lseek64 and ftruncate64 build issue

Hi Harold,

This is looking better - thanks - but I think the lseek64 situation needs handling differently.

Thanks,
David

src/hotspot/os/linux/os_linux.cpp line 4924:

> 4922: }
> 4923: 
> 4924: off64_t call_lseek64(int fd, off64_t offset, int whence) {

I think it would be better to just change the `lseek64` calls to `os::lseek` rather than introduce this wrapper function.

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

Changes requested by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7248


More information about the hotspot-dev mailing list