RFR: 8371893: [macOS aarch64] use dead_strip linker option to reduce binary size [v4]
Matthias Baesken
mbaesken at openjdk.org
Mon Nov 24 14:53:33 UTC 2025
> 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
Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
Set the -dead_strip linker option only for the JDK libs
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28319/files
- new: https://git.openjdk.org/jdk/pull/28319/files/b41966b8..b63b9ca8
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28319&range=02-03
Stats: 13 lines in 2 files changed: 2 ins; 10 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/28319.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28319/head:pull/28319
PR: https://git.openjdk.org/jdk/pull/28319
More information about the build-dev
mailing list