Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dlvsym(3) #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add support for dlvsym(3) #66

wants to merge 1 commit into from

Conversation

smortex
Copy link
Contributor

@smortex smortex commented Mar 12, 2019

This PR add support for dlvsym(3) to jffi.

The function dlvsym(3) does the same as dlsym(3) but takes a version string as an additional argument. This is useful for accessing a previous version of a function when a library evolves.

@smortex smortex force-pushed the dlvsym branch 3 times, most recently from a00bbd9 to c887d1e Compare March 18, 2019 02:43
Copy link
Contributor Author

@smortex smortex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/ I managed to have the whole stack working as expected!

Some cleanup / advises from people used to Java should help make this perfect, thanks! I'll review my changes to spot the points where I am not sure of what I did.

@smortex
Copy link
Contributor Author

smortex commented Apr 9, 2019

@headius thanks for the review, all big question marks on the top of my head have vanished (or at least I guess so).

I look forward for this to be merged to attempt fixing the next layer of code, probably with annotations? (don't know, never programmed in Java before)

smortex added a commit to smortex/jnr-ffi that referenced this pull request Apr 10, 2019
This is a follow-up to jnr/jffi#66 and use the
new API to make it possible to access versioned symbols in a shared
library.
smortex added a commit to smortex/jnr-ffi that referenced this pull request Apr 10, 2019
This is a follow-up to jnr/jffi#66 and use the
new API to make it possible to access versioned symbols in a shared
library.
@headius
Copy link
Member

headius commented Apr 11, 2019

@smortex What platforms will need new binaries for this?

We really need to get some cross-platform build rig set up, because the need to rebuild all the native binaries is really holding us back.

@smortex
Copy link
Contributor Author

smortex commented Apr 11, 2019

@headius I guess all platforms will need the updated bits in jni/jffi/Library.c wrapping dlvsym() in native code so that the code in src/main/java/com/kenai/jffi/Library.java can make use of it?

I do not really know how to help with producing and testing these changes on other operating systems. For a FreeBSD project, I have used https://cirrus-ci.com/ once, which has supports for running code on FreeBSD. Maybe this can be an option?

@smortex
Copy link
Contributor Author

smortex commented Apr 12, 2019

I have looked into building the project on FreeBSD with Cirrus-CI:

The doc says we can do things with artifacts. May this be (part of) a solution?

@headius
Copy link
Member

headius commented Apr 12, 2019

@smortex Yeah that's a pretty compelling option, with Mac, Linux, Windows, FreeBSD available!

At the very least we could start throwing some CI up there and start looking at how to reintegrate the artifacts that get built. The idea being that we would test on a local system (where presumably we can build native lib) and then push to CI, which would use Cirrus and others to test across all the other platforms, building their binaries in the process.

I'm game to give Cirrus a try on master and see what we can do with it.

@headius headius added this to the 2.0 milestone Aug 31, 2021
@headius
Copy link
Member

headius commented Aug 31, 2021

Marking for 2.0 as I think that will be the logical leap forward with the native binary. We will build in fallbacks to old behavior when the binary has not been updated, and build for as many platforms as possible whenever it changes, but we need to be able to move the native bits forward.

@headius
Copy link
Member

headius commented Dec 7, 2021

@smortex This has gotten pretty old but if you're still out there we have an opportunity to start adding to the native binary. I will need to rework some things to do varargs calls the "correct" way, which will mean a rolling rebuild of all binaries. This could pull in additions to the API to better support things like dlvsym.

@smortex
Copy link
Contributor Author

smortex commented Dec 8, 2021

Hi @headius!

Feel free to mess-up with this PR (and the other ones from me! 😉). My Java knowledge is rather limited and you seem to have a pretty good idea of the direction this should take. Let me know if I need to do something to make your life easier.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants