Skip to content

Commit

Permalink
[GR-18703] Fix linking to static jaas library on JDK 11.
Browse files Browse the repository at this point in the history
PullRequest: graal/4577
  • Loading branch information
pejovica committed Oct 12, 2019
2 parents b4f8ad9 + cacbdc2 commit c6be8d4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.util.Map;
import java.util.function.Function;

import com.oracle.svm.core.jdk.NativeLibrarySupport;
import org.graalvm.compiler.options.Option;
import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
import org.graalvm.nativeimage.ImageSingletons;
Expand All @@ -47,6 +46,7 @@

import com.oracle.svm.core.SubstrateOptions;
import com.oracle.svm.core.annotate.AutomaticFeature;
import com.oracle.svm.core.jdk.NativeLibrarySupport;
import com.oracle.svm.core.jdk.PlatformNativeLibrarySupport;
import com.oracle.svm.core.jni.JNIRuntimeAccess;
import com.oracle.svm.core.option.HostedOptionKey;
Expand Down Expand Up @@ -241,8 +241,7 @@ private static void linkJaas(DuringAnalysisAccess duringAnalysisAccess) {
NativeLibraries nativeLibraries = ((FeatureImpl.DuringAnalysisAccessImpl) duringAnalysisAccess).getNativeLibraries();
if (nativeLibraries.getStaticLibraryPath("jaas") != null) {
/* We can statically link jaas, thus we classify it as builtIn library */
PlatformNativeLibrarySupport.singleton();
NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("jaas_unix");
NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary(JavaVersionUtil.JAVA_SPEC >= 11 ? "jaas" : "jaas_unix");
/* Resolve calls to com_sun_security_auth_module_UnixSystem* as builtIn. */
PlatformNativeLibrarySupport.singleton().addBuiltinPkgNativePrefix("com_sun_security_auth_module_UnixSystem");
nativeLibraries.addLibrary("jaas", true);
Expand Down

0 comments on commit c6be8d4

Please sign in to comment.