On Wed, 15 Dec 2021 00:25:08 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
> Build change to strip the non-global symbols from native shared libraries on > Linux and macOS by running `strip -x`, unless doing a `-PCONF=DebugNative` > build. > > Here is a before / after size comparison. All sizes in KBytes: > > ### Linux > > | Native Library | Current | Stripped | > | --------------- | --------- | -------- | > | libavplugin-54.so | 52 | 48 | > | libavplugin-56.so | 52 | 48 | > | libavplugin-57.so | 52 | 48 | > | libavplugin-ffmpeg-56.so | 52 | 48 | > | libavplugin-ffmpeg-57.so | 52 | 48 | > | libavplugin-ffmpeg-58.so | 52 | 48 | > | libdecora_sse.so | 76 | 72 | > | libfxplugins.so | 56 | 52 | > | libglass.so | 16 | 12 | > | libglassgtk2.so | 932 | 324 | > | libglassgtk3.so | 932 | 324 | > | libgstreamer-lite.so | 2,280 | 2,100 | > | libjavafx_font.so | 20 | 16 | > | libjavafx_font_freetype.so | 28 | 28 | > | libjavafx_font_pango.so | 28 | 24 | > | libjavafx_iio.so | 148 | 140 | > | libjfxmedia.so | 2,048 | 516 | > | libjfxwebkit.so | 106,696 | 88,428 | > | libprism_common.so | 8 | 8 | > | libprism_es2.so | 64 | 64 | > | libprism_sw.so | 68 | 64 | > > ### macOS > > | Native Library | Current | Stripped | > | --------------- | --------- | -------- | > | libdecora_sse.dylib | 88 | 88 | > | libfxplugins.dylib | 88 | 84 | > | libglass.dylib | 360 | 324 | > | libglib-lite.dylib | 1,192 | 1,148 | > | libgstreamer-lite.dylib | 1,708 | 1584 | > | libjavafx_font.dylib | 64 | 64 | > | libjavafx_iio.dylib | 308 | 300 | > | libjfxmedia.dylib | 212 | 200 | > | libjfxmedia_avf.dylib | 100 | 88 | > | libjfxwebkit.dylib | 85,896 | 71,636 | > | libprism_common.dylib | 20 | 20 | > | libprism_es2.dylib | 64 | 64 | > | libprism_sw.dylib | 88 | 88 | This looks good and useful. I'll do builds and tests on Linux and Mac. The only question I have for now is if it would make sense to have a new configuration instead of binding this to DEBUG_NATIVE. The impact of building with DEBUG_NATIVE is very big. For most debugging and crash resolutions, DEBUG_NATIVE is not required, but symbols make it easier/faster to debug. But it's doable with stripped libs as well of course -- and I agree stripped libs should be the default for distributions. ------------- PR: https://git.openjdk.java.net/jfx/pull/695