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 linux mips64el #827

Merged
merged 4 commits into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
<os arch="ppc64le"/>
<os arch="ia64"/>
<os arch="aarch64"/>
<os arch="mips64el"/>
</or>
</and>
</condition>
Expand Down Expand Up @@ -456,6 +457,8 @@ com/sun/jna/linux-ia64/libjnidispatch.so;
processor=ia64;osname=linux,
com/sun/jna/linux-sparcv9/libjnidispatch.so;
processor=sparcv9;osname=linux,
com/sun/jna/linux-mips64el/libjnidispatch.so;
processor=mips64el;osname=linux,

com/sun/jna/freebsd-x86/libjnidispatch.so;
processor=x86;osname=freebsd,
Expand Down Expand Up @@ -515,6 +518,9 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
<zipfileset src="${lib.native}/linux-sparcv9.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-sparcv9"/>
<zipfileset src="${lib.native}/linux-mips64el.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-mips64el"/>
<zipfileset src="${lib.native}/sunos-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-x86"/>
Expand Down Expand Up @@ -704,6 +710,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-ppc64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-ppc64le.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-sparcv9.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/linux-mips64el.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/freebsd-x86.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/freebsd-x86-64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/openbsd-x86.jar" overwrite="true"/>
Expand Down
Binary file added lib/native/linux-mips64el.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/com/sun/jna/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static boolean isCompatibleVersion(String expectedVersion, String nativeVersion)
setProtected(true);
}
MAX_ALIGNMENT = Platform.isSPARC() || Platform.isWindows()
|| (Platform.isLinux() && (Platform.isARM() || Platform.isPPC()))
|| (Platform.isLinux() && (Platform.isARM() || Platform.isPPC() || Platform.isMIPS()))
|| Platform.isAIX()
|| Platform.isAndroid()
? 8 : LONG_SIZE;
Expand Down
3 changes: 3 additions & 0 deletions src/com/sun/jna/NativeLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,9 @@ else if (Platform.isARM()) {
cpu = "arm";
libc = "-gnueabi";
}
else if (Platform.ARCH.equals("mips64el")) {
libc = "-gnuabi64";
}

return cpu + kernel + libc;
}
Expand Down
11 changes: 11 additions & 0 deletions src/com/sun/jna/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public static final boolean is64Bit() {
|| "ia64".equals(ARCH)
|| "ppc64".equals(ARCH) || "ppc64le".equals(ARCH)
|| "sparcv9".equals(ARCH)
|| "mips64".equals(ARCH) || "mips64el".equals(ARCH)
|| "amd64".equals(ARCH)) {
return true;
}
Expand Down Expand Up @@ -225,6 +226,16 @@ public static final boolean isSPARC() {
return ARCH.startsWith("sparc");
}

public static final boolean isMIPS() {
if (ARCH.equals("mips")
|| ARCH.equals("mips64")
|| ARCH.equals("mipsel")
|| ARCH.equals("mips64el")) {
return true;
}
return false;
}

static String getCanonicalArchitecture(String arch, boolean softfloat) {
arch = arch.toLowerCase().trim();
if ("powerpc".equals(arch)) {
Expand Down