On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken <[email protected]> wrote:

> The dead_strip linker option on macOS removes functions and data that are 
> unreachable by the entry point or exported symbols.
> Setting it can reduce the size of some binaries we generate quite a lot, for 
> example (product build, Xcode 15 is used) :
> (before -> after setting the option)
> 
> 1.4M -> 1.1M images/jdk/lib/libfontmanager.dylib
> 264K -> 248K images/jdk/lib/libjavajpeg.dylib
> 152K -> 132K images/jdk/lib/libjli.dylib
> 388K -> 296K images/jdk/lib/liblcms.dylib
> 164K -> 128K images/jdk/lib/libzip.dylib
> 
> 
> and libjvm :
> 
> 20M -> 18M images/jdk/lib/server/libjvm.dylib
> 146M -> 137M images/jdk/lib/server/libjvm.dylib.dSYM

I reproduced the SA issues locally. Not surprisingly almost every SA test 
failed (I'm not sure why only 3 were listed above). They seemed to all fail 
trying to get a vtable for a hotspot type. The tests that didn't failed were 
doing mundane things like testing attaching, hotspot flags, and clhsdb history, 
but not doing anything with hotspot objects, or at least not with hotspot 
metadata.

I was able to confirm the problem is with the Metadata vtable missing. I fixed 
it by allocating a Metadata instance and assigning it to a global. However, in 
order to get this to compile I had make Metadata no longer be abstract. All 
tests passed after I did this. I'm not sure how viable a solution this is. The 
hotspot team will probably object to the Metadata changes. Maybe there is some 
other way to cause a reference to the Metadata vtable so it is not dead 
stripped.

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

PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3550388831

Reply via email to