Setup new arch in java loadlibrary
This commit is contained in:
parent
7660e4336a
commit
89f96a3073
@ -22,6 +22,9 @@ package it.ernytech.tdlib.utils;
|
|||||||
*/
|
*/
|
||||||
public enum Arch {
|
public enum Arch {
|
||||||
amd64,
|
amd64,
|
||||||
i686,
|
i386,
|
||||||
|
armhf,
|
||||||
|
aarch64,
|
||||||
|
ppc64el
|
||||||
unknown
|
unknown
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ package it.ernytech.tdlib.utils;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,10 +100,32 @@ public class LoadLibrary {
|
|||||||
return Arch.amd64;
|
return Arch.amd64;
|
||||||
}
|
}
|
||||||
|
|
||||||
case "x86" : {
|
case "x86_64" : {
|
||||||
return Arch.i686;
|
return Arch.amd64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "i386" : {
|
||||||
|
return Arch.i386;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "x86" : {
|
||||||
|
return Arch.i386;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "arm" : {
|
||||||
|
return Arch.armhf;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "aarch64" : {
|
||||||
|
return Arch.aarch64;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "ppc64" : {
|
||||||
|
if (!ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { // Java always returns ppc64 for all 64-bit powerpc but
|
||||||
|
return Arch.ppc64el; // powerpc64le (our target) is very different, it uses
|
||||||
|
} // little-endian unlike powerpc64, so we just check
|
||||||
|
} // this condition to accurately identify the architecture
|
||||||
|
|
||||||
default : {
|
default : {
|
||||||
return Arch.unknown;
|
return Arch.unknown;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user