You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am using Panama FFI to call the DPDK library. Normally the compilation result of dpdk is a static archive and should be statically linked to a user program.
When trying to statically linking a library to the native-image, I find it's pretty easy to link, simply by adding the following options:
However the symbols of the library are not exported because during the linking phase the native-image generator adds a version script to control the visibility of the symbols.
Since the symbols are not exported, the lookup operation of Panama FFI cannot find the requested function.
Describe the solution you'd like.
So I'm wondering whether we could add an option to let users define their own symbols.
For example, adding an option: -H:AdditionalExportedSymbols=<file-path>, and directly concat the file content below global: and above local:. Similar operation could be added for MacOS as well.
I looked into the source code and I found this is not hard to implement, but I'm wondering whether this should be officially supported.
Describe who do you think will benefit the most.
GraalVM users, developers of libraries and frameworks which depend on GraalVM
Describe alternatives you've considered.
I currently modified the native-image source code (not directly, but with a javaagent) to achieve my requirements.
Express whether you'd like to help contributing this feature
If this feature is desired to be officially supported, I would like to contribute.
The text was updated successfully, but these errors were encountered:
wirthi
changed the title
Support to export custom symbols when building a native image
[GR-49642] Support to export custom symbols when building a native image
Apr 24, 2024
Are there any updates? Since the native-image provides nearly static linked build of Java application, keep all native libraries static linked is useful. But there're no public way to custom the symbols import from the static linked libraries. @wirthi
Feature request
Is your feature request related to a problem? Please describe.
I am using Panama FFI to call the DPDK library. Normally the compilation result of dpdk is a static archive and should be statically linked to a user program.
When trying to statically linking a library to the native-image, I find it's pretty easy to link, simply by adding the following options:
However the symbols of the library are not exported because during the linking phase the native-image generator adds a version script to control the visibility of the symbols.
Since the symbols are not exported, the
lookup
operation of Panama FFI cannot find the requested function.Describe the solution you'd like.
So I'm wondering whether we could add an option to let users define their own symbols.
For example, adding an option:
-H:AdditionalExportedSymbols=<file-path>
, and directly concat the file content belowglobal:
and abovelocal:
. Similar operation could be added for MacOS as well.I looked into the source code and I found this is not hard to implement, but I'm wondering whether this should be officially supported.
Describe who do you think will benefit the most.
GraalVM users, developers of libraries and frameworks which depend on GraalVM
Describe alternatives you've considered.
I currently modified the native-image source code (not directly, but with a javaagent) to achieve my requirements.
Express whether you'd like to help contributing this feature
If this feature is desired to be officially supported, I would like to contribute.
The text was updated successfully, but these errors were encountered: