Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

[FFI]Inline the missing libc functions for symbol lookup on AIX #22

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

ChengJin01
Copy link

The changes aim to support the symbol lookup via FFI for
the missing libc functions in loading the default library on
AIX by inlining their address into a function list in native to
ensure they are correctly invoked with the native address
fetched in the FFI code.

Signed-off-by: ChengJin01 jincheng@ca.ibm.com

@ChengJin01
Copy link
Author

The PR include pretty much the same changes as ibmruntimes/openj9-openjdk-jdk19#75 with the updated APIs specified in JDK20 as follows:

  • MemoryAddress is replaced with MemorySegment
  • MemorySession is replaced with SegmentScope

Reviewer: @pshipton
FYI: @tajila

@pshipton
Copy link
Member

pshipton commented Mar 3, 2023

jenkins compile aix jdk20

@pshipton
Copy link
Member

pshipton commented Mar 4, 2023

It doesn't compile

18:57:37  /home/jenkins/workspace/Build_JDK20_ppc64_aix_Personal/src/java.base/share/classes/jdk/internal/foreign/SystemLookup.java:103: error: cannot find symbol
18:57:37                  MemorySegment funcs = MemorySegment.ofAddress(funcsLibLookup.lookup("funcs").orElseThrow().address(),
18:57:37                                                                              ^
18:57:37    symbol:   method lookup(String)
18:57:37    location: variable funcsLibLookup of type SymbolLookup

The changes aim to support the symbol lookup via FFI for
the missing libc functions in loading the default library
on AIX by inlining their address into a function list in
native to ensure they are correctly invoked with the
native address fetched in the FFI code.

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
@ChengJin01 ChengJin01 force-pushed the ffi_inline_libc_func_jdk20 branch from a42f4de to 4bc22b2 Compare March 4, 2023 00:34
@ChengJin01
Copy link
Author

ChengJin01 commented Mar 4, 2023

18:57:37 /home/jenkins/workspace/Build_JDK20_ppc64_aix_Personal/src/java.base/share/classes/jdk/internal/foreign/SystemLookup.java:103: error: cannot find symbol
18:57:37 MemorySegment funcs = MemorySegment.ofAddress(funcsLibLookup.lookup("funcs").orElseThrow().address(),
18:57:37 ^
18:57:37 symbol: method lookup(String)
18:57:37 location: variable funcsLibLookup of type SymbolLookup

Fixed as the method lookup was replaced with find in SymbolLookup.java since JDK20.

@pshipton
Copy link
Member

pshipton commented Mar 4, 2023

jenkins compile aix jdk20

@pshipton pshipton merged commit 91eb72c into ibmruntimes:openj9 Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants