diff --git a/runtime/j9vm/exports.cmake b/runtime/j9vm/exports.cmake index b89974a7c15..da358ca31cd 100644 --- a/runtime/j9vm/exports.cmake +++ b/runtime/j9vm/exports.cmake @@ -159,7 +159,6 @@ jvm_add_exports(jvm _JVM_HoldsLock@12 _JVM_InitProperties@8 _JVM_ArrayCopy@28 - _JVM_DoPrivileged@20 _JVM_IHashCode@8 _JVM_Clone@8 _JVM_CompileClass@12 @@ -279,6 +278,12 @@ jvm_add_exports(jvm JVM_BeforeHalt ) +if((JAVA_SPEC_VERSION LESS 9) AND OMR_OS_WINDOWS) + jvm_add_exports(jvm + _JVM_DoPrivileged@20 + ) +endif() + if(JAVA_SPEC_VERSION LESS 11) jvm_add_exports(jvm _JVM_GetCallerClass@8 diff --git a/runtime/j9vm/j7vmi.c b/runtime/j9vm/j7vmi.c index d9dac6eccac..bcd22741c04 100644 --- a/runtime/j9vm/j7vmi.c +++ b/runtime/j9vm/j7vmi.c @@ -380,6 +380,7 @@ java_lang_J9VMInternals_doPrivilegedWithException(JNIEnv* env) return cached; } +#if (JAVA_SPEC_VERSION == 8) && defined(WIN32) /* Do not remove: this method is required by Windows IBM Java 8 builds. */ jobject JNICALL JVM_DoPrivileged(JNIEnv* env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction) @@ -403,8 +404,7 @@ JVM_DoPrivileged(JNIEnv* env, jobject java_security_AccessController, jobject ac methodID, action); } - - +#endif /* (JAVA_SPEC_VERSION == 8) && defined(WIN32) */ jobject JNICALL JVM_EnableCompiler(jint arg0, jint arg1) diff --git a/runtime/j9vm/j9vmnatives.xml b/runtime/j9vm/j9vmnatives.xml index 636b0ea5763..79819976a60 100644 --- a/runtime/j9vm/j9vmnatives.xml +++ b/runtime/j9vm/j9vmnatives.xml @@ -193,7 +193,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex - + + + + diff --git a/runtime/redirector/forwarders.m4 b/runtime/redirector/forwarders.m4 index 2112ff1f602..eea77774484 100644 --- a/runtime/redirector/forwarders.m4 +++ b/runtime/redirector/forwarders.m4 @@ -151,7 +151,8 @@ _X(JVM_CountStackFrames,JNICALL,true,jobject,jint arg0, jint arg1) _X(JVM_CurrentThread,JNICALL,true,jobject,JNIEnv *env, jclass java_lang_Thread) _X(JVM_DesiredAssertionStatus,JNICALL,true,jboolean,JNIEnv *env, jobject arg1, jobject arg2) _X(JVM_DisableCompiler,JNICALL,true,jobject,jint arg0, jint arg1) -_X(JVM_DoPrivileged,JNICALL,true,jobject,JNIEnv *env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction) +_IF([(JAVA_SPEC_VERSION == 8) && defined(WIN32)], + [_X(JVM_DoPrivileged,JNICALL,true,jobject,JNIEnv *env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction)]) _X(JVM_EnableCompiler,JNICALL,true,jobject,jint arg0, jint arg1) _X(JVM_FillInStackTrace,JNICALL,true,void,JNIEnv *env, jobject throwable) _X(JVM_FindClassFromClassLoader,JNICALL,true,jobject,JNIEnv *env, char *className, jboolean init, jobject classLoader, jboolean throwError)