Skip to content

Commit f00d36d

Browse files
committed
Include JVM_DoPrivileged for IBM Java 8 Windows builds only
Signed-off-by: Theresa Mammarella <[email protected]>
1 parent 1fbf35b commit f00d36d

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

runtime/j9vm/exports.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ jvm_add_exports(jvm
159159
_JVM_HoldsLock@12
160160
_JVM_InitProperties@8
161161
_JVM_ArrayCopy@28
162-
_JVM_DoPrivileged@20
163162
_JVM_IHashCode@8
164163
_JVM_Clone@8
165164
_JVM_CompileClass@12
@@ -279,6 +278,12 @@ jvm_add_exports(jvm
279278
JVM_BeforeHalt
280279
)
281280

281+
if((JAVA_SPEC_VERSION LESS 9) AND OMR_OS_WINDOWS)
282+
jvm_add_exports(jvm
283+
_JVM_DoPrivileged@20
284+
)
285+
endif()
286+
282287
if(JAVA_SPEC_VERSION LESS 11)
283288
jvm_add_exports(jvm
284289
_JVM_GetCallerClass@8

runtime/j9vm/j7vmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ java_lang_J9VMInternals_doPrivilegedWithException(JNIEnv* env)
380380
return cached;
381381
}
382382

383+
#if (JAVA_SPEC_VERSION == 8) && defined(WIN32)
383384
/* Do not remove: this method is required by Windows IBM Java 8 builds. */
384385
jobject JNICALL
385386
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
403404
methodID,
404405
action);
405406
}
406-
407-
407+
#endif /* (JAVA_SPEC_VERSION == 8) && defined(WIN32) */
408408

409409
jobject JNICALL
410410
JVM_EnableCompiler(jint arg0, jint arg1)

runtime/j9vm/j9vmnatives.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
193193
<export name="_JVM_HoldsLock@12"/>
194194
<export name="_JVM_InitProperties@8"/>
195195
<export name="_JVM_ArrayCopy@28"/>
196-
<export name="_JVM_DoPrivileged@20"/>
196+
<export name="_JVM_DoPrivileged@20">
197+
<include-if condition="spec.win_.*"/>
198+
<exclude-if condition="spec.java9"/>
199+
</export>
197200
<export name="_JVM_IHashCode@8"/>
198201
<export name="_JVM_Clone@8"/>
199202
<export name="_JVM_CompileClass@12"/>

runtime/redirector/forwarders.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ _X(JVM_CountStackFrames,JNICALL,true,jobject,jint arg0, jint arg1)
151151
_X(JVM_CurrentThread,JNICALL,true,jobject,JNIEnv *env, jclass java_lang_Thread)
152152
_X(JVM_DesiredAssertionStatus,JNICALL,true,jboolean,JNIEnv *env, jobject arg1, jobject arg2)
153153
_X(JVM_DisableCompiler,JNICALL,true,jobject,jint arg0, jint arg1)
154-
_X(JVM_DoPrivileged,JNICALL,true,jobject,JNIEnv *env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction)
154+
_IF([(JAVA_SPEC_VERSION == 8) && defined(WIN32)],
155+
[_X(JVM_DoPrivileged,JNICALL,true,jobject,JNIEnv *env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction)])
155156
_X(JVM_EnableCompiler,JNICALL,true,jobject,jint arg0, jint arg1)
156157
_X(JVM_FillInStackTrace,JNICALL,true,void,JNIEnv *env, jobject throwable)
157158
_X(JVM_FindClassFromClassLoader,JNICALL,true,jobject,JNIEnv *env, char *className, jboolean init, jobject classLoader, jboolean throwError)

0 commit comments

Comments
 (0)