Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable AIX build with xlc 13.1 #15

Merged
merged 2 commits into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/java.base/share/native/libjimage/NativeImageBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved
* ===========================================================================
*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -41,6 +45,16 @@
#include "jimage.hpp"
#include "osSupport.hpp"

#if defined(__xlC__) && (__xlC__ >= 0x0d01)
/*
* Version 13.1.3 of xlc seems to have trouble parsing the `__attribute__`
* annotation in the generated header file we're about to include. Repeating
* the forward declaration (without the braces) here avoids the diagnostic:
* 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, jstring);
#endif

#include "jdk_internal_jimage_NativeImageBuffer.h"


Expand Down
7 changes: 7 additions & 0 deletions src/java.base/unix/native/include/jni_md.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved
* ===========================================================================
*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -37,6 +41,9 @@
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#endif
#elif defined(__xlC__) && (__xlC__ >= 0x0d01) /* xlc version 13.1 or better required */
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#else
#define JNIEXPORT
#define JNIIMPORT
Expand Down