6954064: Fix the windows arch settings in the makefiles and chmod logic in test/Makefile
authorohair
Thu, 20 May 2010 13:57:58 -0700
changeset 5611 b4ef86f105ec
parent 5610 fd2427610c7f
child 5612 c0d1673e1ca6
6954064: Fix the windows arch settings in the makefiles and chmod logic in test/Makefile Reviewed-by: wetmore
jdk/make/common/shared/Platform.gmk
jdk/test/Makefile
jdk/test/ProblemList.txt
--- a/jdk/make/common/shared/Platform.gmk	Tue May 18 15:36:47 2010 -0700
+++ b/jdk/make/common/shared/Platform.gmk	Thu May 20 13:57:58 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 1997-2010 Sun Microsystems, Inc.  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
@@ -231,15 +231,35 @@
   # Temporary disk area
   TEMP_DISK=C:/temp
   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
-  # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
-  PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
-  PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
-  PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
+  #  return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
+  #  And sometimes PROCESSOR_IDENTIFIER is not defined at all
+  #  (in some restricted shells), so we use uname if we have to.
+  ifeq ($(PROCESSOR_IDENTIFIER),)
+    PROC_ARCH:=$(shell uname -m)
+  else
+    PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
+  endif
+  # Cover all the possibilities, MKS uname, CYGWIN uname, PROCESSOR_IDENTIFIER
+  #    Get: X86, X64, or IA64
+  PROC_ARCH:=$(patsubst 386,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 486,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 586,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 686,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i386,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i486,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i586,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i686,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst x86,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst intel64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst Intel64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst INTEL64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst em64t,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst EM64T,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst amd64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst AMD64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 8664,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst x86_64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst ia64,IA64,$(PROC_ARCH))
   ifndef ARCH_DATA_MODEL
     ifeq ($(PROC_ARCH),IA64)
       ARCH_DATA_MODEL=64
--- a/jdk/test/Makefile	Tue May 18 15:36:47 2010 -0700
+++ b/jdk/test/Makefile	Thu May 20 13:57:58 2010 -0700
@@ -79,21 +79,25 @@
   endif
   OS_VERSION := $(shell $(UNAME) -r)
 endif
-ifndef OS_NAME
-  ifneq ($(PROCESSOR_IDENTIFIER), )
-    OS_NAME = windows
-    SLASH_JAVA = J:
-    # A variety of ways to say X64 arch :^(
-    OS_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
-    EXESUFFIX = .exe
-    # These need to be different depending on MKS or CYGWIN
-    ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
-      GETMIXEDPATH  = dosname -s
-      OS_VERSION   := $(shell $(UNAME) -r)
-    else
-      GETMIXEDPATH  = cygpath -m -s
-      OS_VERSION   := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
-    endif
+ifeq ($(OS_NAME),)
+  OS_NAME = windows
+  # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
+  # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
+  ifeq ($(PROCESSOR_IDENTIFIER),)
+    PROC_ARCH:=$(shell $(UNAME) -m)
+  else
+    PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
+  endif
+  OS_ARCH:=$(PROC_ARCH)
+  SLASH_JAVA = J:
+  EXESUFFIX = .exe
+  # These need to be different depending on MKS or CYGWIN
+  ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
+    GETMIXEDPATH  = dosname -s
+    OS_VERSION   := $(shell $(UNAME) -r)
+  else
+    GETMIXEDPATH  = cygpath -m -s
+    OS_VERSION   := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
   endif
 endif
 
@@ -110,22 +114,27 @@
 #OS_ARCH2-x64:=amd64
 
 # Try and use the arch names consistently
