On Tue, 17 Dec 2024 12:53:35 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by 
> `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static 
> build, the JVM can recognize that the library is already loaded, and does not 
> try to load a (non-existent) external library.
> 
> Our bundled version of freetype is missing such a marker.
> 
> This turns out to be a problem just on Windows, since the 
> `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only 
> executed on Windows. However, the cost of including this in the bundled 
> versions on all platforms is very small, and it is a safeguard for any future 
> changes. In practice, freetype bundling is only enabled on Windows anyways.

This pull request has now been integrated.

Changeset: f3e2f882
Author:    Magnus Ihse Bursie <i...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/f3e2f8821a63711599b9cecb91d62db59b915c90
Stats:     34 lines in 2 files changed: 33 ins; 0 del; 1 mod

8346394: Bundled freetype library needs to have JNI_OnLoad for static builds

Reviewed-by: erikj, prr

-------------

PR: https://git.openjdk.org/jdk/pull/22791

Reply via email to