RFR: JDK-8317799 : AIX PPC64: FFI symbol lookup doesn't find symbols

Magnus Ihse Bursie ihse at openjdk.org
Tue Nov 14 11:27:31 UTC 2023


On Mon, 30 Oct 2023 10:54:48 GMT, suchismith1993 <duke at openjdk.org> wrote:

> 1. Adding required compiler flags.
> 2. Adding required symbols.
> 
> JBS-ISSUE : [JDK-8317799](https://bugs.openjdk.org/browse/JDK-8317799)

I've done another pass of reading through all comments and background. I think we're not even near a solution to the real problem.

@dholmes-ora If I'm understanding Jorn's comment correctly, this is not a problem with the tests. The tests correctly catches failures in the implementation. Jorn says: 

> java.lang.foreign.Linker.nativeLinker().defaultLookup() returns a SymbolLookup that can be used to find symbols from the standard library.

I assume this is a public API that is available to any Java program using FFI.

But if you just export the symbols of the functions in the standard library that are used by Hotspot and linked statically, then this function will not work. What happens if the user wants to look up a standard library function outside of the set used by Hotspot?

It might be that the specification is vague enough and that `defaultLookup()` is allowed to deny any requests for functions that are not used by Hotspot, and the poor developer is sh*t out of luck. But that'd also make `defaultLookup()` kind of useless and even less portable. You could not really on it to get a standard POSIX symbol even if running on a POSIX OS.

But if `defaultLookup()` by spec needs to be able to access the entire standard library, then AIX will need to handle this completely different. Either link statically with the entire standard library, or switch to using dynamic libraries. (Or use a statically linked library by hotspot but also load the library dynamically when requested by the user. I don't even know if such a chimera would work.)

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

PR Comment: https://git.openjdk.org/jdk/pull/16414#issuecomment-1810025179


More information about the build-dev mailing list