Hi, This work started as a patch for JDK-8207234[1], but turned out to become a 8-backport of JDK-8036003[2] using the old build logic and with backwards-compatibilty. We are facing an issue where .gnu_debuglink sections get generated unconditionally on the various JDK libs (serviceability, security, nio, awt, etc.). That's an issue, since for our distro builds the stripping happens outside the OpenJDK build post-factum. The result of adding debug links unconditionally is that our binaries would have two links, one pointing to a file which doesn't exist.
What's more, there is no real support for the kind of debug-info build we need as downstream distribution consumers: Have all debug symbols present, but leave them in the binary/library itself without any stripping. That's basically what JDK 11's --with-native-debug- symbols=internal does. This patch ports that configure flag to JDK 8u and keeps backward-compatibility with --disable-debug-symbols and -- disable-zip-debug-info flags. More info on this in [1]. Bug(s): https://bugs.openjdk.java.net/browse/JDK-8207234 https://bugs.openjdk.java.net/browse/JDK-8036003 webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8207234/01/ 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 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 Thanks, Severin [1] https://bugs.openjdk.java.net/browse/JDK-8207234 [2] https://bugs.openjdk.java.net/browse/JDK-8036003