RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size

Erik Joelsson erikj at openjdk.org
Tue Nov 18 14:08:15 UTC 2025


On Tue, 18 Nov 2025 08:55:16 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> > Is there is a particular reason to not apply this on x64 as well?
> 
> On macOS x86_64 I saw in our CI those tests failing when enabling the dead_strip feature serviceability/sa/ClhsdbCDSCore.java serviceability/sa/ClhsdbFindPC.jav serviceability/sa/ClhsdbPstack.java

That information should at least be stated in the bug for future reference on why this decision was made. 
 
> For macOS aarch64, the tests in our CI were fine but I see some failures in the GHA in the serviceability area.
> 
> ```
> finding class loader instances ..java.lang.InternalError: Metadata does not appear to be polymorphic
> 	at jdk.hotspot.agent/sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:223)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:104)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:78)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.memory.SystemDictionary.getClassLoaderKlass(SystemDictionary.java:102)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.printClassLoaderStatistics(ClassLoaderStats.java:93)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.run(ClassLoaderStats.java:78)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:121)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:278)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:202)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:344)
> 	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507)
> ```

Adding serviceability label as this is affecting their tests. I have a vague memory of some seemingly dead code being necessary for certain sa functionality.

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

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


More information about the build-dev mailing list