[8u] RFR: 8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped
Severin Gehwolf
sgehwolf at redhat.com
Tue Jul 17 13:57:19 UTC 2018
Hi Andrew,
On Sun, 2018-07-15 at 03:11 +0100, Andrew Hughes wrote:
> On 6 July 2018 at 09:26, Severin Gehwolf <sgehwolf at redhat.com> wrote:
> > Hi David,
> >
> > On Fri, 2018-07-06 at 11:53 +1000, David Holmes wrote:
> > > Hi Severin,
> > >
> > > On 6/07/2018 2:41 AM, Severin Gehwolf wrote:
> > > > Hi,
> > > >
> > > > Please review this 8u-only change. JDK 10+ are not affected.
> > > >
> > > > For JDK 8 builds which don't perform any debug info stripping no
> > > > .gnu_debuglink sections should get generated. The fix is to move the
> > > > objcopy --add-gnu-debuglink calls into branches which actually perform
> > > > some stripping: all_strip, min_strip. Thoughts?
> > >
> > > Has anything changed with the tools here? This has been in place since
> > > back in 2011 with 7u2 and 8 GA! Why has it only become an issue now?
> >
> > I'm doubtful anything has changed with the tools. This is one of those
> > patches which we seem to have been carrying downstream for a very long
> > time. My archeology seems to suggest it started to show up in Fedora 23
> > in November 2016. If anything, we'd be to blame to not push this fix
> > upstream earlier.
>
> The issue of 'no_strip' not being respected is a lot older than that
> and has been
> discussed on these lists at length before (e.g. [0] [1] [2]). The
> impression I got
> back that was that change was not wanted upstream and we should hack around
> the defaults with various environment variables.
>
> This fix only seems to make things more confusing. The .gnu_debuglink section
> is now only created when STRIP_POLICY is 'all_strip' or 'min_strip', but the
> debuginfo file is created for any value of STRIP_POLICY. The result is that
> other values of STRIP_POLICY will create a debuginfo file that is not linked
> to the original object. That seems like a regression from what happened
> previously.
>
> defs.make refers to a 'no_strip' value for STRIP_POLICY, but it is never
> checked for elsewhere in the build, as far as I can see. I feel that the clearer
> logic in these files would be:
>
> ifneq ($(STRIP_POLICY),no_strip)
> $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
> $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
> endif
I can fix this with https://bugs.openjdk.java.net/browse/JDK-8207402,
but if JDK-8207234 goes into JDK 8u, unknown values for STRIP_POLICY
should become less likely as users would be able to use --with-native-
debug-symbols=internal for that use-case. That would be in-line with
JDK 9+
Thanks,
Severin
> [0] http://mail.openjdk.java.net/pipermail/build-dev/2012-September/006680.html
> [1] http://mail.openjdk.java.net/pipermail/build-infra-dev/2013-March/003186.html
> [2] http://mail.openjdk.java.net/pipermail/build-dev/2014-February/012019.html
> [3] http://mail.openjdk.java.net/pipermail/build-dev/2012-September/006695.html
More information about the build-dev
mailing list