Skip to content
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
6 changes: 5 additions & 1 deletion core/src/main/java/org/jruby/ext/ffi/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public enum CPU_TYPE {
S390X,
ARM,
AARCH64,
LOONGARCH64,
UNKNOWN;
@Override
public String toString() { return name().toLowerCase(LOCALE); }
Expand Down Expand Up @@ -155,7 +156,9 @@ private static final CPU_TYPE determineCPU() {
return CPU.ARM;
} else if ("aarch64".equals(archString)) {
return CPU.AARCH64;
} else if ("universal".equals(archString)) {
} else if ("loongarch64".equals(archString)) {
return CPU.LOONGARCH64;
} else if ("universal".equals(archString)) {
// OS X OpenJDK7 builds report "universal" right now
String bits = SafePropertyAccessor.getProperty("sun.arch.data.model");
if ("32".equals(bits)) {
Expand Down Expand Up @@ -214,6 +217,7 @@ private static int determineArchDataModel() {
case SPARCV9:
case S390X:
case AARCH64:
case LOONGARCH64:
dataModel = 64;
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public static String getArchitecture() {
if (architecture == null) architecture = "unknown";
if ("amd64".equals(architecture)) architecture = "x86_64";
if ("aarch64".equals(architecture) && Platform.IS_MAC) architecture = "arm64";
if ("loongarch64".equals(architecture)) architecture = "loongarch64";

return architecture;
}
Expand Down
2 changes: 2 additions & 0 deletions install/jruby.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<entry location="lib/jni/i386-SunOS" />
<entry location="lib/jni/i386-FreeBSD" />
<entry location="lib/jni/i386-OpenBSD" />
<entry location="lib/jni/loongarch64-Linux" />
<entry location="lib/jni/ppc-AIX" />
<entry location="lib/jni/ppc64-Linux" />
<entry location="lib/jni/ppc64le-Linux" />
Expand All @@ -106,6 +107,7 @@
<entry location="lib/jni/i386-OpenBSD" />
<entry location="lib/jni/i386-SunOS" />
<entry location="lib/jni/i386-Windows" />
<entry location="lib/jni/loongarch64-Linux" />
<entry location="lib/jni/ppc64-Linux" />
<entry location="lib/jni/ppc64le-Linux" />
<entry location="lib/jni/ppc-AIX" />
Expand Down
2 changes: 2 additions & 0 deletions spec/ffi/fixtures/compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module TestLibrary
end
when /amd64|x86_64|x64/
"x86_64"
when /loongarch64/
"loongarch64"
when /ppc64|powerpc64/
"powerpc64"
when /ppc|powerpc/
Expand Down