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.
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.