[nicl] Adding -rpath option to jextract tool

Henry Jen henry.jen at oracle.com
Thu Feb 15 18:18:45 UTC 2018


Overall looks good.

I see we removed -L and added —rpath. I wonder why not both? We tried to use same options as gcc where C developers is likely familiar with.

Perhaps extract the search of library logic at NativeLibraryImpl.java:169 into a separate function to make it more readable, suspect that maybe reusable too.

Cheers,
Henry


> On Feb 15, 2018, at 6:55 AM, Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com> wrote:
> 
> Webrev:  http://cr.openjdk.java.net/~sundar/jextract_rpath_option/webrev.00/
> 
> -rpath multiple use option can be used to add one or search paths for shared objects.
> This option is expected to be used along with -l option to add library names.
> LibraryDependencies annotation is used to record both names and paths for libraries.
> 
> API changes:
> 
> NativeLibrary.load, NativeLibrary.loadLibrary are similar to System.load, System.loadLibrary
> except for JNI "on load" initialization. Removed LibraryDependency and ImportUnit.
> 
> Backend changes:
> 
> If "paths" array is present in LibraryDependencies annotation, backend uses it to resolve library
> names against it. Backend will use resolved, absolute path of the library with NativeLibrary.load.
> If "paths" is absent or if no path has resolves a library name to an existing file, then backend
> uses JNI library search path set using the System property "java.library.path".
> 
> -Sundar



More information about the panama-dev mailing list