RFR: Add support for AIX in build process [v5]
Jorn Vernee
jvernee at openjdk.org
Mon Dec 8 12:03:39 UTC 2025
On Mon, 8 Dec 2025 11:46:39 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java line 95:
>>
>>> 93: libName = f.getAbsolutePath();
>>> 94: }
>>> 95: SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName + "(libclang.so.14)", Arena.global());
>>
>> If we don't enter the `if` statement, the library name will end up as `null(libclang.so.14)`. `libraryLookup` throws an IAE when the library can not be loaded, so I think we can just construct the name and try to load the library.
>> Suggestion:
>>
>> String javaHome = System.getProperty("java.home");
>> String libName = javaHome + "/lib/libclang.a(libclang.so.14)";
>> SYMBOL_LOOKUP = SymbolLookup.libraryLookup(libName, LIBRARY_ARENA);
>
> Also, this should use `LIBRARY_ARENA`, so the library can be unloaded.
As for hard-coding the library version. We could potentially record the libclang version in a file we store under `conf` in the runtime image, similar to what we do for the bundled header files. The version could then be loaded from that file here.
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/297#discussion_r2598349179
More information about the jextract-dev
mailing list