RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size
Andrew Haley
aph at openjdk.org
Wed Nov 19 15:33:26 UTC 2025
On Fri, 14 Nov 2025 11:25:05 GMT, Matthias Baesken <mbaesken at openjdk.org> 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
On 19/11/2025 13:22, Matthias Bäsken wrote:
> MBaesken left a comment (openjdk/jdk#28319)
>
>> I remember s390 used to strip unneeded stuff, and it was very hard to debug anything.
>
> What exactly was hard to debug?
> Did you use (fast)debug or product binaries ?
> I do not remember issues like this on s390 but I can ask my (ex)colleagues who dealt more with s390 .
It was hard to debug hotspot. Helpers such as pp(), back_trace(), and pfl() were missing.
I think it was a release build, but of course you sometimes have to debug release builds.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3553349390
More information about the build-dev
mailing list