RFR: JDK-8214063: OpenJDK will not build on AIX while using the xlc 13.1 compiler
adam.farley at uk.ibm.com
Tue Nov 20 16:12:51 UTC 2018
Sounds reasonable. I've added a webex to the bug, and here's a link to the
This patch is required because otherwise, when building on AIX using xlc
the build fails with this error:
"Visibility is not allowed on a reference to an imported symbol."
We believe this is caused by JNIEXPORT and JNIIMPORT not being defined.
this, almost no symbols are exported from shared libraries due to use of
-qvisibility=hidden as specified in make/lib/LibCommon.gmk.
For convenience, here's a summary of the diffs:
File 1 of 2) src/java.base/share/native/libjimage/NativeImageBuffer.cpp
+#if defined(__xlC__) && (__xlC__ >= 0x0d01)
+ * Version 13.1.3 of xlc seems to have trouble parsing the
+ * annotation in the generated header file we're about to include.
+ * the forward declaration (without the braces) here avoids the
+ * 1540-0040 (S) The text "void" is unexpected. "visibility" may be
undeclared or ambiguous.
+extern "C" JNIEXPORT jobject JNICALL
Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap(JNIEnv *, jclass,
File 2 of 2) src/java.base/unix/native/include/jni_md.h
#define JNIIMPORT __attribute__((visibility("default")))
+#elif defined(__xlC__) && (__xlC__ >= 0x0d01) /* xlc version 13.1 or
better required */
+ #define JNIEXPORT __attribute__((visibility("default")))
+ #define JNIIMPORT __attribute__((visibility("default")))
"Thomas Stüfe" <thomas.stuefe at gmail.com> wrote on 19/11/2018 18:11:34:
> From: "Thomas Stüfe" <thomas.stuefe at gmail.com>
> To: Adam Farley8 <adam.farley at uk.ibm.com>
> Cc: Java Core Libs <core-libs-dev at openjdk.java.net>
> Date: 19/11/2018 18:12
> Subject: Re: RFR: JDK-8214063: OpenJDK will not build on AIX while
> using the xlc 13.1 compiler
> Hi Adam,
> could you please include link to the JBS issue and either link to the
> patch/webrev or link to the webrev, or at the very least the patch
> As for the issue itself: could you please elaborate why this fails with
> Also, a real patch would be helpful instead here of yet another link
> to some J9 issue. We are really strapped for manpower and the AIX port
> eats up enough time as it is.
> Thanks, Thomas
> On Mon, Nov 19, 2018 at 6:28 PM Adam Farley8 <adam.farley at uk.ibm.com>
> > Hi All
> > Both the problem and the solution appear straight-forward enough.
> > Details included in the bug description.
> > Thoughts and opinions welcome.
> > Best Regards
> > Adam Farley
> > IBM Runtimes
> > Unless stated otherwise above:
> > IBM United Kingdom Limited - Registered in England and Wales with
> > 741598.
> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
More information about the core-libs-dev