RFR (XXS): 7130404: [macosx] "os.arch" value should be "x86_64" for compatibility with Apple JDK6

Mike Swingler swingler at apple.com
Mon Feb 20 14:45:07 PST 2012


On Feb 20, 2012, at 1:02 PM, James Melvin wrote:

> Hi,
> 
> To maintain compatibility with Apple JDKs, a proposal will be made to
> change the 'os.arch' system property from 'amd64' to 'x86_64' on Mac OS
> X. Minor changes are required to the following repositories, for which
> I've provided webrevs...
> 
> WEBREV:
>  http://cr.openjdk.java.net/~jmelvin/7130404/hotspot/webrev.00
>  http://cr.openjdk.java.net/~jmelvin/7130404/jdk/webrev.00
> 
> TESTING:
>  JPRT job (2012-02-20-203901.jmelvin.hotspot)
>  Notepad, SwingSet2, SPECjbb2005
> 
> This change will also impact a small number of internal tests and RE
> scripts. The bundle names will also reflect the change amd64 -> x86_64.
> HotSpot changes can be integrated first, with the JDK changes in the
> following promotion. Should the proposal be rejected for 7u4, I
> obviously withdraw the bugfix.


In the two following diffs, the check for Mac OS X should be done with a .contains("OS X"), because Mac OS X Server reports it's OS version as "Mac OS X Server" and would not exactly match. While I have previously suggested using .startsWith("Mac OS X"), I'm now recommending .contains("OS X") for...robustness.


--- old/src/share/classes/java/awt/GraphicsEnvironment.java	2012-02-20 14:48:21.000000000 -0500
+++ new/src/share/classes/java/awt/GraphicsEnvironment.java	2012-02-20 14:48:21.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -179,6 +179,7 @@
                                 headless = defaultHeadless =
                                     Boolean.valueOf(("Linux".equals(osName) ||
                                                      "SunOS".equals(osName) ||
+                                                     "Mac OS X".equals(osName) ||
                                                      "FreeBSD".equals(osName) ||
                                                      "NetBSD".equals(osName) ||
                                                      "OpenBSD".equals(osName)) &&


--- old/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java	2012-02-20 15:41:33.000000000 -0500
+++ new/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java	2012-02-20 15:41:33.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -217,8 +217,8 @@
     }
 
     protected void checkNativeLink(SecurityManager sm, String os) {
-        if (os.equals("SunOS") || os.equals("Linux")) {
-            // link "saproc" - SA native library on SunOS and Linux?
+        if (os.equals("SunOS") || os.equals("Linux") || os.equals("Mac OS X")) {
+            // link "saproc" - SA native library on SunOS, Linux, and Mac OS X
             sm.checkLink("saproc");
         } else if (os.startsWith("Windows")) {
             // link "sawindbg" - SA native library on Windows.

Regards,
Mike Swingler
Apple Inc.


More information about the jdk7-dev mailing list