Update OSGi headers for the JNA bundle to support 32bit ARM on Raspberry Pi 3 B+#1147
Merged
matthiasblaesing merged 1 commit intojava-native-access:masterfrom Oct 25, 2019
Merged
Conversation
Member
|
Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the build of the JNA OSGi bundle to support an additional processor architecture to allow the bundle to be installed on OSGi running on Raspberry Pi 3 B+ with a 32bit OS.
Apache Felix's OSGi implementation reports the
osgi.native.processoras eitherarm_leorarm_bewhen the system propertyos.archreturnsarm.When running a 32bit OS on the RPi Java reports
armforos.archwhich is normalized toarm_leby Felix. Because of this, the JNA bundle cannot be installed since this architecture is not currently listed in the OSGiBundle-NativeCodeheader. When attempting to start the bundle you get the following error:I confirmed the version of
libjnidispatch.socould be loaded and that our feature utilizing JNA was working after updating the bundle with the changes in this PR. The bundle can now install and start without error.Note that on the same hardware when running a 64bit OS the current JNA bundle can be installed fine since the arch is reported as
aarch64in that case which is already covered.For reference here is how the ARM architecture is normalized by Felix:
https://github.com/apache/felix/blob/6ee15de7548c56129f82957a1af9f2f78db42922/framework/src/main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java#L718
And according to the OSGi reference here it appears that what Felix is doing is correct:
https://www.osgi.org/developer/specifications/reference/
Test setup details:
Apache Karaf 4.2.6 on Ubuntu server 18.04 32bit