-OS_ARCH:=$(subst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH))
-OS_ARCH:=$(subst X86,i586,$(OS_ARCH))
-OS_ARCH:=$(subst x86,i586,$(OS_ARCH))
-OS_ARCH:=$(subst i386,i586,$(OS_ARCH))
-OS_ARCH:=$(subst i486,i586,$(OS_ARCH))
-OS_ARCH:=$(subst i686,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
+OS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
 
 # Default  ARCH_DATA_MODEL settings
 ARCH_DATA_MODEL-i586 = 32
@@ -237,33 +246,9 @@
   endif
 endif
 
-# Temp file to hold list of shared library files possibly needing execute 
-#   permissions at runtime. 
-SHARED_LIBRARY_LIST=$(ABS_TEST_OUTPUT_DIR)/shared_libraries.txt
-
-# Macro that may change execute permissions on library files and check for them.
-#  Files in repositories should not really have execute permissions, however
-#  windows dll files require execute permission. Adding execute permission
-#  may happen automatically on windows when using certain versions of mercurial
-#  but it cannot be guaranteed. And blindly adding execute permission might
-#  be seen as a mercurial 'change', so we avoid adding execute permission to
-#  repository files. Testing from a plain source tree may need the chmod a+x.
-#  Used on select directories.
-define CheckLibraryExecutePermissions # dir
-$(MKDIR) -p `$(DIRNAME) $(SHARED_LIBRARY_LIST)`
-$(RM) $(SHARED_LIBRARY_LIST)
-$(FIND) $1 -name \*.dll -o -name \*.DLL -o -name \*.so > $(SHARED_LIBRARY_LIST)
-if [ -s $(SHARED_LIBRARY_LIST) -a ! -d $(TEST_ROOT)/../.hg ] ; then    \
-  $(ECHO) "$(CHMOD) a+x `$(CAT) $(SHARED_LIBRARY_LIST)`";              \
-  $(CHMOD) a+x `$(CAT) $(SHARED_LIBRARY_LIST)`;                        \
-fi
-if [ -s $(SHARED_LIBRARY_LIST) ] ; then                                \
-  for i in `$(CAT) $(SHARED_LIBRARY_LIST)` ; do                        \
-    if [ ! -x $${i} ] ; then                                           \
-      $(ECHO) "WARNING: File does not have execute permission: $${i}"; \
-    fi;                                                                \
-  done;                                                                \
-fi
+# Macro to run make and set the shared library permissions
+define SharedLibraryPermissions
+$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
 endef
 
 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
@@ -515,7 +500,7 @@
 JDK_ALL_TARGETS += jdk_nio2
 jdk_nio2: java/nio/Buffer java/nio/ByteOrder \
           java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer
-	$(call CheckLibraryExecutePermissions,java/nio/channels)
+	$(call SharedLibraryPermissions,java/nio/channels)
 	$(call RunOthervmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
@@ -549,7 +534,7 @@
 #   Using samevm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_security3
 jdk_security3: com/sun/security lib/security javax/security sun/security
-	$(call CheckLibraryExecutePermissions,sun/security)
+	$(call SharedLibraryPermissions,sun/security)
 	$(call RunOthervmBatch)
 
 # All security tests
@@ -576,7 +561,7 @@
 #   Using samevm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_tools2
 jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing
-	$(call CheckLibraryExecutePermissions,tools/launcher)
+	$(call SharedLibraryPermissions,tools/launcher)
 	$(call RunOthervmBatch)
 
 # All tools tests
@@ -646,7 +631,26 @@
 	  ) ; $(BUNDLE_UP_AND_EXIT)                                          \
 	) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
 
-PHONY_LIST += jtreg_tests
+# Rule that may change execute permissions on shared library files.
+#  Files in repositories should never have execute permissions, but there
+#  are some tests that have pre-built shared libraries, and these windows
+#  dll files must have execute permission. Adding execute permission
+#  may happen automatically on windows when using certain versions of mercurial
+#  but it cannot be guaranteed. And blindly adding execute permission might
+#  be seen as a mercurial 'change', so we avoid adding execute permission to
+#  repository files. But testing from a plain source tree needs the chmod a+rx.
+#  Used on select directories and applying the chmod to all shared libraries
+#  not just dll files. On windows, this may not work with MKS if the files
+#  were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
+#  And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
+#
+shared_library_permissions: $(SHARED_LIBRARY_DIR)
+	if [ ! -d $(TEST_ROOT)/../.hg ] ; then                          \
+	  $(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \)  \
+	        -exec $(CHMOD) a+rx {} \; ;                             \
+        fi
+
+PHONY_LIST += jtreg_tests shared_library_permissions
 
 ################################################################
 
@@ -679,7 +683,7 @@
 # perftest to collect statistics  
 
 # Expect JPRT to set JPRT_PACKTEST_HOME.
-PERFTEST_HOME = ${TEST_ROOT}/perf
+PERFTEST_HOME = $(TEST_ROOT)/perf
 ifdef JPRT_PERFTEST_HOME
   PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
 endif
--- a/jdk/test/ProblemList.txt	Tue May 18 15:36:47 2010 -0700
+++ b/jdk/test/ProblemList.txt	Thu May 20 13:57:58 2010 -0700
@@ -427,6 +427,9 @@
 
 # jdk_management
 
+# Access denied messages on windows/mks, filed 6954450
+sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh	windows-all
+
 # Filed 6951284, fails on linux 64bit Fedora 9, peak thread count differences
 java/lang/management/ThreadMXBean/ResetPeakThreadCount.java	generic-all
 
@@ -1115,58 +1118,6 @@
 sun/security/tools/keytool/importreadall.sh		 	solaris-all
 sun/security/tools/keytool/selfissued.sh		 	solaris-all
 
-# This is a problem with JPRT not being able to run these tests due to a dll
-#  permission problem that has not been figured out:
-sun/security/pkcs11/SampleTest.java				windows-i586
-sun/security/pkcs11/Secmod/AddPrivateKey.java			windows-i586
-sun/security/pkcs11/Cipher/ReinitCipher.java			windows-i586
-sun/security/pkcs11/Cipher/TestRSACipher.java			windows-i586
-sun/security/pkcs11/Cipher/TestRSACipherWrap.java		windows-i586
-sun/security/pkcs11/Cipher/TestSymmCiphers.java			windows-i586
-sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java		windows-i586
-sun/security/pkcs11/KeyAgreement/TestShort.java			windows-i586
-sun/security/pkcs11/KeyGenerator/DESParity.java			windows-i586
-sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java		windows-i586
-sun/security/pkcs11/KeyStore/Basic.sh				windows-i586
-sun/security/pkcs11/KeyStore/ClientAuth.sh			windows-i586
-sun/security/pkcs11/Mac/ReinitMac.java				windows-i586
-sun/security/pkcs11/MessageDigest/ByteBuffers.java		windows-i586
-sun/security/pkcs11/MessageDigest/DigestKAT.java		windows-i586
-sun/security/pkcs11/MessageDigest/ReinitDigest.java		windows-i586
-sun/security/pkcs11/Provider/ConfigQuotedString.sh		windows-i586
-sun/security/pkcs11/Provider/Login.sh				windows-i586
-sun/security/pkcs11/Sampl/pkcs11/Secmod/AddPrivateKey.java	windows-i586
-sun/security/pkcs11/Secmod/AddTrustedCert.java			windows-i586
-sun/security/pkcs11/Secmod/Crypto.java				windows-i586
-sun/security/pkcs11/Secmod/GetPrivateKey.java			windows-i586
-sun/security/pkcs11/Secmod/JksSetPrivateKey.java		windows-i586
-sun/security/pkcs11/Secmod/TrustAnchors.java			windows-i586
-sun/security/pkcs11/SecureRandom/Basic.java			windows-i586
-sun/security/pkcs11/SecureRandom/TestDeserialization.java	windows-i586
-sun/security/pkcs11/Serialize/SerializeProvider.java		windows-i586
-sun/security/pkcs11/Signature/ByteBuffers.java			windows-i586
-sun/security/pkcs11/Signature/ReinitSignature.java		windows-i586
-sun/security/pkcs11/Signature/TestDSA.java			windows-i586
-sun/security/pkcs11/Signature/TestRSAKeyLength.java		windows-i586
-sun/security/pkcs11/ec/ReadCertificates.java			windows-i586
-sun/security/pkcs11/ec/ReadPKCS12.java				windows-i586
-sun/security/pkcs11/ec/TestCurves.java				windows-i586
-sun/security/pkcs11/ec/TestECDH.java				windows-i586
-sun/security/pkcs11/ec/TestECDSA.java				windows-i586
-sun/security/pkcs11/ec/TestECGenSpec.java			windows-i586
-sun/security/pkcs11/ec/TestKeyFactory.java			windows-i586
-sun/security/pkcs11/fips/ClientJSSEServerJSSE.java		windows-i586
-sun/security/pkcs11/fips/TrustManagerTest.java			windows-i586
-sun/security/pkcs11/rsa/KeyWrap.java				windows-i586
-sun/security/pkcs11/rsa/TestCACerts.java			windows-i586
-sun/security/pkcs11/rsa/TestKeyFactory.java			windows-i586
-sun/security/pkcs11/rsa/TestKeyPairGenerator.java		windows-i586
-sun/security/pkcs11/rsa/TestSignatures.java			windows-i586
-sun/security/pkcs11/tls/TestKeyMaterial.java			windows-i586
-sun/security/pkcs11/tls/TestMasterSecret.java			windows-i586
-sun/security/pkcs11/tls/TestPRF.java				windows-i586
-sun/security/pkcs11/tls/TestPremaster.java			windows-i586
-
 ############################################################################
 
 # jdk_swing (not using samevm)