mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8064808: Disable use of broken objcopy on Solaris, remove adhoc helper tools
Reviewed-by: erikj
This commit is contained in:
parent
4ce6bdb54e
commit
d50c38edf7
@ -4364,7 +4364,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1435822080
|
||||
DATE_WHEN_GENERATED=1441958217
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -38307,6 +38307,48 @@ $as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;}
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
# objcopy prior to 2.21.1 on solaris is broken and is not usable.
|
||||
# Rewrite objcopy version output to VALID_VERSION or BAD_VERSION.
|
||||
# - version number is last blank separate word on first line
|
||||
# - version number formats that have been seen:
|
||||
# - <major>.<minor>
|
||||
# - <major>.<minor>.<micro>
|
||||
OBJCOPY_VERSION=`$OBJCOPY --version | $HEAD -n 1`
|
||||
# The outer [ ] is to prevent m4 from eating the [] in the sed expression.
|
||||
OBJCOPY_VERSION_CHECK=`$ECHO $OBJCOPY_VERSION | $SED -n \
|
||||
-e 's/.* //' \
|
||||
-e '/^[01]\./b bad' \
|
||||
-e '/^2\./{' \
|
||||
-e ' s/^2\.//' \
|
||||
-e ' /^[0-9]$/b bad' \
|
||||
-e ' /^[0-9]\./b bad' \
|
||||
-e ' /^1[0-9]$/b bad' \
|
||||
-e ' /^1[0-9]\./b bad' \
|
||||
-e ' /^20\./b bad' \
|
||||
-e ' /^21\.0$/b bad' \
|
||||
-e ' /^21\.0\./b bad' \
|
||||
-e '}' \
|
||||
-e ':good' \
|
||||
-e 's/.*/VALID_VERSION/p' \
|
||||
-e 'q' \
|
||||
-e ':bad' \
|
||||
-e 's/.*/BAD_VERSION/p' \
|
||||
-e 'q'`
|
||||
if test "x$OBJCOPY_VERSION_CHECK" = xBAD_VERSION; then
|
||||
OBJCOPY=
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated." >&5
|
||||
$as_echo "$as_me: WARNING: Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated." >&2;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: objcopy reports version $OBJCOPY_VERSION" >&5
|
||||
$as_echo "$as_me: objcopy reports version $OBJCOPY_VERSION" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version" >&5
|
||||
$as_echo "$as_me: Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version" >&5
|
||||
$as_echo "$as_me: Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Note: Solaris 11 Update 1 contains the correct version" >&5
|
||||
$as_echo "$as_me: Note: Solaris 11 Update 1 contains the correct version" >&6;}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -586,6 +586,43 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
# Only call fixup if objcopy was found.
|
||||
if test -n "$OBJCOPY"; then
|
||||
BASIC_FIXUP_EXECUTABLE(OBJCOPY)
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
# objcopy prior to 2.21.1 on solaris is broken and is not usable.
|
||||
# Rewrite objcopy version output to VALID_VERSION or BAD_VERSION.
|
||||
# - version number is last blank separate word on first line
|
||||
# - version number formats that have been seen:
|
||||
# - <major>.<minor>
|
||||
# - <major>.<minor>.<micro>
|
||||
OBJCOPY_VERSION=`$OBJCOPY --version | $HEAD -n 1`
|
||||
# The outer [ ] is to prevent m4 from eating the [] in the sed expression.
|
||||
[ OBJCOPY_VERSION_CHECK=`$ECHO $OBJCOPY_VERSION | $SED -n \
|
||||
-e 's/.* //' \
|
||||
-e '/^[01]\./b bad' \
|
||||
-e '/^2\./{' \
|
||||
-e ' s/^2\.//' \
|
||||
-e ' /^[0-9]$/b bad' \
|
||||
-e ' /^[0-9]\./b bad' \
|
||||
-e ' /^1[0-9]$/b bad' \
|
||||
-e ' /^1[0-9]\./b bad' \
|
||||
-e ' /^20\./b bad' \
|
||||
-e ' /^21\.0$/b bad' \
|
||||
-e ' /^21\.0\./b bad' \
|
||||
-e '}' \
|
||||
-e ':good' \
|
||||
-e 's/.*/VALID_VERSION/p' \
|
||||
-e 'q' \
|
||||
-e ':bad' \
|
||||
-e 's/.*/BAD_VERSION/p' \
|
||||
-e 'q'` ]
|
||||
if test "x$OBJCOPY_VERSION_CHECK" = xBAD_VERSION; then
|
||||
OBJCOPY=
|
||||
AC_MSG_WARN([Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated.])
|
||||
AC_MSG_NOTICE([objcopy reports version $OBJCOPY_VERSION])
|
||||
AC_MSG_NOTICE([Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version])
|
||||
AC_MSG_NOTICE([Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version])
|
||||
AC_MSG_NOTICE([Note: Solaris 11 Update 1 contains the correct version])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -624,28 +624,7 @@ define SetupNativeCompilationBody
|
||||
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
|
||||
|
||||
else ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
# Setup the command line creating debuginfo files, to be run after linking.
|
||||
# It cannot be run separately since it updates the original target file
|
||||
#
|
||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||
# 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
|
||||
# on all Solaris builds just in case.
|
||||
#
|
||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||
$1_CREATE_DEBUGINFO_CMDS := \
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$($1_TARGET) $$(NEWLINE) \
|
||||
$(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
|
||||
$(CD) $$($1_OUTPUT_DIR) && \
|
||||
$(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
$1_DEBUGINFO_EXTRA_DEPS := $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||
|
||||
else ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
|
||||
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
|
||||
# Setup the command line creating debuginfo files, to be run after linking.
|
||||
# It cannot be run separately since it updates the original target file
|
||||
@ -653,7 +632,6 @@ define SetupNativeCompilationBody
|
||||
$(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
|
||||
$(CD) $$($1_OUTPUT_DIR) && \
|
||||
$(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
|
||||
endif # No MacOS X support
|
||||
|
||||
# This dependency dance ensures that debug info files get rebuilt
|
||||
@ -694,7 +672,7 @@ define SetupNativeCompilationBody
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
|
||||
$$($1_DEBUGINFO_EXTRA_DEPS) $$($1_VARDEPS_FILE)
|
||||
$$($1_VARDEPS_FILE)
|
||||
$(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)"
|
||||
$(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
|
||||
@ -735,7 +713,7 @@ define SetupNativeCompilationBody
|
||||
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
|
||||
|
||||
$$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \
|
||||
$$($1_DEBUGINFO_EXTRA_DEPS) $$($1_VARDEPS_FILE)
|
||||
$$($1_VARDEPS_FILE)
|
||||
$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)"
|
||||
$(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
|
||||
|
||||
@ -32,8 +32,6 @@ endif
|
||||
|
||||
|
||||
include NativeCompilation.gmk
|
||||
# FIXME: This is a bad fix currently needed due to JDK-8064808 not being resolved.
|
||||
include $(JDK_TOPDIR)/make/Tools.gmk
|
||||
|
||||
# Setup make rules for creating a set of native test files (libraries or
|
||||
# executables). This will locate native files matching a certain pattern,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user