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

Fix issues with -qvisibility=hidden on AIX #99

Merged
merged 1 commit into from
Jan 23, 2019
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
9 changes: 4 additions & 5 deletions make/launcher/Launcher-jdk.pack.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
# ===========================================================================

include LauncherCommon.gmk

Expand All @@ -39,7 +42,7 @@ $(eval $(call SetupBuildLauncher, pack200, \
# On Mac, we have always exported all symbols, probably due to oversight
# and/or misunderstanding. To emulate this, don't hide any symbols
# by default.
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
# Also provide an override for non-conformant libraries.
ifeq ($(TOOLCHAIN_TYPE), gcc)
CXXFLAGS_JDKEXE += -fvisibility=hidden
Expand All @@ -50,10 +53,6 @@ else ifeq ($(TOOLCHAIN_TYPE), clang)
endif
else ifeq ($(TOOLCHAIN_TYPE), solstudio)
CXXFLAGS_JDKEXE += -xldscope=hidden
else ifeq ($(TOOLCHAIN_TYPE), xlc)
ifneq ($(CC_VERSION_NUMBER), 12.1)
CXXFLAGS_JDKEXE += -qvisibility=hidden
endif
endif

UNPACKEXE_SRC := $(TOPDIR)/src/jdk.pack/share/native/common-unpack \
Expand Down
9 changes: 4 additions & 5 deletions make/launcher/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
# ===========================================================================

include JdkNativeCompilation.gmk

Expand All @@ -45,7 +48,7 @@ endif
# On Mac, we have always exported all symbols, probably due to oversight
# and/or misunderstanding. To emulate this, don't hide any symbols
# by default.
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
# Also provide an override for non-conformant libraries.
ifeq ($(TOOLCHAIN_TYPE), gcc)
LAUNCHER_CFLAGS += -fvisibility=hidden
Expand All @@ -56,10 +59,6 @@ else ifeq ($(TOOLCHAIN_TYPE), clang)
endif
else ifeq ($(TOOLCHAIN_TYPE), solstudio)
LAUNCHER_CFLAGS += -xldscope=hidden
else ifeq ($(TOOLCHAIN_TYPE), xlc)
ifneq ($(CC_VERSION_NUMBER), 12.1)
CXXFLAGS_JDKEXE += -qvisibility=hidden
endif
endif

LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
Expand Down
11 changes: 4 additions & 7 deletions make/lib/LibCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
# ===========================================================================

include JdkNativeCompilation.gmk

Expand All @@ -38,7 +41,7 @@ WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
# On Mac, we have always exported all symbols, probably due to oversight
# and/or misunderstanding. To emulate this, don't hide any symbols
# by default.
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding
# On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
# Also provide an override for non-conformant libraries.
ifeq ($(TOOLCHAIN_TYPE), gcc)
CFLAGS_JDKLIB += -fvisibility=hidden
Expand All @@ -55,12 +58,6 @@ else ifeq ($(TOOLCHAIN_TYPE), solstudio)
CFLAGS_JDKLIB += -xldscope=hidden
CXXFLAGS_JDKLIB += -xldscope=hidden
EXPORT_ALL_SYMBOLS := -xldscope=global
else ifeq ($(TOOLCHAIN_TYPE), xlc)
ifneq ($(CC_VERSION_NUMBER), 12.1)
CFLAGS_JDKLIB += -qvisibility=hidden
CXXFLAGS_JDKLIB += -qvisibility=hidden
EXPORT_ALL_SYMBOLS := -qvisibility=default
endif
endif

################################################################################
Expand Down
16 changes: 1 addition & 15 deletions src/java.base/share/native/libjimage/NativeImageBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved
* ===========================================================================
*/

#include <string.h>

#include "jni.h"
Expand All @@ -45,16 +41,6 @@
#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
9 changes: 0 additions & 9 deletions src/java.base/unix/native/include/jni_md.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved
* ===========================================================================
*/

#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_

Expand All @@ -43,9 +37,6 @@
#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