On Mon, 24 Nov 2025 14:53:33 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 > > 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 Any comments on the recent version ? The dead_strip option seems to the rather similar to the link time gc option we support for gcc currently and offer this configure flag make/autoconf/jdk-options.m4 112 UTIL_ARG_ENABLE(NAME: linktime-gc, DEFAULT: $LINKTIME_GC_DEFAULT, 113 DEFAULT_DESC: [auto], RESULT: ENABLE_LINKTIME_GC, 114 DESC: [use link time gc on unused code sections in the JDK build], 115 CHECKING_MSG: [if linker should clean out unused code (linktime-gc)]) 116 AC_SUBST(ENABLE_LINKTIME_GC) Should we also put the dead_strip behind this configure flag and rephrase the description above a little bit , e.g. `114 DESC: [use link time gc or similar features on unused code sections in the JDK build],` ------------- PR Comment: https://git.openjdk.org/jdk/pull/28319#issuecomment-3574548509
