libjvm.so, jmods and --with-native-debug-symbols=internal
Erik Joelsson
erik.joelsson at oracle.com
Fri Feb 10 08:25:01 UTC 2017
Hello,
Oracle builds with external debuginfo and handles packaging of debuginfo
in the build, so we don't have this problem. For us the jmods always
contain stripped binaries. I guess nobody thought of your process so
this is an unfortunate side effect. I don't have any good idea on how to
solve it.
/Erik
On 2017-02-09 18:41, Omair Majid wrote:
> Hi,
>
> I have been working on building preview versions of OpenJDK 9 for
> Fedora. You can see the latest build here:
> https://copr.fedorainfracloud.org/coprs/omajid/openjdk9/build/509314/
>
> One thing that I just realized is that we build OpenJDK 9 using the
> configure option --with-native-debug-symbols=internal. As far as I
> understand the build, this is what happens:
>
> 1. libjvm.so is built
> 2. libjvm.so is not stripped of any debug information
> 3. a jmod - java.base.jmod - containing libjvm.so is created
> 4. the jmod containing libjvm.so is extracted to create images/jdk/ (and
> images/jre/)
>
> Then the linux packaging tools (rpmbuild in my case) take over and do
> the following:
>
> 5. strip libjvm.so in images/jdk/, put stripped symbols in a separate
> location
> 6. Package up images/jdk/ into the distribution package
> 7. make a -debuginfo package (or -dbg in case of Debian) that contains
> the stripped symbols from libjvm.so
>
> So now users get a libjvm.so in the default package that's stripped and
> less than 20MB. They also get an optional -debuginfo (or -dbg) package
> that contains just the debug symbols. This lets them use the small
> package containing libjvm and but also lets them download a large
> package to debug libjvm.so if they wish. This is all great so far and
> works like it should.
>
> One new change that happened with OpenJDK 9 only is that the jmod
> (java.base.jmod here) contains the original and unstripped libjvm.so.
> This jmod also gets included into the images/jdk/. This bumps up the
> images/jdk/jmods directory size to hundreds of megabytes. Anyone who now
> wants to use jmods now ends up installing all the unstripped debuginfo,
> unintentionally, eating up disk space.
>
> Is this intentional or an unintended side-effect of various changes? Is
> it a known issue?
>
> Thanks,
> Omair
>
More information about the build-dev
mailing list