-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows awt support #3079
base: master
Are you sure you want to change the base?
windows awt support #3079
Conversation
b2f6430
to
8571afd
Compare
Looking further into the current setup of the unix support, if I'm understanding it correctly, the value of Since some use cases require the headless property to be decided at runtime (if both modes have to be supported) I would suggest introducing a hosted option to switch between both options, probably with the default on build-time setting to keep the default image size small. (Which has the added issue that windows cannot have a |
8571afd
to
243f7f9
Compare
@kkriske @pejovica I think the cause of Do you have similar link error like Reproduce on Windows: 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.hosted.FeatureImpl;
import com.oracle.svm.hosted.c.NativeLibraries;
import org.graalvm.nativeimage.hosted.Feature;
@AutomaticFeature
public class AWTFeature implements Feature {
@Override
public void beforeAnalysis(BeforeAnalysisAccess access) {
NativeLibraries nativeLibraries = ((FeatureImpl.BeforeAnalysisAccessImpl) access).getNativeLibraries();
nativeLibraries.addDynamicNonJniLibrary("Gdi32");
nativeLibraries.addDynamicNonJniLibrary("Imm32");
nativeLibraries.addDynamicNonJniLibrary("Winspool");
nativeLibraries.addDynamicNonJniLibrary("Comdlg32");
nativeLibraries.addDynamicNonJniLibrary("Comctl32");
nativeLibraries.addDynamicNonJniLibrary("Shlwapi");
nativeLibraries.addDynamicNonJniLibrary("Winmm");
NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("awt");
nativeLibraries.addStaticJniLibrary("awt");
PlatformNativeLibrarySupport.singleton().addBuiltinPkgNativePrefix("java_awt");
}
}
|
This is a very crude first implementation of awt support for windows, the main purpose of this PR is sharing this with the GraalVM team for feedback and to discuss possible next steps.
The most interesting part of this PR is that it should contain all reachability handlers to cover registration of JNI requirements of the awt library on windows. It does however not cover any other libraries such as lcms or mlib_image.
current issues:
JNI_OnLoad_awt
not found exception on linking)initIDs
, which fetch and store method/field pointers). In other library features this seems to be handled by marking them for rerun instead of runtime but I am not sure of the implications hereof.I would appreciate some information on these 2 points, especially why and if classes should be marked for rerun, and if awt (and related other libraries) can be build statically or if there are some things preventing this for now. (and if maybe I can be of any help there?)
With some supervision, I am willing to bring this to a useable state.