RFR: 8222362: Upgrade to Freetype 2.10.0
philip.race at oracle.com
Tue Apr 16 23:40:14 UTC 2019
freetype 2.10 has been released and this fix upgrades
the JDK's internal copy from the previous latest of 2.9.1
Bug : https://bugs.openjdk.java.net/browse/JDK-8222362
Webrev : http://cr.openjdk.java.net/~prr/8222362/
Built on all platforms - tested using --with-freetype=bundled
Automated regression tests run
Verified manually with Font2DTest & SwingSet2
The license is the same - just a version update is needed.
A couple of new build warnings needed to be disabled and
there was a build problem on Windows, so one change
in AwtLibraries.gmk is to deal with this error :
> t:\workspace\build\windows-x64\support\native\java.desktop\libfreetype\freetype.lib : fatal error LNK1136: invalid or corrupt file
> Awt2dLibraries.gmk:602: recipe for target '/cygdrive/t/workspace/build/windows-x64/support/modules_libs/java.desktop/fontmanager.dll' failed
> make: *** [/cygdrive/t/workspace/build/windows-x64/support/modules_libs/java.desktop/fontmanager.dll] Error 1
The problem is that freetype.lib is empty (0 bytes)
I inferred this was because for some reason there was no longer anything being exported.
Hunting sound the source diff I found this :
-#if defined( _WIN32 )&& ( defined( _DLL ) || defined( DLL_EXPORT ) )
+#if defined( _WIN32 )&& defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x
Since we were are passing /MD to VC++ cl.exe will define _DLL for us, but
now freetype no longer looks for it.
This can be tracked back to a change in freetype build so that it relies on
an explicit define of DLL_EXPORT set up in the vcxproj file.
The comment as to why is below although I don't really understand if the reference
to static builds is meant to be a justification. My best guess is that they
are trying to say that even if _DLL is defined sometimes you maybe don't want/ need to
exports ymbols so we are now going to make you say so explicitly using DLL_EXPORT.
>We no longer use predefined _DLL, which can be defined for static
builds too with /MD.
>We use DLL_EXPORT and DLL_IMPORT instead, following libtool convention.
So my fix is to add the same manual define to our build as used by freetype.
More information about the build-dev