-
Notifications
You must be signed in to change notification settings - Fork 446
UnsatisfiedLinkError: /tmp/libpi4j.so #26
Comments
Hi drvonnostrand, I have updated the source code to include two new pieces of logic to help detect hard-float. .. on hard-float ABI : .. on soft-float ABI : On the hasReadElfTag() check, I am keying off this tag instead: "Tag_ABI_HardFP_use". I did deploy a new 0.0.5-SNAPSHOT build to include this fix. Look Good? |
Hi Robert, Great. I took a look at the code and it looks good. A couple minor comments:
Thanks for all your work. cheers, On Sun, Dec 30, 2012 at 09:53:02AM -0800, Robert Savage wrote:
|
Hi Rick, thanks for the feedback. I actually intended to make those private but forgot to go back and do it before the commit. I have now made them private and added the additional logic to handle the cases where a value may not be a value after the split(). Thanks, Robert |
The logic in public static boolean isHardFloatAbi() in SystemInfo.java fails against Oracle's jdk1.8.0(hard-float) running Wheezy. Looks like others out there are discussing the best way to determine hard vs soft float at runtime as well.
One solution is to use 'readelf -A /proc/self/exe' and check for Tag_ABI_VPF_args or
'readelf -a /usr/bin/readelf | grep armh'. I decided to use the former. See:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=20873&p=201219
for all the details.
I added the following method to SystemInfo.java:
public static boolean hasReadElfTag(String tag) {
boolean hasTag = false;
try {
String cmd =
"/usr/bin/readelf -A /proc/self/exe";
Process p=Runtime.getRuntime().exec(cmd);
p.waitFor();
BufferedReader reader=
new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = reader.readLine();
while(line != null) {
if (line.contains(tag)) {
hasTag = true;
break;
}
line = reader.readLine();
}
}
catch (IOException ioe) {
}
catch (InterruptedException ie) {
}
return hasTag;
}
and then added this to the checks in isHardFloatAbi() like so:
if ( contains(System.getProperty("sun.boot.library.path"),
gnueabihf) ||
contains(System.getProperty("java.library.path"),
gnueabihf) ||
contains(System.getProperty("java.home"), gnueabihf) ||
hasReadElfTag("Tag_ABI_VFP_args")) {
return true;
}
recompiled and tested just fine but only on my pi. If checking the tag is robust enough then the other checks can be removed as well.
The text was updated successfully, but these errors were encountered: