Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8214796

Create a jlink plugin for stripping debug info symbols from native libraries



    • Enhancement
    • Resolution: Fixed
    • P4
    • 13
    • 11, 12
    • tools
    • b21
    • generic
    • linux


      This issue originally surfaced in our packaged OpenJDK 11 builds for
      Fedora. If a user created a custom image from the packaged JDK, the
      resulting custom image would be huge in size because of non-stripped
      debug symbols in the packaged binaries (~500MB vs. ~50MB).

      Native libraries and executables in the packaged JDK image would be
      properly stripped of debug symbols, but copies of those files in the
      jmod files would not be. That has to do with a) How we build for the
      Fedora distribution: --with-native-debug-symbols=internal configure
      switch. b) When the stripping happens. In the Fedora case, b) happens
      external to the OpenJDK build by the RPM build system *after* the
      OpenJDK build actually completes. This means copies of native libraries
      and executables with full debug symbols would already be "zipped up" in
      jmod files when the distribution build's stripping process starts.
      Hence, the distribution build system doesn't "see" DSO/EXE copies in
      jmod files in the JDK images directory. They are archived in jmod
      files. Because of this we end up with properly stripped libraries and
      executables in the default, extracted JDK image, but DSOs/EXEs in the
      'jmods' directory would still have full debug symbols internal to the
      binaries. Yet, when jlink is being run, jmod files in directory 'jmods'
      are being used for creating custom modular JDK images.

      A similar problem may arise for custom native libraries of external modules which may have debug symbols internal in DSOs/EXEs.

      Originally the discussion started here:

      It would be nice to have a jlink plugin which would be able to strip debug symbols from native libraries.


        Issue Links



              sgehwolf Severin Gehwolf
              sgehwolf Severin Gehwolf
              0 Vote for this issue
              5 Start watching this issue