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

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

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 12
    • Fix Version/s: 13
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21
    • CPU:
      generic
    • OS:
      linux

      Description

      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:
      http://mail.openjdk.java.net/pipermail/jigsaw-dev/2018-December/014037.html

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sgehwolf Severin Gehwolf
              Reporter:
              sgehwolf Severin Gehwolf
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: