Package demos.opengl
Class CheckLinkConsistency
java.lang.Object
demos.opengl.CheckLinkConsistency
CheckLinkConsistency
relies on preview features of the Java platform:
CheckLinkConsistency
refers to one or more preview APIs:SymbolLookup
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Allow verifying if all generated MethodHandle of the JExtract'ed libraries can be linked properly to native libraries.
Run me with VM args :
--enable-native-access=ALL-UNNAMED --add-modules jdk.incubator.foreign -Djava.library.path=.:/usr/lib/x86_64-linux-gnu/
To build this program, you need to change RuntimeHelper to public as well as its lookup method. If you can't, just set it to null
To verify that this program works properly, you need to make an explicit load of libraries and ensure that generated code
does not do it, as loading class names from the class path will trigger loading. E.g. do this :
public class glut_h extends glut_h_6 {
static {
//System.loadLibrary("GL");
//System.load("/usr/lib/x86_64-linux-gnu/libglut.so.3.9.0");
//System.load("/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1");
}
And then manually load the libraries in the below check program-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
check
(SymbolLookupPREVIEW lookup, String function) static Class[]
getClasses
(String packageName) static void
static void
printLinkStatus
(SymbolLookupPREVIEW lookup, Class clazz, Field field, String generatedMethod, demos.opengl.CheckLinkConsistency.Link linkStatus) static void
printLinkStatus
(SymbolLookupPREVIEW lookup, Class clazz, String nativeFunctionPatternFilter, demos.opengl.CheckLinkConsistency.Link linkStatus) static void
printLinkStatus
(SymbolLookupPREVIEW lookup, String packageName, String classPattern, String nativeFunctionPatternFilter, demos.opengl.CheckLinkConsistency.Link linkStatus)
-
Constructor Details
-
CheckLinkConsistency
public CheckLinkConsistency()
-
-
Method Details
-
main
public static void main(String[] args) throws IOException, ClassNotFoundException, IllegalAccessException -
printLinkStatus
public static void printLinkStatus(SymbolLookupPREVIEW lookup, String packageName, String classPattern, String nativeFunctionPatternFilter, demos.opengl.CheckLinkConsistency.Link linkStatus) throws ClassNotFoundException, IOException, IllegalAccessException -
printLinkStatus
public static void printLinkStatus(SymbolLookupPREVIEW lookup, Class clazz, String nativeFunctionPatternFilter, demos.opengl.CheckLinkConsistency.Link linkStatus) throws IllegalAccessException - Throws:
IllegalAccessException
-
printLinkStatus
public static void printLinkStatus(SymbolLookupPREVIEW lookup, Class clazz, Field field, String generatedMethod, demos.opengl.CheckLinkConsistency.Link linkStatus) throws IllegalAccessException - Throws:
IllegalAccessException
-
check
-
getClasses
- Throws:
ClassNotFoundException
IOException
-
CheckLinkConsistency
when preview features are enabled.