[OpenJDK 2D-Dev] RFR: JDK-8196803: Fix build warnings in jdk libraries with Xcode 9

Erik Joelsson erik.joelsson at oracle.com
Tue Feb 6 21:03:58 UTC 2018


The 9 was just me being sloppy and thinking 9.x, I'm actually using 9.2. 
These are all the warnings I found in JDK libraries. There are 
additional ones in other parts of the build which have been dealt with 
in separate issues.


On 2018-02-06 12:54, Sergey Bylokhov wrote:
> Hi, Erik.
> Why XCode 9 was selected? It seems that 9.2 is the latest one.
> 9.2 produces some additional warnings even after this fix.
> On 05/02/2018 14:54, Erik Joelsson wrote:
>> When building with Xcode 9, we get some warnings triggered in jdk 
>> libraries. This patch tries to fix them. See bug description for more 
>> details on each of them. In short the following things are addressed:
>> In src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m, 
>> remove the check on MAC_OS_X_VERSION_MAX_ALLOWED. I don't think 
>> that's relevant. The source needs to compile against the headers that 
>> are present. This was touched on earlier in this thread: 
>> http://mail.openjdk.java.net/pipermail/build-dev/2017-July/019486.html 
>> and when going back, it's quite clear to me that the fix done there 
>> was incorrect.
>> In src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c, 
>> we can't modify the source file itself, so here I've added a wrapper 
>> for zlib.h that rewrites the ZLIB_VERNUM macro to a version that 
>> matches what's available on the Macosx version we are building for. 
>> This type of override can be brittle but seems to work OK in this 
>> case. While doing this, I also refactored the handling of libz cflags 
>> and libs. They are better set and exported from configure to be 
>> globally available in the build.
>> We also get warnings when linking static libraries. These are easily 
>> fixed by adding the -mmacosx-version-min= arguments on these command 
>> lines just like we do for linking shared libraries and executables. I 
>> solved this by setting ARFLAGS and actually use that variable.
>> Webrev: http://cr.openjdk.java.net/~erikj/8196803/webrev.01/index.html
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8196803
>> /Erik

More information about the 2d-dev mailing list