[8u] Request for enhancement backport approval for 8036003: Add --with-native-debug-symbols=[none|internal|external|zipped]
Rob McKenna
rob.mckenna at oracle.com
Thu Jul 19 11:38:44 UTC 2018
Thanks Severin, this enhancement has been approved.
-Rob
On 19/07/18 10:09, Severin Gehwolf wrote:
> Please approve this enhancement backport request for JDK 8u.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8036003
>
> Description of the change:
> --------------------------
>
> It adds a new configure option:
> --with-native-debug-symbols=[none|internal|external|zipped]
>
> Valid values for --with-native-debug-symbols are:
>
> none = No native debug symbols will get produced at all for
> binaries and libraries.
> internal = All native debug symbols get produced, but do not get
> stripped at all from binary files during the build.
> external = All native debug symbols get produced. During the
> build (most of) the native debug symbols get stripped from
> the original binaries and get copied to an external file
> with <name>.debuginfo placed next to stripped binaries.
> cf. $ objcopy --only-keep-debug <name> <name>.debuginfo && \
> strip -g <name>
> zipped = Like 'external', but with debuginfo files zipped. Files
> with debug information are called <name>.diz and get
> placed next to stripped binaries.
>
> Why should this enhancement be backported?
> ------------------------------------------
>
> While mechanisms equivalent to --with-native-debug-
> symbols=[none|external|zipped] exist today in JDK 8u, the use case of
> --with-native-debug-symbols=internal is currently missing. There is no
> way to achieve the same result of 'internal' without also patching the
> JDK 8u tree. This use case is very important for distributions which
> produce their own builds of OpenJDK. In many cases distributions have
> built-in mechanisms for getting debug info stripped during RPM/DPKG
> builds. For this to work the OpenJDK build needs to keep debug info in
> the files and not strip them at all.
>
> What's more, the current OpenJDK build produces .gnu_debuglink sections
> in all libraries and binaries if debug symbols are being turned on.
> This causes bugs, such as JDK-8207234[1].
>
> Risks:
> ------
> It is believed that the risk of backporting this enhancement is
> minimal, since it preserves backwards-compatibilty with existing
> switches, --disable-debug-symbols and --disable-zip-debug-info. Users
> who aren't aware of the new --with-native-debug-symbols switch won't be
> using it, but may be using --disable-debug-symbols and --disable-zip-
> debug-info. For them the build output isn't changed. Users who are
> aware of the new switch, will likely use --with-native-debug-symbols
> only. If they'd also use old --disable-debug-symbols and --disable-zip-
> debug-info, --with-native-debug-symbols will override the former
> switches. This behaviour is clearly shown in configure output. If none
> of those switches are present the default of --with-native-debug-
> symbols=zipped will be produced, as before.
>
> Examples:
>
> configure output post-patch with flags --disable-zip-debug-info, --
> disable-debug-symbols:
>
> [...]
> checking if we should generate debug symbols... false
> checking if we should zip debug-info files... no
> checking what type of native debug symbols to use (this will override previous settings)... not specified
> configure: --with-native-debug-symbols not specified. Using values from --disable-debug-symbols and --disable-zip-debug-info
> [...]
>
> configure output post-patch with flags --with-native-debug-
> symbols=internal:
>
> [...]
> checking if we should generate debug symbols... true
> checking if we should zip debug-info files... yes
> checking what type of native debug symbols to use (this will override previous settings)... internal
> [...]
>
> configure output post-patch with flags --with-native-debug-
> symbols=foobar:
>
> [...]
> checking if we should generate debug symbols... true
> checking if we should zip debug-info files... yes
> checking what type of native debug symbols to use (this will override previous settings)... foobar
> configure: error: Allowed native debug symbols are: none, internal, external, zipped
> configure exiting with result code 1
>
> Testing:
> --------
>
> Tested all build configs that I could think of (on Linux x86_64):
> * Old config is being preserved (default build of debug symbols +
> zipped; no --disable-zip-debug-info, --disable-debug-symbols, --
> with-native-debug-symbols flags)
> * Plain external debug symbols (flag --disable-zip-debug-info)
> * No debug-symbols build (flags --disable-zip-debug-info, --disable-
> debug-symbols)
> * Only using --with-native-debug-
> symbols={none,zipped,external,internal} (no flags --disable-zip-
> debug-info, --disable-debug-symbols). Where "internal" passes tests
> in JDK-8207234
>
> Also note that such a configure option exists in JDK 9+ already and
> we've been using the --with-native-debug-symbols=internal switch for
> our distribution's OpenJDK builds ever since.
>
> Thanks,
> Severin
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8207234
More information about the jdk8u-dev
mailing list