Skip to content

8348597: Update HarfBuzz to 10.4.0 #3026

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
40 changes: 28 additions & 12 deletions make/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -555,24 +555,40 @@ else
ifeq ($(call isTargetOs, solaris), true)
HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
endif
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc

# Early re-canonizing has to be disabled to workaround an internal XlC compiler error
# when building libharfbuzz
ifeq ($(call isTargetOs, aix), true)
HARFBUZZ_CFLAGS += -qdebug=necan
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually a change from JDK-8258484 which is not in JDK 11u. Intentional? If yes, we should probably use /issue add JDK-8258484 to have it tracked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. this is intentional. Will add the issue.

Copy link
Member

Choose a reason for hiding this comment

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

Why are you including this? Have you built this on AIX?


# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
# hb-subset and hb-style APIs are not needed, excluded to cut on compilation time.
LIBFONTMANAGER_EXCLUDE_FILES += hb-ft.cc hb-subset-cff-common.cc \
hb-subset-cff1.cc hb-subset-cff2.cc hb-subset-input.cc hb-subset-plan.cc \
hb-subset.cc hb-subset-instancer-solver.cc gsubgpos-context.cc hb-style.cc

# list of disabled warnings and the compilers for which it was specifically added.
# array-bounds -> GCC 12 on Alpine Linux
# parentheses -> GCC 6
# range-loop-analysis -> clang on Xcode12

HARFBUZZ_DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing \
array-bounds
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
maybe-uninitialized class-memaccess unused-result extra noexcept-type expansion-to-defined
HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast \
undef missing-field-initializers deprecated-declarations c++11-narrowing range-loop-analysis
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138
HARFBUZZ_DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing \
array-bounds parentheses dangling-pointer
Copy link
Contributor

Choose a reason for hiding this comment

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

parentheses dangling-pointer are new here. danling-pointer seems to be part of the JDK 17 harfbuzz update to 10.4.0. parenthesis not. Is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly required (gcc 14, gcc 4.8.5). Will remove, thanks!

# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
maybe-uninitialized class-memaccess unused-result extra use-after-free noexcept-type \
Copy link
Contributor

Choose a reason for hiding this comment

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

This also adds use-after-free as a disabled warning for gcc. That is part of JDK-8286562 which we probably don't want to partially introduce here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly required (gcc 14, gcc 4.8.5). Will remove, thanks!

expansion-to-defined dangling-reference maybe-uninitialized \
calloc-transposed-args attributes
HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast \
undef missing-field-initializers range-loop-analysis \
deprecated-declarations c++11-narrowing
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138

HARFBUZZ_DISABLED_WARNINGS_C_solstudio := \
E_INTEGER_OVERFLOW_DETECTED \
E_ARG_INCOMPATIBLE_WITH_ARG_L \
Expand Down
15 changes: 8 additions & 7 deletions src/java.desktop/share/legal/harfbuzz.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Harfbuzz v8.2.2
## Harfbuzz v10.4.0

### Harfbuzz License

Expand All @@ -8,14 +8,14 @@ HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
For parts of HarfBuzz that are licensed under different licenses see individual
files names COPYING in subdirectories where applicable.

Copyright © 2010-2023 Google, Inc.
Copyright © 2010-2024 Google, Inc.
Copyright © 2018-2020 Ebrahim Byagowi
Copyright © 2004-2013 Red Hat, Inc.
Copyright © 2019 Facebook, Inc.
Copyright (C) 2012 Zilong Tan ([email protected])
Copyright © 2007 Chris Wilson
Copyright © 2018-2019 Adobe Inc.
Copyright © 2006-2023 Behdad Esfahbod
Copyright © 2006-2025 Behdad Esfahbod
Copyright © 1998-2004 David Turner and Werner Lemberg
Copyright © 2009 Keith Stribley
Copyright © 2018 Khaled Hosny
Expand Down Expand Up @@ -54,7 +54,7 @@ exception is licensed with a slightly different MIT variant:
The contents of this directory are licensed under the following terms:

---------------------------------
The below license applies to the following files:
The below applies to the following file(s):
libharfbuzz/hb-ucd.cc

Copyright (C) 2012 Grigori Goronzy <[email protected]>
Expand All @@ -72,13 +72,14 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---------------------------------
The below license applies to the following files:
The below applies to the following file(s):
libharfbuzz/hb-unicode-emoji-table.hh

© 2023 Unicode®, Inc.
© 2024 Unicode®, Inc.

Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.
in the U.S. and other countries.
For terms of use, see https://www.unicode.org/terms_of_use.html
For terms of use and license, see https://www.unicode.org/terms_of_use.html

</pre>

Expand Down
10 changes: 9 additions & 1 deletion src/java.desktop/share/native/libharfbuzz/OT/Color/CBDT/CBDT.hh
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ struct IndexSubtable
{
TRACE_SANITIZE (this);
if (!u.header.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.header.indexFormat)
{
case 1: return_trace (u.format1.sanitize (c, glyph_count));
Expand Down Expand Up @@ -378,6 +379,7 @@ struct IndexSubtableRecord
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
hb_barrier () &&
firstGlyphIndex <= lastGlyphIndex &&
offsetToSubtable.sanitize (c, base, lastGlyphIndex - firstGlyphIndex + 1));
}
Expand Down Expand Up @@ -635,6 +637,7 @@ struct BitmapSizeTable
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
hb_barrier () &&
indexSubtableArrayOffset.sanitize (c, base, numberOfIndexSubtables) &&
horizontal.sanitize (c) &&
vertical.sanitize (c));
Expand Down Expand Up @@ -738,7 +741,9 @@ struct CBLC
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
hb_barrier () &&
likely (version.major == 2 || version.major == 3) &&
hb_barrier () &&
sizeTables.sanitize (c, this));
}

Expand Down Expand Up @@ -936,10 +941,12 @@ struct CBDT
}
}

bool has_data () const { return cbdt.get_length (); }
bool has_data () const { return cbdt->version.major; }

bool paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const
{
if (!has_data ()) return false;

hb_glyph_extents_t extents;
hb_glyph_extents_t pixel_extents;
hb_blob_t *blob = reference_png (font, glyph);
Expand Down Expand Up @@ -975,6 +982,7 @@ struct CBDT
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
hb_barrier () &&
likely (version.major == 2 || version.major == 3));
}

Expand Down
Loading