Skip to content

Commit

Permalink
8299260: libawt and libfreetype should export only explicitly request…
Browse files Browse the repository at this point in the history
…ed symbols

Reviewed-by: prr, aivanov, serb
  • Loading branch information
djelinski committed Dec 30, 2022
1 parent 6f85a9c commit 684e506
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 0 additions & 3 deletions make/common/modules/LibCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ ifeq ($(TOOLCHAIN_TYPE), gcc)
CFLAGS_JDKLIB += -fvisibility=hidden
CXXFLAGS_JDKLIB += -fvisibility=hidden
LDFLAGS_JDKLIB += -Wl,--exclude-libs,ALL
EXPORT_ALL_SYMBOLS := -fvisibility=default
else ifeq ($(TOOLCHAIN_TYPE), clang)
CFLAGS_JDKLIB += -fvisibility=hidden
CXXFLAGS_JDKLIB += -fvisibility=hidden
EXPORT_ALL_SYMBOLS := -fvisibility=default
else ifeq ($(TOOLCHAIN_TYPE), xlc)
CFLAGS_JDKLIB += -qvisibility=hidden
CXXFLAGS_JDKLIB += -qvisibility=hidden
EXPORT_ALL_SYMBOLS := -qvisibility=default
endif

# Put the libraries here.
Expand Down
7 changes: 1 addition & 6 deletions make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ ifeq ($(call isTargetOs, windows), true)
LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
endif

ifeq ($(call isTargetOs, linux), true)
# FIXME: This is probably not what we want to do, but keep it now for compatibility.
LIBAWT_CFLAGS += $(EXPORT_ALL_SYMBOLS)
endif

# Turn off all warnings for debug_mem.c This is needed because the specific warning
# about initializing a declared 'extern' cannot be turned off individually. Only
# applies to debug builds. This limitation in gcc is tracked in
Expand Down Expand Up @@ -414,7 +409,7 @@ ifeq ($(FREETYPE_TO_USE), system)
LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
else
BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS)
BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY

# For use by libfontmanager:
LIBFREETYPE_CFLAGS := -I$(BUILD_LIBFREETYPE_HEADER_DIRS)
Expand Down

1 comment on commit 684e506

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.