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

Conversation

vieiro
Copy link
Contributor

@vieiro vieiro commented Apr 25, 2025

Backport of JDK-8348597 from JDK17 that updates HarfBuzz to 10.4.0 (which improves drawing performande by 10+% and includes different build fixes). Backport is not clean because it required adapting make/lib/Awt2dLibraries.gmk to fit JDK11.

Even though the backport built correctly, the resulting jdk/lib/libfontmanager.so contained undefined symbols that caused Swing tests to fail with UnsatisfiedLinkError. This is because JDK11 is missing JDK-8319197 that excludes hb-subset from compilation, so this is also included as the second commit in the pull request.

While at it, a third commit adds an additional -Wno-attributes flag to HARFBUZZ_DISABLED_WARNINGS_CXX_gcc, restoring the capability to build JDK11 on Linux with gcc-4.8.5 (this is an old version of gcc, dating from 2015, but it's still the system gcc version in RHEL-7).

Tested

  • on Windows 10 with jdk:jfc_demo.
  • on Linux with jdk:jfc_demo, with
    • gcc 4.8.5/harfbuzz-1.7.5 (x86_64 & s390x),
    • gcc 8.5.0/harfbuzz-1.7.5 (x86_64),
    • gcc 11.5.0/harfbuzz-2.7.4 (x86_64)
    • and gcc 14.2.1/harfbuzz-9.0.0 (x86_64)

with both --with-harfbuzz=system and --with-harfbuzz=bundled.


Progress

  • Change must not contain extraneous whitespace
  • JDK-8348597 needs maintainer approval
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 2 Reviewers)
  • JDK-8319197 needs maintainer approval

Issues

  • JDK-8348597: Update HarfBuzz to 10.4.0 (Bug - P3 - Requested)
  • JDK-8319197: Exclude hb-subset and hb-style from compilation (Enhancement - P4 - Requested)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3026/head:pull/3026
$ git checkout pull/3026

Update a local copy of the PR:
$ git checkout pull/3026
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3026/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3026

View PR using the GUI difftool:
$ git pr show -t 3026

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3026.diff

Using Webrev

Link to Webrev Comment

@vieiro
Copy link
Contributor Author

vieiro commented Apr 25, 2025

/issue add JDK-8334964

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 25, 2025

👋 Welcome back vieiro! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 25, 2025
@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@vieiro
Adding additional issue to issue list: 8334964: Exclude hb-subset and hb-style from compilation.

@vieiro vieiro changed the title 8348597: Update HarfBuzz to 10.4.0 Backport ba3db307dceb41e48014451873fdf4db3816a537 Apr 25, 2025
@openjdk openjdk bot changed the title Backport ba3db307dceb41e48014451873fdf4db3816a537 8319197: Exclude hb-subset and hb-style from compilation Apr 25, 2025
@openjdk
Copy link

openjdk bot commented Apr 25, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label Apr 25, 2025
@vieiro vieiro changed the title 8319197: Exclude hb-subset and hb-style from compilation Backport f4e99de33e35826ec1fb368d6ad96005d7bd5cc4 Apr 25, 2025
@openjdk openjdk bot changed the title Backport f4e99de33e35826ec1fb368d6ad96005d7bd5cc4 8348597: Update HarfBuzz to 10.4.0 Apr 25, 2025
@openjdk
Copy link

openjdk bot commented Apr 25, 2025

This backport pull request has now been updated with issue from the original commit.

@mlbridge
Copy link

mlbridge bot commented Apr 25, 2025

Webrevs

@vieiro
Copy link
Contributor Author

vieiro commented Apr 25, 2025

Fixing issues:
/issue add JDK-8319197
/issue remove JDK-8334964

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@vieiro
Adding additional issue to issue list: 8319197: Exclude hb-subset and hb-style from compilation.

@openjdk
Copy link

openjdk bot commented Apr 25, 2025

@vieiro
Removing additional issue from issue list: 8334964.

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

A few comments that need clarifications. Thanks!

Comment on lines 559 to 563
# 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?

# 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!

Comment on lines 576 to 577
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!

@vieiro
Copy link
Contributor Author

vieiro commented May 12, 2025

/issue add JDK-8258484

@openjdk
Copy link

openjdk bot commented May 12, 2025

@vieiro
Adding additional issue to issue list: 8258484: AIX build fails in Harfbuzz with XLC 16.01.0000.0006.

@openjdk
Copy link

openjdk bot commented May 12, 2025

⚠️ @vieiro This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@vieiro
Copy link
Contributor Author

vieiro commented May 12, 2025

/approval request Please consider approving this backport from JDK17 that levels up HarfBuzz version with upper JDKs and improves drawing performance. This also allows building again on older gcc v4.8.5.

@openjdk
Copy link

openjdk bot commented May 12, 2025

@vieiro
8348597: The approval request has been created successfully.
8319197: The approval request has been created successfully.
8258484: The approval request has been created successfully.

@openjdk openjdk bot added the approval label May 12, 2025
@gnu-andrew
Copy link
Member

Will take a look at this.
/reviewers 2 reviewer

@openjdk
Copy link

openjdk bot commented May 13, 2025

@gnu-andrew
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 2 Reviewers).

@vieiro
Copy link
Contributor Author

vieiro commented May 13, 2025

While at it, let's add MacOS 12.6.1/arm64 (virtualized)/clang 13.1.6 to the list of tests.

Copy link
Member

@gnu-andrew gnu-andrew left a comment

Choose a reason for hiding this comment

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

The code changes look fine and match 17u.

I'm confused by what is going on in make/lib/Awt2dLibraries.gmk. There should be just two changes here according to the description:

  • The addition of dangling-pointer to the disabled warnings as in 8348597
  • The expansion of LIBFONTMANAGER_EXCLUDE_FILES from 8319197

While I would prefer 8319197 was handled separately - as it is independent of this change - it is simple enough that it can be included here.

What I don't get is why the block is being indented by one space, which is obscuring the changes made to the set of disabled warnings. I think the clang ones are also being reordered but it's hard to tell for sure. I imagine this is why the other additions Severin already caught slipped in as well.

I also don't think an AIX change should be included if you are not testing on AIX or there is at least some relation to this change.

Please fix Awt2dLibraries.gmk to just update the lines we actually want to change as documented in the PR summary without altering the indentation and adding the AIX fix. Thanks.

@vieiro
Copy link
Contributor Author

vieiro commented May 20, 2025

/issue remove JDK-8258484

@openjdk
Copy link

openjdk bot commented May 20, 2025

@vieiro
Removing additional issue from issue list: 8258484.

@vieiro
Copy link
Contributor Author

vieiro commented May 20, 2025

Thanks for the review!

I'm confused by what is going on in make/lib/Awt2dLibraries.gmk. There should be just two changes here according to the description:

* The addition of `dangling-pointer` to the disabled warnings as in 8348597

* The expansion of `LIBFONTMANAGER_EXCLUDE_FILES` from 8319197

The intention was to make Awt2dLibraries.gmk more similar to the one in JDK-17 (which has had significant changes during the years), with the intention to make future backports easier (at the cost of a more difficult review), hence the reordering and the indentation.

So I've re-arranged the changes to make them more similar to the original Awt2dLibraries.gmk in 11. Hope this makes it easier to review. Note the attributes is required for gcc.4.8.5.

Retested with:

  • gcc 4.8.5/harfbuzz-1.7.5 (x86_64),
  • and gcc 14.2.1/harfbuzz-9.0.0 (x86_64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval backport rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants