RFR: Add support for AIX in build process [v3]

Jorn Vernee jvernee at openjdk.org
Thu Dec 4 14:25:02 UTC 2025


On Thu, 4 Dec 2025 14:07:55 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>>> Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`.
>> 
>> Aren't the files copied from lib clang directory to lib under jextract folder? Hence I used user.dir, as the application runs there
>
>> > Otherwise, if `loadLibrary` needs to be used, I think the resolution of the library should be done relative to `System.getProperty("java.home")` and then I suppose jlink puts the library under `lib`.
>> 
>> Aren't the files copied from lib clang directory to lib under jextract folder? Hence I used user.dir, as the application runs there
> 
> No, that's only for the build. In the final app image (under `./build/jextract` when using the gradle build) they are in the Java runtime image under `jextract/runtime/lib` (or `jextract/runtime/bin`. This is just where jlink puts them btw. We first create a .jmod file with the native libraries, and then use that to generate the runtime image using jlink.

Try these steps:


./gradlew build
export PATH=$PWD/build/jextract/bin:$PATH
cd /some/other/path/somewhere
jextract foo.h


`foo.h` can just be an empty file, but this is enough to trigger the loading of libclang.

In this case, `user.dir` would be `/some/other/path/somewhere`, so the library can't be found relative to that.

-------------

PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2589287001


More information about the jextract-dev mailing list