From 2e52dc016ef4184fbdc4fa1f95ebaaf79865d870 Mon Sep 17 00:00:00 2001 From: erikj Date: Tue, 11 Dec 2012 11:33:34 +0100 Subject: [PATCH] 8001753: build-infra: mismatch with full debug symbol control for hotspot Summary: Enabling hotspot to use the FDS settings established at configure time Reviewed-by: dholmes, ohair --- common/autoconf/generated-configure.sh | 44 ++++++++++++-------------- common/autoconf/hotspot-spec.gmk.in | 18 +++++++++++ common/autoconf/jdk-options.m4 | 44 +++++++++++--------------- common/makefiles/NativeCompilation.gmk | 10 +++--- 4 files changed, 61 insertions(+), 55 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 177334c..b149541 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -3674,7 +3674,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1355221697 +DATE_WHEN_GENERATED=1355221914 ############################################################################### # @@ -27820,34 +27820,34 @@ esac # ENABLE_DEBUG_SYMBOLS # This must be done after the toolchain is setup, since we're looking at objcopy. # -ENABLE_DEBUG_SYMBOLS=default - -# default on macosx is no... -if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ENABLE_DEBUG_SYMBOLS=no -fi - # Check whether --enable-debug-symbols was given. if test "${enable_debug_symbols+set}" = set; then : - enableval=$enable_debug_symbols; ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols} + enableval=$enable_debug_symbols; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should generate debug symbols" >&5 $as_echo_n "checking if we should generate debug symbols... " >&6; } -if test "x$ENABLE_DEBUG_SYMBOLS" = "xyes" && test "x$OBJCOPY" = x; then +if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then # explicit enabling of enable-debug-symbols and can't find objcopy # this is an error as_fn_error $? "Unable to find objcopy, cannot enable debug-symbols" "$LINENO" 5 fi -if test "x$ENABLE_DEBUG_SYMBOLS" = "xdefault"; then +if test "x$enable_debug_symbols" = "xyes"; then + ENABLE_DEBUG_SYMBOLS=true +elif test "x$enable_debug_symbols" = "xno"; then + ENABLE_DEBUG_SYMBOLS=false +else + # default on macosx is false + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + ENABLE_DEBUG_SYMBOLS=false # Default is on if objcopy is found, otherwise off - if test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then - ENABLE_DEBUG_SYMBOLS=yes + elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then + ENABLE_DEBUG_SYMBOLS=true else - ENABLE_DEBUG_SYMBOLS=no + ENABLE_DEBUG_SYMBOLS=false fi fi @@ -27857,25 +27857,21 @@ $as_echo "$ENABLE_DEBUG_SYMBOLS" >&6; } # # ZIP_DEBUGINFO_FILES # -ZIP_DEBUGINFO_FILES=yes - # Check whether --enable-zip-debug-info was given. if test "${enable_zip_debug_info+set}" = set; then : - enableval=$enable_zip_debug_info; ZIP_DEBUGINFO_FILES=${enable_zip_debug_info} + enableval=$enable_zip_debug_info; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5 $as_echo_n "checking if we should zip debug-info files... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_DEBUGINFO_FILES" >&5 -$as_echo "$ZIP_DEBUGINFO_FILES" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_zip_debug_info}" >&5 +$as_echo "${enable_zip_debug_info}" >&6; } -# Hotspot wants ZIP_DEBUGINFO_FILES to be 1 for yes -# use that... -if test "x$ZIP_DEBUGINFO_FILES" = "xyes"; then - ZIP_DEBUGINFO_FILES=1 +if test "x${enable_zip_debug_info}" = "xno"; then + ZIP_DEBUGINFO_FILES=false else - ZIP_DEBUGINFO_FILES=0 + ZIP_DEBUGINFO_FILES=true fi diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index 884a911..afc887a 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -97,6 +97,24 @@ EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@ USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@ +# Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols +# creation. +ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + FULL_DEBUG_SYMBOLS=1 + # Ensure hotspot uses the objcopy that configure located + ALT_OBJCOPY:=$(OBJCOPY) +else + FULL_DEBUG_SYMBOLS=0 +endif + +# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false. +ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue) + ZIP_DEBUGINFO_FILES:=1 +endif +ifeq ($(ZIP_DEBUGINFO_FILES), false) + ZIP_DEBUGINFO_FILES:=0 +endif + # Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files. # This is needed to get the LOG setting to work properly. include $(SRC_ROOT)/common/makefiles/MakeBase.gmk diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 39e003f..756c614 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -432,32 +432,30 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], # ENABLE_DEBUG_SYMBOLS # This must be done after the toolchain is setup, since we're looking at objcopy. # -ENABLE_DEBUG_SYMBOLS=default - -# default on macosx is no... -if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ENABLE_DEBUG_SYMBOLS=no -fi - AC_ARG_ENABLE([debug-symbols], - [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])], - [ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}], -) + [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])]) AC_MSG_CHECKING([if we should generate debug symbols]) -if test "x$ENABLE_DEBUG_SYMBOLS" = "xyes" && test "x$OBJCOPY" = x; then +if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then # explicit enabling of enable-debug-symbols and can't find objcopy # this is an error AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols]) fi -if test "x$ENABLE_DEBUG_SYMBOLS" = "xdefault"; then +if test "x$enable_debug_symbols" = "xyes"; then + ENABLE_DEBUG_SYMBOLS=true +elif test "x$enable_debug_symbols" = "xno"; then + ENABLE_DEBUG_SYMBOLS=false +else + # default on macosx is false + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + ENABLE_DEBUG_SYMBOLS=false # Default is on if objcopy is found, otherwise off - if test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then - ENABLE_DEBUG_SYMBOLS=yes + elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then + ENABLE_DEBUG_SYMBOLS=true else - ENABLE_DEBUG_SYMBOLS=no + ENABLE_DEBUG_SYMBOLS=false fi fi @@ -466,22 +464,16 @@ AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS]) # # ZIP_DEBUGINFO_FILES # -ZIP_DEBUGINFO_FILES=yes - AC_ARG_ENABLE([zip-debug-info], - [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])], - [ZIP_DEBUGINFO_FILES=${enable_zip_debug_info}], -) + [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])]) AC_MSG_CHECKING([if we should zip debug-info files]) -AC_MSG_RESULT([$ZIP_DEBUGINFO_FILES]) +AC_MSG_RESULT([${enable_zip_debug_info}]) -# Hotspot wants ZIP_DEBUGINFO_FILES to be 1 for yes -# use that... -if test "x$ZIP_DEBUGINFO_FILES" = "xyes"; then - ZIP_DEBUGINFO_FILES=1 +if test "x${enable_zip_debug_info}" = "xno"; then + ZIP_DEBUGINFO_FILES=false else - ZIP_DEBUGINFO_FILES=0 + ZIP_DEBUGINFO_FILES=true fi AC_SUBST(ENABLE_DEBUG_SYMBOLS) diff --git a/common/makefiles/NativeCompilation.gmk b/common/makefiles/NativeCompilation.gmk index 441dfaf..7ead10c 100644 --- a/common/makefiles/NativeCompilation.gmk +++ b/common/makefiles/NativeCompilation.gmk @@ -302,7 +302,7 @@ define SetupNativeCompilation endif ifneq (,$$($1_DEBUG_SYMBOLS)) - ifeq ($(ENABLE_DEBUG_SYMBOLS), yes) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) # Programs don't get the debug symbols added in the old build. It's not clear if # this is intentional. ifeq ($$($1_PROGRAM),) @@ -394,7 +394,7 @@ define SetupNativeCompilation endif ifneq (,$$($1_DEBUG_SYMBOLS)) - ifeq ($(ENABLE_DEBUG_SYMBOLS), yes) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) ifeq ($(OPENJDK_TARGET_OS), windows) $1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_LIBRARY).pdb" \ "-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map" @@ -429,7 +429,7 @@ define SetupNativeCompilation endif # Touch to not retrigger rule on rebuild $(TOUCH) $$@ - ifeq ($(ZIP_DEBUGINFO_FILES), 1) + ifeq ($(ZIP_DEBUGINFO_FILES), true) $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz ifeq ($(OPENJDK_TARGET_OS), windows) @@ -472,7 +472,7 @@ define SetupNativeCompilation ifneq (,$$($1_PROGRAM)) # A executable binary has been specified, setup the target for it. ifneq (,$$($1_DEBUG_SYMBOLS)) - ifeq ($(ENABLE_DEBUG_SYMBOLS), yes) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) ifeq ($(OPENJDK_TARGET_OS), windows) $1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_PROGRAM).pdb" \ "-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map" @@ -507,7 +507,7 @@ define SetupNativeCompilation endif $(TOUCH) $$@ - ifeq ($(ZIP_DEBUGINFO_FILES), 1) + ifeq ($(ZIP_DEBUGINFO_FILES), true) $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz ifeq ($(OPENJDK_TARGET_OS), windows) -- GitLab