8204541: Correctly support AIX xlC 16.1 symbol visibility flags

Reviewed-by: ihse, stuefe
This commit is contained in:
Ichiroh Takiguchi 2022-03-19 04:43:20 +00:00
parent 8384ac4ed3
commit 0c3094c818
3 changed files with 9 additions and 5 deletions

@ -77,7 +77,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
-fPIC" -fPIC"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then elif test "x$TOOLCHAIN_TYPE" = xxlc; then
BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bexpall -bernotok -btextpsize:64K \ BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bnoexpall -bernotok -btextpsize:64K \
-bdatapsize:64K -bstackpsize:64K" -bdatapsize:64K -bstackpsize:64K"
# libjvm.so has gotten too large for normal TOC size; compile with qpic=large and link with bigtoc # libjvm.so has gotten too large for normal TOC size; compile with qpic=large and link with bigtoc
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc" BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -33,13 +33,14 @@ include ToolsJdk.gmk
# On Mac, we have always exported all symbols, probably due to oversight # On Mac, we have always exported all symbols, probably due to oversight
# and/or misunderstanding. To emulate this, don't hide any symbols # and/or misunderstanding. To emulate this, don't hide any symbols
# by default. # by default.
# 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. # Also provide an override for non-conformant libraries.
ifeq ($(TOOLCHAIN_TYPE), gcc) ifeq ($(TOOLCHAIN_TYPE), gcc)
LAUNCHER_CFLAGS += -fvisibility=hidden LAUNCHER_CFLAGS += -fvisibility=hidden
LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
else ifeq ($(TOOLCHAIN_TYPE), clang) else ifeq ($(TOOLCHAIN_TYPE), clang)
LAUNCHER_CFLAGS += -fvisibility=hidden LAUNCHER_CFLAGS += -fvisibility=hidden
else ifeq ($(TOOLCHAIN_TYPE), xlc)
LAUNCHER_CFLAGS += -qvisibility=hidden
endif endif
LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -36,7 +36,6 @@ WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
# On Mac, we have always exported all symbols, probably due to oversight # On Mac, we have always exported all symbols, probably due to oversight
# and/or misunderstanding. To emulate this, don't hide any symbols # and/or misunderstanding. To emulate this, don't hide any symbols
# by default. # by default.
# 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. # Also provide an override for non-conformant libraries.
ifeq ($(TOOLCHAIN_TYPE), gcc) ifeq ($(TOOLCHAIN_TYPE), gcc)
CFLAGS_JDKLIB += -fvisibility=hidden CFLAGS_JDKLIB += -fvisibility=hidden
@ -47,6 +46,10 @@ else ifeq ($(TOOLCHAIN_TYPE), clang)
CFLAGS_JDKLIB += -fvisibility=hidden CFLAGS_JDKLIB += -fvisibility=hidden
CXXFLAGS_JDKLIB += -fvisibility=hidden CXXFLAGS_JDKLIB += -fvisibility=hidden
EXPORT_ALL_SYMBOLS := -fvisibility=default EXPORT_ALL_SYMBOLS := -fvisibility=default
else ifeq ($(TOOLCHAIN_TYPE), xlc)
CFLAGS_JDKLIB += -qvisibility=hidden
CXXFLAGS_JDKLIB += -qvisibility=hidden
EXPORT_ALL_SYMBOLS := -qvisibility=default
endif endif
# Put the libraries here. # Put the libraries here.