changeset 2545:381d5f4a839e jdk8u302-b04

8265666: Enable AIX build platform to make external debug symbols Reviewed-by: phh
author aleonard
date Wed, 12 May 2021 11:32:51 +0100
parents 978958987e3b
children 14f5c4deb6d9
files common/autoconf/generated-configure.sh common/autoconf/jdk-options.m4 make/common/NativeCompilation.gmk
diffstat 3 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/generated-configure.sh	Mon May 17 05:47:03 2021 +0100
+++ b/common/autoconf/generated-configure.sh	Wed May 12 11:32:51 2021 +0100
@@ -3927,7 +3927,7 @@
 
 
 #
-# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -4394,7 +4394,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1620850472
+DATE_WHEN_GENERATED=1621590864
 
 ###############################################################################
 #
@@ -42534,8 +42534,8 @@
     # Default is on if objcopy is found
     if test "x$OBJCOPY" != x; then
       ENABLE_DEBUG_SYMBOLS=true
-    # MacOS X and Windows don't use objcopy but default is on for those OSes
-    elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
+    # AIX, MacOS X and Windows don't use objcopy but default is on for those OSes
+    elif test "x$OPENJDK_TARGET_OS" = xaix || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
       ENABLE_DEBUG_SYMBOLS=true
     else
       ENABLE_DEBUG_SYMBOLS=false
@@ -42581,11 +42581,6 @@
 # Check whether --with-native-debug-symbols was given.
 if test "${with_native_debug_symbols+set}" = set; then :
   withval=$with_native_debug_symbols;
-        if test "x$OPENJDK_TARGET_OS" = xaix; then
-          if test "x$with_native_debug_symbols" = xexternal || test "x$with_native_debug_symbols" = xzipped; then
-            as_fn_error $? "AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols" "$LINENO" 5
-          fi
-        fi
 
 else
 
--- a/common/autoconf/jdk-options.m4	Mon May 17 05:47:03 2021 +0100
+++ b/common/autoconf/jdk-options.m4	Wed May 12 11:32:51 2021 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -659,8 +659,8 @@
     # Default is on if objcopy is found
     if test "x$OBJCOPY" != x; then
       ENABLE_DEBUG_SYMBOLS=true
-    # MacOS X and Windows don't use objcopy but default is on for those OSes
-    elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
+    # AIX, MacOS X and Windows don't use objcopy but default is on for those OSes
+    elif test "x$OPENJDK_TARGET_OS" = xaix || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
       ENABLE_DEBUG_SYMBOLS=true
     else
       ENABLE_DEBUG_SYMBOLS=false
@@ -698,11 +698,6 @@
       [AS_HELP_STRING([--with-native-debug-symbols],
       [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
       [
-        if test "x$OPENJDK_TARGET_OS" = xaix; then
-          if test "x$with_native_debug_symbols" = xexternal || test "x$with_native_debug_symbols" = xzipped; then
-            AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
-          fi
-        fi
       ],
       [
         # Default to unset for backwards compatibility
--- a/make/common/NativeCompilation.gmk	Mon May 17 05:47:03 2021 +0100
+++ b/make/common/NativeCompilation.gmk	Wed May 12 11:32:51 2021 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -501,6 +501,17 @@
 		$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
 		$(TOUCH) $$@
           endif
+        else ifeq ($(OPENJDK_TARGET_OS), aix)
+            ifneq ($$($1_STRIP_POLICY), no_strip)
+              # AIX does not provide the equivalent of OBJCOPY to extract debug symbols,
+              # so we copy the compiled object with symbols to the .debuginfo file, which
+              # happens prior to the STRIP on the original target object file.
+              $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
+              $$($1_DEBUGINFO_FILES): $$($1_TARGET)
+		$(RM) $$@
+		$(CP) $$< $$@
+		$(TOUCH) $$@
+            endif
         else ifeq ($(OPENJDK_TARGET_OS), macosx)
           ifneq ($$($1_STRIP_POLICY), no_strip)
             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \