mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
7165611: implement Full Debug Symbols on MacOS X hotspot
Add MacOS X FDS support to hotspot; add minimal MacOS X FDS import support to jdk; add MacOS X FDS support to install; add MacOS X FDS support to root. Reviewed-by: erikj, sla, dholmes, rdurbin, tbell, ihse
This commit is contained in:
parent
85b5a91ea8
commit
00478aa3b7
6 changed files with 133 additions and 61 deletions
|
@ -644,6 +644,7 @@ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||||
|
BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil)
|
||||||
BASIC_REQUIRE_PROG(XATTR, xattr)
|
BASIC_REQUIRE_PROG(XATTR, xattr)
|
||||||
AC_PATH_PROG(CODESIGN, codesign)
|
AC_PATH_PROG(CODESIGN, codesign)
|
||||||
if test "x$CODESIGN" != "x"; then
|
if test "x$CODESIGN" != "x"; then
|
||||||
|
|
|
@ -824,6 +824,7 @@ OS_VERSION_MINOR
|
||||||
OS_VERSION_MAJOR
|
OS_VERSION_MAJOR
|
||||||
PKG_CONFIG
|
PKG_CONFIG
|
||||||
CODESIGN
|
CODESIGN
|
||||||
|
DSYMUTIL
|
||||||
XATTR
|
XATTR
|
||||||
IS_GNU_TIME
|
IS_GNU_TIME
|
||||||
TIME
|
TIME
|
||||||
|
@ -10594,6 +10595,64 @@ $as_echo "no" >&6; }
|
||||||
$as_echo "yes" >&6; }
|
$as_echo "yes" >&6; }
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
for ac_prog in dsymutil
|
||||||
|
do
|
||||||
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
|
set dummy $ac_prog; ac_word=$2
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||||
|
$as_echo_n "checking for $ac_word... " >&6; }
|
||||||
|
if ${ac_cv_path_DSYMUTIL+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
case $DSYMUTIL in
|
||||||
|
[\\/]* | ?:[\\/]*)
|
||||||
|
ac_cv_path_DSYMUTIL="$DSYMUTIL" # Let the user override the test with a path.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||||
|
for as_dir in $PATH
|
||||||
|
do
|
||||||
|
IFS=$as_save_IFS
|
||||||
|
test -z "$as_dir" && as_dir=.
|
||||||
|
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||||
|
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||||
|
ac_cv_path_DSYMUTIL="$as_dir/$ac_word$ac_exec_ext"
|
||||||
|
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
IFS=$as_save_IFS
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
DSYMUTIL=$ac_cv_path_DSYMUTIL
|
||||||
|
if test -n "$DSYMUTIL"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
|
||||||
|
$as_echo "$DSYMUTIL" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
test -n "$DSYMUTIL" && break
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if test "x$DSYMUTIL" = x; then
|
||||||
|
if test "xdsymutil" = x; then
|
||||||
|
PROG_NAME=dsymutil
|
||||||
|
else
|
||||||
|
PROG_NAME=dsymutil
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
|
||||||
|
$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
|
||||||
|
as_fn_error $? "Cannot continue" "$LINENO" 5
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -29549,11 +29608,11 @@ if test "x$enable_debug_symbols" = "xyes"; then
|
||||||
elif test "x$enable_debug_symbols" = "xno"; then
|
elif test "x$enable_debug_symbols" = "xno"; then
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
ENABLE_DEBUG_SYMBOLS=false
|
||||||
else
|
else
|
||||||
# default on macosx is false
|
# Default is on if objcopy is found
|
||||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
if test "x$OBJCOPY" != x; then
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
ENABLE_DEBUG_SYMBOLS=true
|
||||||
# Default is on if objcopy is found, otherwise off
|
# MacOS X and Windows don't use objcopy but default is on for those OSes
|
||||||
elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then
|
elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||||
ENABLE_DEBUG_SYMBOLS=true
|
ENABLE_DEBUG_SYMBOLS=true
|
||||||
else
|
else
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
ENABLE_DEBUG_SYMBOLS=false
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -123,8 +123,7 @@ endif
|
||||||
# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false.
|
# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false.
|
||||||
ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue)
|
ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue)
|
||||||
ZIP_DEBUGINFO_FILES:=1
|
ZIP_DEBUGINFO_FILES:=1
|
||||||
endif
|
else
|
||||||
ifeq ($(ZIP_DEBUGINFO_FILES), false)
|
|
||||||
ZIP_DEBUGINFO_FILES:=0
|
ZIP_DEBUGINFO_FILES:=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -518,11 +518,11 @@ if test "x$enable_debug_symbols" = "xyes"; then
|
||||||
elif test "x$enable_debug_symbols" = "xno"; then
|
elif test "x$enable_debug_symbols" = "xno"; then
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
ENABLE_DEBUG_SYMBOLS=false
|
||||||
else
|
else
|
||||||
# default on macosx is false
|
# Default is on if objcopy is found
|
||||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
if test "x$OBJCOPY" != x; then
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
ENABLE_DEBUG_SYMBOLS=true
|
||||||
# Default is on if objcopy is found, otherwise off
|
# MacOS X and Windows don't use objcopy but default is on for those OSes
|
||||||
elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then
|
elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||||
ENABLE_DEBUG_SYMBOLS=true
|
ENABLE_DEBUG_SYMBOLS=true
|
||||||
else
|
else
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
ENABLE_DEBUG_SYMBOLS=false
|
||||||
|
|
|
@ -485,6 +485,7 @@ CUT:=@CUT@
|
||||||
DATE:=@DATE@
|
DATE:=@DATE@
|
||||||
DIFF:=@DIFF@
|
DIFF:=@DIFF@
|
||||||
DIRNAME:=@DIRNAME@
|
DIRNAME:=@DIRNAME@
|
||||||
|
DSYMUTIL:=@DSYMUTIL@
|
||||||
FIND:=@FIND@
|
FIND:=@FIND@
|
||||||
FIND_DELETE:=@FIND_DELETE@
|
FIND_DELETE:=@FIND_DELETE@
|
||||||
ECHO:=@ECHO@
|
ECHO:=@ECHO@
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -435,31 +435,36 @@ define SetupNativeCompilation
|
||||||
$(CP) $$< $$@
|
$(CP) $$< $$@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X
|
||||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows
|
||||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||||
# An empty section header has sh_addr == 0 and sh_size == 0.
|
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||||
# This problem has only been seen on Solaris X64, but we call this tool
|
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||||
# on all Solaris builds just in case.
|
# An empty section header has sh_addr == 0 and sh_size == 0.
|
||||||
#
|
# This problem has only been seen on Solaris X64, but we call this tool
|
||||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
# on all Solaris builds just in case.
|
||||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
#
|
||||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
|
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||||
$(RM) $$@
|
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
|
||||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
|
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
$(RM) $$@
|
||||||
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
|
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
|
||||||
else # not solaris
|
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
|
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
|
||||||
$(RM) $$@
|
else # not solaris
|
||||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
|
||||||
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
$(RM) $$@
|
||||||
endif # Touch to not retrigger rule on rebuild
|
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||||
|
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
||||||
|
endif # Touch to not retrigger rule on rebuild
|
||||||
$(TOUCH) $$@
|
$(TOUCH) $$@
|
||||||
|
endif # !windows
|
||||||
|
endif # !macosx
|
||||||
|
|
||||||
ifeq ($(ZIP_DEBUGINFO_FILES), true)
|
ifeq ($(ZIP_DEBUGINFO_FILES), true)
|
||||||
|
ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
|
||||||
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz
|
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
|
@ -472,11 +477,12 @@ define SetupNativeCompilation
|
||||||
$(CD) $$($1_OBJECT_DIR) \
|
$(CD) $$($1_OBJECT_DIR) \
|
||||||
&& $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
&& $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||||
endif
|
endif
|
||||||
|
endif # no MacOS X support yet
|
||||||
else
|
else
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
$1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \
|
$1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \
|
||||||
$$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb
|
$$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb
|
||||||
else
|
else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
|
||||||
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -513,31 +519,36 @@ define SetupNativeCompilation
|
||||||
$(CP) $$< $$@
|
$(CP) $$< $$@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X
|
||||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows
|
||||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||||
# An empty section header has sh_addr == 0 and sh_size == 0.
|
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||||
# This problem has only been seen on Solaris X64, but we call this tool
|
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||||
# on all Solaris builds just in case.
|
# An empty section header has sh_addr == 0 and sh_size == 0.
|
||||||
#
|
# This problem has only been seen on Solaris X64, but we call this tool
|
||||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
# on all Solaris builds just in case.
|
||||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
#
|
||||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
|
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||||
$(RM) $$@
|
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
|
||||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
|
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
$(RM) $$@
|
||||||
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
|
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
|
||||||
else # not solaris
|
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
|
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
|
||||||
$(RM) $$@
|
else # not solaris
|
||||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
|
||||||
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
$(RM) $$@
|
||||||
endif
|
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||||
$(TOUCH) $$@
|
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
||||||
|
endif
|
||||||
|
$(TOUCH) $$@
|
||||||
|
endif # !windows
|
||||||
|
endif # !macosx
|
||||||
|
|
||||||
ifeq ($(ZIP_DEBUGINFO_FILES), true)
|
ifeq ($(ZIP_DEBUGINFO_FILES), true)
|
||||||
|
ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
|
||||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
|
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
|
@ -550,11 +561,12 @@ define SetupNativeCompilation
|
||||||
$(CD) $$($1_OBJECT_DIR) \
|
$(CD) $$($1_OBJECT_DIR) \
|
||||||
&& $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo
|
&& $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo
|
||||||
endif
|
endif
|
||||||
|
endif # no MacOS X support yet
|
||||||
else
|
else
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \
|
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \
|
||||||
$$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb
|
$$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb
|
||||||
else
|
else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
|
||||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo
|
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue