# HG changeset patch
# User andrew
# Date 1452532602 0
#      Mon Jan 11 17:16:42 2016 +0000
# Node ID be477dd4629d2155bde02047cc81ca4f8b657a49
# Parent  e04f994581e23e89757774cd2033413bc650a831
PR1368: Ensure debug data is available for all libraries and binaries without redundant files

diff -Nru openjdk.orig/hotspot/make/aix/makefiles/defs.make openjdk/hotspot/make/aix/makefiles/defs.make
--- openjdk.orig/hotspot/make/aix/makefiles/defs.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/aix/makefiles/defs.make	2021-07-27 17:09:32.885923277 +0100
@@ -178,10 +178,12 @@
 # client and server subdirectories have symbolic links to ../libjsig.so
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-  ifeq ($(ZIP_DEBUGINFO_FILES),1)
-    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
-  else
-    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
+  ifneq ($(STRIP_POLICY),no_strip)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
+    else
+      EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
+    endif
   endif
 endif
 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
@@ -192,10 +194,12 @@
   EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-    ifeq ($(ZIP_DEBUGINFO_FILES),1)
-      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
-    else
-      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
+    ifneq ($(STRIP_POLICY),no_strip)
+      ifeq ($(ZIP_DEBUGINFO_FILES),1)
+        EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
+      else
+        EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
+      endif
     endif
   endif
 endif
@@ -204,10 +208,12 @@
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-    ifeq ($(ZIP_DEBUGINFO_FILES),1)
-      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
-    else
-      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
+    ifneq ($(STRIP_POLICY),no_strip)
+      ifeq ($(ZIP_DEBUGINFO_FILES),1)
+        EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
+      else
+        EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
+      endif
     endif
   endif
 endif
diff -Nru openjdk.orig/hotspot/make/aix/makefiles/jsig.make openjdk/hotspot/make/aix/makefiles/jsig.make
--- openjdk.orig/hotspot/make/aix/makefiles/jsig.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/aix/makefiles/jsig.make	2021-07-27 17:10:45.750714134 +0100
@@ -66,6 +66,7 @@
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   # AIX produces .debuginfo from copy of -g compiled object prior to strip
+  ifneq ($(STRIP_POLICY),no_strip)
 	$(QUIETLY) $(CP) $@ $(LIBJSIG_DEBUGINFO)
 #  ifeq ($(STRIP_POLICY),all_strip)
 #	$(QUIETLY) $(STRIP) $@
@@ -75,7 +76,6 @@
 #    # implied else here is no stripping at all
 #    endif
 #  endif
-  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
 	$(RM) $(LIBJSIG_DEBUGINFO)
diff -Nru openjdk.orig/hotspot/make/aix/makefiles/saproc.make openjdk/hotspot/make/aix/makefiles/saproc.make
--- openjdk.orig/hotspot/make/aix/makefiles/saproc.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/aix/makefiles/saproc.make	2021-07-27 17:11:30.513199985 +0100
@@ -89,6 +89,7 @@
 	           -lthread_db
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   # AIX produces .debuginfo from copy of -g compiled object prior to strip
+  ifneq ($(STRIP_POLICY),no_strip)
 	$(QUIETLY) $(CP) $@ $(LIBJSIG_DEBUGINFO)
 #  ifeq ($(STRIP_POLICY),all_strip)
 #	$(QUIETLY) $(STRIP) $@
@@ -98,9 +99,10 @@
 #    # implied else here is no stripping at all
 #    endif
 #  endif
-  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
 	$(RM) $(LIBSAPROC_DEBUGINFO)
+    endif
   endif
 endif
 
diff -Nru openjdk.orig/hotspot/make/aix/makefiles/vm.make openjdk/hotspot/make/aix/makefiles/vm.make
--- openjdk.orig/hotspot/make/aix/makefiles/vm.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/aix/makefiles/vm.make	2021-07-27 17:12:41.222967440 +0100
@@ -331,6 +331,7 @@
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   # AIX produces .debuginfo from copy of -g compiled object prior to strip
+    ifneq ($(STRIP_POLICY),no_strip)
 	$(QUIETLY) $(CP) $@ $(LIBJVM_DEBUGINFO)
 #    ifeq ($(STRIP_POLICY),all_strip)
 #	$(QUIETLY) $(STRIP) $@
@@ -340,7 +341,6 @@
 #      # implied else here is no stripping at all
 #      endif
 #    endif
-    ifneq ($(STRIP_POLICY),no_strip)
       ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
 	$(RM) $(LIBJVM_DEBUGINFO)
diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/defs.make openjdk/hotspot/make/bsd/makefiles/defs.make
--- openjdk.orig/hotspot/make/bsd/makefiles/defs.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/bsd/makefiles/defs.make	2021-07-27 17:07:31.922610365 +0100
@@ -269,6 +269,7 @@
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
       EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
   else
@@ -279,6 +280,7 @@
     endif
   endif
 endif
+endif
 
 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
@@ -289,6 +291,7 @@
   EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
 
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
         EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
     else
@@ -299,6 +302,7 @@
       endif
     endif
   endif
+  endif
 endif
 
 ifeq ($(JVM_VARIANT_CLIENT),true)
@@ -306,6 +310,7 @@
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
 
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
         EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
     else
@@ -316,6 +321,7 @@
       endif
     endif
   endif
+  endif
 endif
 
 ifeq ($(JVM_VARIANT_MINIMAL1),true)
@@ -329,6 +335,7 @@
                         $(EXPORT_LIB_DIR)/sa-jdi.jar
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
       ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
   else
@@ -346,6 +353,7 @@
                             $(EXPORT_LIB_DIR)/sa-jdi.jar
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
       ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
   else
@@ -356,6 +364,7 @@
     endif
   endif
 endif
+endif
 
 ADD_SA_BINARIES/ppc   =
 ADD_SA_BINARIES/ia64  =
@@ -398,6 +407,7 @@
     UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/Xusage.txt
     UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/Xusage.txt
     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifneq ($(STRIP_POLICY),no_strip)
       ifeq ($(ZIP_DEBUGINFO_FILES),1)
           UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.diz
           UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.diz
@@ -410,6 +420,7 @@
           UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
       endif
     endif
+    endif
 
   endif
 endif
diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/jsig.make openjdk/hotspot/make/bsd/makefiles/jsig.make
--- openjdk.orig/hotspot/make/bsd/makefiles/jsig.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/bsd/makefiles/jsig.make	2021-07-27 17:07:31.923610376 +0100
@@ -74,6 +74,7 @@
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
                          $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(JSIG_OPT_FLAGS) $(EXTRA_CFLAGS) -o $@ $<
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(OS_VENDOR), Darwin)
 	$(DSYMUTIL) $@
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
@@ -97,6 +98,7 @@
     endif
   endif
 endif
+endif
 
 install_jsig: $(LIBJSIG)
 	@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/saproc.make openjdk/hotspot/make/bsd/makefiles/saproc.make
--- openjdk.orig/hotspot/make/bsd/makefiles/saproc.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/bsd/makefiles/saproc.make	2021-07-27 17:07:31.923610376 +0100
@@ -139,6 +139,7 @@
 	           -o $@                                                \
 	           $(SALIBS)
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(OS_VENDOR), Darwin)
 	$(DSYMUTIL) $@
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
@@ -162,6 +163,7 @@
     endif
   endif
 endif
+endif
 
 install_saproc: $(BUILDLIBSAPROC)
 	@echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"
diff -Nru openjdk.orig/hotspot/make/bsd/makefiles/vm.make openjdk/hotspot/make/bsd/makefiles/vm.make
--- openjdk.orig/hotspot/make/bsd/makefiles/vm.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/bsd/makefiles/vm.make	2021-07-27 17:07:31.923610376 +0100
@@ -341,6 +341,7 @@
 	}
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(OS_VENDOR), Darwin)
 	$(DSYMUTIL) $@
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
@@ -364,6 +365,7 @@
     endif
   endif
 endif
+endif
 
 DEST_SUBDIR        = $(JDK_LIBDIR)/$(VM_SUBDIR)
 DEST_JVM           = $(DEST_SUBDIR)/$(LIBJVM)
diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/defs.make openjdk/hotspot/make/solaris/makefiles/defs.make
--- openjdk.orig/hotspot/make/solaris/makefiles/defs.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/solaris/makefiles/defs.make	2021-07-27 17:07:31.923610376 +0100
@@ -226,12 +226,14 @@
 # client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX)
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
   else
     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
   endif
 endif
+endif
 
 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
@@ -246,6 +248,7 @@
     EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
   endif
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
       EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
       EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.diz
@@ -264,6 +267,7 @@
       endif
     endif
   endif
+  endif
 endif
 ifeq ($(JVM_VARIANT_CLIENT),true)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
@@ -275,6 +279,7 @@
     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
   endif
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.diz
@@ -293,10 +298,12 @@
       endif
     endif
   endif
+  endif
 endif
 
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
   else
diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/jsig.make openjdk/hotspot/make/solaris/makefiles/jsig.make
--- openjdk.orig/hotspot/make/solaris/makefiles/jsig.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/solaris/makefiles/jsig.make	2021-07-27 17:07:31.923610376 +0100
@@ -57,8 +57,10 @@
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
                          $(LFLAGS_JSIG) $(JSIG_OPT_FLAGS) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
+  endif
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -67,10 +69,12 @@
     # implied else here is no stripping at all
     endif
   endif
+  ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
 	$(RM) $(LIBJSIG_DEBUGINFO)
   endif
+  endif
 endif
 
 install_jsig: $(LIBJSIG)
diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/saproc.make openjdk/hotspot/make/solaris/makefiles/saproc.make
--- openjdk.orig/hotspot/make/solaris/makefiles/saproc.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/solaris/makefiles/saproc.make	2021-07-27 17:07:31.923610376 +0100
@@ -121,8 +121,10 @@
 	           -c -o $(SADISOBJ)
 	
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
+  endif
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -132,8 +134,10 @@
     endif
   endif
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    ifneq ($(STRIP_POLICY),no_strip)
 	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
 	$(RM) $(LIBSAPROC_DEBUGINFO)
+    endif
   endif
 endif
 
diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/vm.make openjdk/hotspot/make/solaris/makefiles/vm.make
--- openjdk.orig/hotspot/make/solaris/makefiles/vm.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/solaris/makefiles/vm.make	2021-07-27 17:07:31.924610387 +0100
@@ -299,8 +299,10 @@
 	$(QUIETLY) $(LINK_LIB.CXX/POST_HOOK)
 	$(QUIETLY) rm -f $@.1 && ln -s $@ $@.1
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
+  endif
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -309,10 +311,12 @@
     # implied else here is no stripping at all
     endif
   endif
+  ifneq ($(STRIP_POLICY),no_strip)
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
 	$(RM) $(LIBJVM_DEBUGINFO)
   endif
+  endif
 endif
 endif # filter -sbfast -xsbfast
 
diff -Nru openjdk.orig/hotspot/make/windows/makefiles/debug.make openjdk/hotspot/make/windows/makefiles/debug.make
--- openjdk.orig/hotspot/make/windows/makefiles/debug.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/windows/makefiles/debug.make	2021-07-27 17:07:31.924610387 +0100
@@ -60,11 +60,13 @@
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(STRIP_POLICY)" != "no_strip"
 !if "$(ZIP_DEBUGINFO_FILES)" == "1"
 	$(ZIPEXE) -q $*.diz $*.map $*.pdb
 	$(RM) $*.map $*.pdb
 !endif
 !endif
+!endif
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
diff -Nru openjdk.orig/hotspot/make/windows/makefiles/defs.make openjdk/hotspot/make/windows/makefiles/defs.make
--- openjdk.orig/hotspot/make/windows/makefiles/defs.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/windows/makefiles/defs.make	2021-07-27 17:07:31.924610387 +0100
@@ -262,6 +262,7 @@
   EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX)
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.diz
     else
@@ -269,11 +270,13 @@
       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
     endif
   endif
+  endif
 endif
 ifeq ($(JVM_VARIANT_CLIENT),true)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX)
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.diz
     else
@@ -281,6 +284,7 @@
       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
     endif
   endif
+  endif
 endif
 
 EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
@@ -288,6 +292,7 @@
 ifeq ($(BUILD_WIN_SA), 1)
   EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX)
   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifneq ($(STRIP_POLICY),no_strip)
     ifeq ($(ZIP_DEBUGINFO_FILES),1)
       EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.diz
     else
@@ -295,6 +300,7 @@
       EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map
     endif
   endif
+  endif
   EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
   # Must pass this down to nmake.
   MAKE_ARGS += BUILD_WIN_SA=1
diff -Nru openjdk.orig/hotspot/make/windows/makefiles/fastdebug.make openjdk/hotspot/make/windows/makefiles/fastdebug.make
--- openjdk.orig/hotspot/make/windows/makefiles/fastdebug.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/windows/makefiles/fastdebug.make	2021-07-27 17:07:31.924610387 +0100
@@ -59,11 +59,13 @@
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(STRIP_POLICY)" != "no_strip"
 !if "$(ZIP_DEBUGINFO_FILES)" == "1"
 	$(ZIPEXE) -q $*.diz $*.map $*.pdb
 	$(RM) $*.map $*.pdb
 !endif
 !endif
+!endif
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
diff -Nru openjdk.orig/hotspot/make/windows/makefiles/product.make openjdk/hotspot/make/windows/makefiles/product.make
--- openjdk.orig/hotspot/make/windows/makefiles/product.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/windows/makefiles/product.make	2021-07-27 17:07:31.924610387 +0100
@@ -62,11 +62,13 @@
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(STRIP_POLICY)" != "no_strip"
 !if "$(ZIP_DEBUGINFO_FILES)" == "1"
 	$(ZIPEXE) -q $*.diz $*.map $*.pdb
 	$(RM) $*.map $*.pdb
 !endif
 !endif
+!endif
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
diff -Nru openjdk.orig/hotspot/make/windows/makefiles/sa.make openjdk/hotspot/make/windows/makefiles/sa.make
--- openjdk.orig/hotspot/make/windows/makefiles/sa.make	2021-07-16 05:52:52.000000000 +0100
+++ openjdk/hotspot/make/windows/makefiles/sa.make	2021-07-27 17:07:31.924610387 +0100
@@ -165,11 +165,13 @@
 	$(MT) -manifest $(@F).manifest -outputresource:$(@F);#2
 !endif
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(STRIP_POLICY)" != "no_strip"
 !if "$(ZIP_DEBUGINFO_FILES)" == "1"
 	$(ZIPEXE) -q $*.diz $*.map $*.pdb
 	$(RM) $*.map $*.pdb
 !endif
 !endif
+!endif
 	-@rm -f $*.obj
 
 cleanall :
