BigInteger that takes advantage of the jbigi library for the modPow operation, @@ -629,6 +631,35 @@ public class NativeBigInteger extends BigInteger { // athlon64_64 is always a fallback for 64 bit rv.add(_libPrefix + getMiddleName1() + JBIGI_OPTIMIZATION_ATHLON64 + "_64" + _libSuffix); } + + if (_isArm) { + InputStream in = null; + try { + in = new FileInputStream("/proc/cpuinfo"); + while (true) { + String line = DataHelper.readLine(in); + if (line == null) + break; + if (!line.startsWith("CPU architecture")) + continue; + //CPU architecture: 5TEJ + //CPU architecture: 7 + int colon = line.indexOf(": "); + String sver = line.substring(colon + 2, colon + 3); + int ver = Integer.parseInt(sver); + // add libjbigi-linux-armv7.so, libjbigi-linux-armv6.so, ... + for (int i = ver; i >= 3; i--) { + rv.add(_libPrefix + getMiddleName1() + primary + 'v' + i + _libSuffix); + } + break; + } + } catch (NumberFormatException nfe) { + } catch (IOException ioe) { + } finally { + if (in != null) try { in.close(); } catch (IOException ioe) {} + } + } + // the preferred selection rv.add(_libPrefix + getMiddleName1() + primary + _libSuffix); diff --git a/history.txt b/history.txt index d207ca1e9..9c5f2ecf0 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,7 @@ 2011-07-26 zzz * Installer: The previous wrapper files only work on armv7 + * NativeBigInteger: Move libjbigi-linux-arm.so to libjbigi-linux-armv7.so, + do ARM version detection in NBI. * NetDB: - Explore even more aggressively at startup - Increase SingleSearchJob timeout diff --git a/installer/lib/jbigi/libjbigi-linux-arm.so b/installer/lib/jbigi/libjbigi-linux-armv7.so similarity index 100% rename from installer/lib/jbigi/libjbigi-linux-arm.so rename to installer/lib/jbigi/libjbigi-linux-armv7.so