Skip to content

Commit 5c1835d

Browse files
committed
8283323: libharfbuzz optimization level results in extreme build times
Backport-of: 2c43ecb43fa3c94b69478039f1cd70ed4a577768
1 parent 7cef5a5 commit 5c1835d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

make/modules/java.desktop/lib/Awt2dLibraries.gmk

+8-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ else
470470

471471
endif
472472

473-
474473
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
475474
libharfbuzz \
476475
common/awt \
@@ -485,6 +484,14 @@ BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
485484

486485
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
487486

487+
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
488+
# gcc (and to an extent clang) is particularly bad at optimizing these files,
489+
# causing a massive spike in compile time. We don't care about these
490+
# particular files anyway, so lower optimization level.
491+
BUILD_LIBFONTMANAGER_hb-subset.cc_OPTIMIZATION := SIZE
492+
BUILD_LIBFONTMANAGER_hb-subset-plan.cc_OPTIMIZATION := SIZE
493+
endif
494+
488495
ifeq ($(call isTargetOs, windows), true)
489496
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
490497
X11TextRenderer.c

0 commit comments

Comments
 (0)