For historical reasons, the FDS (Full Debug Symbols) project only enabled debug symbols for a few select libraries, since this was difficult to achieve in the old build. Also, the FDS project never enabled debug symbols for macosx on the JDK libraries.

With the new build system, debug symbols come for free for all libraries, and we actually have to do extra work to keep them out. :-&

We should just stop doing that. It hurts no-one to have proper debug information for all libraries, it might come in helpful, and just doing it everywhere would simplify build logic.

This is mainly a build change, but I'm cc:ing the component teams just in case.

This patch leverages JDK-8036003, but provides a cleaner implementation of this logic in the makefiles. Instead of the vague ENABLE_DEBUG_SYMBOLS, I have introduced three clearly defined variables:

COMPILE_WITH_DEBUG_SYMBOLS
COPY_DEBUG_SYMBOLS
ZIP_EXTERNAL_DEBUG_SYMBOLS

The various settings of --with-native-debug-symbols turns these variables on/off depending on what we want to achieve, and the makefiles check these variables to determine what compiler flags to use, whether to run objcopy (or similar) and whether to zip the extracted symbols, respectively.

A fourth variable (STRIP_DEBUG_SYMBOLS) is needed to fully complement this, but the way we handle stripping is complex in it's own right, and I've saved that for a separate patch.

Note that this patch intentionally does not affect the Hotspot build system. The variables for the hotspot build is kept unchanged. When the new build-infra based hotspot build system arrives, the functionality introduced in this patch will be automatically used. Until then, I prefer not to mess any more than necessary with the hotspot makefiles.

Bug: https://bugs.openjdk.java.net/browse/JDK-8145596
WebRev: http://cr.openjdk.java.net/~ihse/JDK-8145596-fix-native-debug-symbols-properly/webrev.01

/Magnus

Reply via email to