On Fri, 27 Feb 2026 10:25:45 GMT, Jaikiran Pai <[email protected]> wrote:

>> Matthias Baesken has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Adjust check
>
> Hello Thomas,
> 
>> I am surprised that this is not necessary on all Unixes, tbh. What about 
>> Linux?
> 
> When that check was added in https://bugs.openjdk.org/browse/JDK-8286582, the 
> issue was trying to address macosx. So it just checked for that specific OS. 
> 
> In theory, if we bundle zlib for any *nix OS, then these macros should be set 
> too. We don't by default bundle zlib for Linux, and I haven't tried with 
> `--with-zlib=bundled` on Linux. If it's guaranteed that stdarg.h and unistd.h 
> are present on Linux, then I think we can add these macros there too. 
> Otherwise, a conditional that tests the exit code of compiling a test C 
> program with those includes would be required for Linux. It can be done as a 
> separate task.

@jaikiran Both glibc and muslc provide stdarg.h and unistd.h, and always have 
done. 

Looking at the zlib sources, I think it works only by accident, probably 
because it pulls unistd.h and stdarg.h via indirect inclusions. They should 
only be undefined on Windows and embedded systems that are not POSIX-conform. 
Defining them for Linux would be correct, and doing this in multiple RFR seems 
unnecessary.

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

PR Comment: https://git.openjdk.org/jdk/pull/29953#issuecomment-3972113889

Reply via email to