RFR: JDK-8196803: Fix build warnings in jdk libraries with Xcode 9

Erik Joelsson erik.joelsson at oracle.com
Mon Feb 5 22:54:11 UTC 2018


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 build-dev mailing list