8033154: PPC64: Fix AIX build after integration into jdk9/dev
authorsimonis
Wed, 29 Jan 2014 20:41:33 +0100
changeset 23016 1805013d2034
parent 22608 55902b6456fa
child 23017 e52291e0a2e1
8033154: PPC64: Fix AIX build after integration into jdk9/dev Reviewed-by: alanb
jdk/make/lib/NioLibraries.gmk
jdk/src/aix/native/sun/nio/ch/AixNativeThread.c
jdk/src/share/lib/security/java.security-aix
jdk/src/solaris/classes/sun/net/PortConfig.java
jdk/src/solaris/native/sun/nio/ch/Net.c
--- a/jdk/make/lib/NioLibraries.gmk	Tue Jan 28 14:58:15 2014 -0800
+++ b/jdk/make/lib/NioLibraries.gmk	Wed Jan 29 20:41:33 2014 +0100
@@ -120,7 +120,7 @@
   BUILD_LIBNIO_FILES += \
       AixPollPort.c \
       InheritedChannel.c \
-      NativeThread.c \
+      AixNativeThread.c \
       PollArrayWrapper.c \
       UnixAsynchronousServerSocketChannelImpl.c \
       UnixAsynchronousSocketChannelImpl.c \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c	Wed Jan 29 20:41:33 2014 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2002, 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <sys/types.h>
+#include <string.h>
+#include "jni.h"
+#include "jni_util.h"
+#include "jvm.h"
+#include "jlong.h"
+#include "sun_nio_ch_NativeThread.h"
+
+#include <pthread.h>
+#include <sys/signal.h>
+
+/* Also defined in src/aix/native/java/net/aix_close.c */
+#define INTERRUPT_SIGNAL (SIGRTMAX - 1)
+
+static void
+nullHandler(int sig)
+{
+}
+
+
+JNIEXPORT void JNICALL
+Java_sun_nio_ch_NativeThread_init(JNIEnv *env, jclass cl)
+{
+    /* Install the null handler for INTERRUPT_SIGNAL. This might overwrite the
+     * handler previously installed by java/net/aix_close.c, but that's okay
+     * since neither handler actually does anything.  We install our own
+     * handler here simply out of paranoia; ultimately the two mechanisms
+     * should somehow be unified, perhaps within the VM.
+     */
+
+    sigset_t ss;
+    struct sigaction sa, osa;
+    sa.sa_handler = nullHandler;
+    sa.sa_flags = 0;
+    sigemptyset(&sa.sa_mask);
+    if (sigaction(INTERRUPT_SIGNAL, &sa, &osa) < 0)
+        JNU_ThrowIOExceptionWithLastError(env, "sigaction");
+}
+
+JNIEXPORT jlong JNICALL
+Java_sun_nio_ch_NativeThread_current(JNIEnv *env, jclass cl)
+{
+    return (long)pthread_self();
+}
+
+JNIEXPORT void JNICALL
+Java_sun_nio_ch_NativeThread_signal(JNIEnv *env, jclass cl, jlong thread)
+{
+    if (pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL))
+        JNU_ThrowIOExceptionWithLastError(env, "Thread signal failed");
+}
--- a/jdk/src/share/lib/security/java.security-aix	Tue Jan 28 14:58:15 2014 -0800
+++ b/jdk/src/share/lib/security/java.security-aix	Wed Jan 29 20:41:33 2014 +0100
@@ -182,6 +182,7 @@
                com.sun.istack.internal.,\
                com.sun.jmx.,\
                com.sun.media.sound.,\
+               com.sun.naming.internal.,\
                com.sun.proxy.,\
                com.sun.corba.se.,\
                com.sun.org.apache.bcel.internal.,\
@@ -205,7 +206,7 @@
                com.sun.org.glassfish.,\
                com.oracle.xmlns.internal.,\
                com.oracle.webservices.internal.,\
-	       oracle.jrockit.jfr.,\
+               oracle.jrockit.jfr.,\
                org.jcp.xml.dsig.internal.,\
                jdk.internal.,\
                jdk.nashorn.internal.,\
@@ -228,6 +229,7 @@
                    com.sun.istack.internal.,\
                    com.sun.jmx.,\
                    com.sun.media.sound.,\
+                   com.sun.naming.internal.,\
                    com.sun.proxy.,\
                    com.sun.corba.se.,\
                    com.sun.org.apache.bcel.internal.,\
@@ -251,7 +253,7 @@
                    com.sun.org.glassfish.,\
                    com.oracle.xmlns.internal.,\
                    com.oracle.webservices.internal.,\
-		   oracle.jrockit.jfr.,\
+                   oracle.jrockit.jfr.,\
                    org.jcp.xml.dsig.internal.,\
                    jdk.internal.,\
                    jdk.nashorn.internal.,\
@@ -470,7 +472,7 @@
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
+jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024
 
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
 # (SSL/TLS) processing
@@ -494,4 +496,3 @@
 #
 # Example:
 #   jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048
-
--- a/jdk/src/solaris/classes/sun/net/PortConfig.java	Tue Jan 28 14:58:15 2014 -0800
+++ b/jdk/src/solaris/classes/sun/net/PortConfig.java	Wed Jan 29 20:41:33 2014 +0100
@@ -55,6 +55,14 @@
                     } else if (os.contains("OS X")) {
                         defaultLower = 49152;
                         defaultUpper = 65535;
+                    } else if (os.startsWith("AIX")) {
+                        // The ephemeral port is OS version dependent on AIX:
+                        // http://publib.boulder.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.rsct315.admin/bl503_ephport.htm
+                        // However, on AIX 5.3 / 6.1 / 7.1 we always see the
+                        // settings below by using:
+                        // /usr/sbin/no -a | fgrep ephemeral
+                        defaultLower = 32768;
+                        defaultUpper = 65535;
                     } else {
                         throw new InternalError(
                             "sun.net.PortConfig: unknown OS");
--- a/jdk/src/solaris/native/sun/nio/ch/Net.c	Tue Jan 28 14:58:15 2014 -0800
+++ b/jdk/src/solaris/native/sun/nio/ch/Net.c	Wed Jan 29 20:41:33 2014 +0100
@@ -78,6 +78,18 @@
     #define MCAST_UNBLOCK_SOURCE            65
     #define MCAST_JOIN_SOURCE_GROUP         66
     #define MCAST_LEAVE_SOURCE_GROUP        67
+
+    /* This means we're on AIX 5.3 and 'group_source_req' and 'ip_mreq_source' aren't defined as well */
+    struct group_source_req {
+        uint32_t gsr_interface;
+        struct sockaddr_storage gsr_group;
+        struct sockaddr_storage gsr_source;
+    };
+    struct ip_mreq_source {
+        struct in_addr  imr_multiaddr;  /* IP multicast address of group */
+        struct in_addr  imr_sourceaddr; /* IP address of source */
+        struct in_addr  imr_interface;  /* local IP address of interface */
+    };
   #endif
 #endif /* _AIX */