1.1 --- a/common/autoconf/jdk-options.m4 Mon Jul 16 15:37:08 2018 +0100 1.2 +++ b/common/autoconf/jdk-options.m4 Tue Jul 17 12:55:54 2018 +0200 1.3 @@ -556,6 +556,9 @@ 1.4 1.5 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], 1.6 [ 1.7 + # Backwards compatibility. --with-native-debug-symbols is preferred post JDK-8207234, 1.8 + # but if somebody does not specify it via configure, we still want to preserve old 1.9 + # behaviour of --disable-debug-symbols 1.10 # 1.11 # ENABLE_DEBUG_SYMBOLS 1.12 # This must be done after the toolchain is setup, since we're looking at objcopy. 1.13 @@ -589,6 +592,9 @@ 1.14 1.15 AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS]) 1.16 1.17 + # Backwards compatibility. --with-native-debug-symbols is preferred post JDK-8207234, 1.18 + # but if somebody does not specify it via configure, we still want to preserve old 1.19 + # behaviour of --disable-zip-debug-info. 1.20 # 1.21 # ZIP_DEBUGINFO_FILES 1.22 # 1.23 @@ -600,11 +606,88 @@ 1.24 1.25 if test "x${enable_zip_debug_info}" = "xno"; then 1.26 ZIP_DEBUGINFO_FILES=false 1.27 - else 1.28 + elif test "x${enable_zip_debug_info}" = "xyes"; then 1.29 ZIP_DEBUGINFO_FILES=true 1.30 fi 1.31 1.32 + # 1.33 + # NATIVE_DEBUG_SYMBOLS 1.34 + # This must be done after the toolchain is setup, since we're looking at objcopy. 1.35 + # In addition, this must be done after ENABLE_DEBUG_SYMBOLS and ZIP_DEBUGINFO_FILES 1.36 + # checking in order to preserve backwards compatibility post JDK-8207234. 1.37 + # 1.38 + AC_MSG_CHECKING([what type of native debug symbols to use (this will override previous settings)]) 1.39 + AC_ARG_WITH([native-debug-symbols], 1.40 + [AS_HELP_STRING([--with-native-debug-symbols], 1.41 + [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])], 1.42 + [ 1.43 + if test "x$OPENJDK_TARGET_OS" = xaix; then 1.44 + if test "x$with_native_debug_symbols" = xexternal || test "x$with_native_debug_symbols" = xzipped; then 1.45 + AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols]) 1.46 + fi 1.47 + fi 1.48 + ], 1.49 + [ 1.50 + # Default to unset for backwards compatibility 1.51 + with_native_debug_symbols="" 1.52 + ]) 1.53 + NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols 1.54 + if test "x$NATIVE_DEBUG_SYMBOLS" = x; then 1.55 + AC_MSG_RESULT([not specified]) 1.56 + else 1.57 + AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS]) 1.58 + fi 1.59 + # Default is empty 1.60 + DEBUG_BINARIES= 1.61 + # Default is min_strip. Possible values are min_strip, all_strip, no_strip 1.62 + STRIP_POLICY=min_strip 1.63 + 1.64 + if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then 1.65 + 1.66 + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then 1.67 + if test "x$OBJCOPY" = x; then 1.68 + # enabling of enable-debug-symbols and can't find objcopy 1.69 + # this is an error 1.70 + AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols]) 1.71 + fi 1.72 + fi 1.73 + 1.74 + ENABLE_DEBUG_SYMBOLS=true 1.75 + STRIP_POLICY=min_strip 1.76 + ZIP_DEBUGINFO_FILES=true 1.77 + elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then 1.78 + ENABLE_DEBUG_SYMBOLS=false 1.79 + STRIP_POLICY=min_strip 1.80 + ZIP_DEBUGINFO_FILES=false 1.81 + elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then 1.82 + ENABLE_DEBUG_SYMBOLS=true 1.83 + STRIP_POLICY=no_strip 1.84 + ZIP_DEBUGINFO_FILES=false 1.85 + POST_STRIP_CMD= 1.86 + DEBUG_BINARIES=true 1.87 + elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then 1.88 + 1.89 + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then 1.90 + if test "x$OBJCOPY" = x; then 1.91 + # enabling of enable-debug-symbols and can't find objcopy 1.92 + # this is an error 1.93 + AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols]) 1.94 + fi 1.95 + fi 1.96 + 1.97 + ENABLE_DEBUG_SYMBOLS=true 1.98 + STRIP_POLICY=min_strip 1.99 + ZIP_DEBUGINFO_FILES=false 1.100 + elif test "x$NATIVE_DEBUG_SYMBOLS" != x; then 1.101 + AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped]) 1.102 + else 1.103 + AC_MSG_NOTICE([--with-native-debug-symbols not specified. Using values from --disable-debug-symbols and --disable-zip-debug-info]) 1.104 + fi 1.105 + 1.106 AC_SUBST(ENABLE_DEBUG_SYMBOLS) 1.107 + AC_SUBST(STRIP_POLICY) 1.108 + AC_SUBST(POST_STRIP_CMD) 1.109 + AC_SUBST(DEBUG_BINARIES) 1.110 AC_SUBST(ZIP_DEBUGINFO_FILES) 1.111 ]) 1.112