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

Get additional library paths from ldconfig on Linux #478

Merged
merged 3 commits into from
Sep 7, 2015

Conversation

gohai
Copy link
Contributor

@gohai gohai commented Aug 1, 2015

No description provided.

@twall
Copy link
Contributor

twall commented Aug 1, 2015

Interesting approach. Seems like a good idea, although this patch could stand some tests (even if platform-specific).

gohai added a commit to processing/processing-video that referenced this pull request Aug 1, 2015
This is twall's jna git, commit a82a6ca (post release 4.1.0), with my path ("Get additional library paths from ldconfig on Linux"), commit f0ea52c, on top. Upstream PR: java-native-access/jna#478
@gohai
Copy link
Contributor Author

gohai commented Aug 1, 2015

I'll test it tomorrow on Raspbian (armv6hf Debian), and also on my laptop (amd64 Fedora). Will report back.

@twall
Copy link
Contributor

twall commented Aug 1, 2015

A little OT, but does it make sense to have HF/non-HF versions of the JNA ARM build?

On Aug 1, 2015, at 5:18 PM, Gottfried Haider [email protected] wrote:

I'll test it tomorrow on Raspbian (armv6hf Debian), and also on my laptop (amd64 Fedora). Will report back.


Reply to this email directly or view it on GitHub.

…aths from ldconfig

This should preserve existing behavior more closely.
@gohai
Copy link
Contributor Author

gohai commented Aug 2, 2015

@twall I don't know enough about the compatibility between different ARM ABIs and JNA to comment on that.. the best description of the situation I have found is was here.

My understanding is that both Debian and Fedora settled on armv7 as their baseline for a "hard float" ABI, and that Raspbian is rolling its own armv6hf port, since that was was the highest the original Raspberry Pi could support. I believe that armv6hf binaries run on armv7hf distributions, but not vice versa, but I could be wrong.

@gohai
Copy link
Contributor Author

gohai commented Aug 2, 2015

There's definitely also a armv6 (without the hard-float) ABI that one comes across occasionally.

gohai added a commit to processing/processing-video that referenced this pull request Aug 2, 2015
This is now twall's jna git, commit a82a6ca (post release 4.1.0), with my patches ("Get additional library paths from ldconfig on Linux"ff), commit 8c067a2, on top. Upstream PR: java-native-access/jna#478
@gohai
Copy link
Contributor Author

gohai commented Aug 2, 2015

Tested today. Worked as expected. Think it's a step up from the current behavior, but I might be biased :)

}
}
reader.close();
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd be concerned about a catch all here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dblock Ain't pretty - but my reason for this was that I don't ever want this code to regress from the paths, and functionality, it offers currently. There are a number of reasons why the code above could fail, either now, or by some changes to ldconfig down the road. This at least makes sure that we don't trip on them...

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you aware of any execution restrictions on /sbin/ldconfig? SE Linux in particular sometimes has some reduced availability of system-oriented functions.

@gohai
Copy link
Contributor Author

gohai commented Aug 30, 2015

@twall My Fedora (22) had SE Linux enabled (and was enforcing it), but I didn't see any warnings or the like. This is not to say that this couldn't be a problem, just that I haven't seen it. What would be the default action if SE Linux is indeed not happy about an application invoking /sbin/ldconfig? Would exec just fail, or the program be terminated?

@twall
Copy link
Contributor

twall commented Aug 30, 2015

My guess would be that either the program would be invisible to a normal user or that invoking it would just fail. So presumably the generic exception net would catch such failures.

twall added a commit that referenced this pull request Sep 7, 2015
Get additional library paths from ldconfig on Linux
@twall twall merged commit 3212af8 into java-native-access:master Sep 7, 2015
thumb777 pushed a commit to thumb777/gstreamer-multimedia that referenced this pull request Apr 20, 2024
This is twall's jna git, commit a82a6ca (post release 4.1.0), with my path ("Get additional library paths from ldconfig on Linux"), commit f0ea52c, on top. Upstream PR: java-native-access/jna#478
thumb777 pushed a commit to thumb777/gstreamer-multimedia that referenced this pull request Apr 20, 2024
This is now twall's jna git, commit a82a6ca (post release 4.1.0), with my patches ("Get additional library paths from ldconfig on Linux"ff), commit 8c067a2, on top. Upstream PR: java-native-access/jna#478
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.

3 participants