!12 add loongarch64 support for jffi
From: @zhangwenlong01 Reviewed-by: @overweight Signed-off-by: @overweight
This commit is contained in:
commit
d8152d8220
71
add-loongarch64-support-for-jffi.patch
Normal file
71
add-loongarch64-support-for-jffi.patch
Normal file
@ -0,0 +1,71 @@
|
||||
From 958aeee20de0c41aa90e54592550445d8f3af850 Mon Sep 17 00:00:00 2001
|
||||
From: Your Name <you@example.com>
|
||||
Date: Tue, 16 May 2023 12:29:01 +0000
|
||||
Subject: [PATCH] add loongarch64 support for jffi
|
||||
|
||||
---
|
||||
jni/GNUmakefile | 2 +-
|
||||
src/main/java/com/kenai/jffi/Platform.java | 4 ++++
|
||||
src/main/java/com/kenai/jffi/internal/StubLoader.java | 4 ++++
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/jni/GNUmakefile b/jni/GNUmakefile
|
||||
index 65b7655..b3a1f4d 100755
|
||||
--- a/jni/GNUmakefile
|
||||
+++ b/jni/GNUmakefile
|
||||
@@ -245,7 +245,7 @@ ifeq ($(CPU), sparcv9)
|
||||
MODEL=64
|
||||
endif
|
||||
|
||||
-ifneq ($(findstring $(CPU), x86_64 amd64 ppc64 ppc64le powerpc64 s390x aarch64),)
|
||||
+ifneq ($(findstring $(CPU), x86_64 amd64 ppc64 ppc64le powerpc64 s390x aarch64 loongarch64),)
|
||||
MODEL = 64
|
||||
endif
|
||||
|
||||
diff --git a/src/main/java/com/kenai/jffi/Platform.java b/src/main/java/com/kenai/jffi/Platform.java
|
||||
index 8447369..7a7de25 100644
|
||||
--- a/src/main/java/com/kenai/jffi/Platform.java
|
||||
+++ b/src/main/java/com/kenai/jffi/Platform.java
|
||||
@@ -100,6 +100,8 @@ public abstract class Platform {
|
||||
ARM(32),
|
||||
/** AARCH64 */
|
||||
AARCH64(64),
|
||||
+ /** LOONGARCH64*/
|
||||
+ LOONGARCH64(64),
|
||||
/** Unknown CPU */
|
||||
UNKNOWN(64);
|
||||
|
||||
@@ -230,6 +232,8 @@ public abstract class Platform {
|
||||
|
||||
} else if (Util.equalsIgnoreCase("aarch64", archString, LOCALE)) {
|
||||
return CPU.AARCH64;
|
||||
+ } else if (Util.equalsIgnoreCase("loongarch64", archString, LOCALE)) {
|
||||
+ return CPU.LOONGARCH64;
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/kenai/jffi/internal/StubLoader.java b/src/main/java/com/kenai/jffi/internal/StubLoader.java
|
||||
index 9b81e83..8d0eaaf 100644
|
||||
--- a/src/main/java/com/kenai/jffi/internal/StubLoader.java
|
||||
+++ b/src/main/java/com/kenai/jffi/internal/StubLoader.java
|
||||
@@ -122,6 +122,8 @@ public class StubLoader {
|
||||
ARM,
|
||||
/** AArch64 */
|
||||
AARCH64,
|
||||
+ /** LoongArch64 */
|
||||
+ LOONGARCH64,
|
||||
/** Unknown CPU */
|
||||
UNKNOWN;
|
||||
|
||||
@@ -184,6 +186,8 @@ public class StubLoader {
|
||||
return CPU.ARM;
|
||||
} else if (Util.equalsIgnoreCase("aarch64", archString, LOCALE)) {
|
||||
return CPU.AARCH64;
|
||||
+ } else if (Util.equalsIgnoreCase("loongarch64", archString, LOCALE)) {
|
||||
+ return CPU.LOONGARCH64;
|
||||
}
|
||||
|
||||
// Try to find by lookup up in the CPU list
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
%global sover 1.2
|
||||
Name: jffi
|
||||
Version: 1.2.13
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: Java Foreign Function Interface
|
||||
License: LGPL-3.0-or-later OR Apache-2.0
|
||||
URL: http://github.com/jnr/jffi
|
||||
@ -13,6 +13,7 @@ Patch1: jffi-add-built-jar-to-test-classpath.patch
|
||||
Patch2: jffi-fix-compilation-flags.patch
|
||||
Patch3: jffi-1.2.12-no_javah.patch
|
||||
Patch4: jffi-fix-system-ffi.patch
|
||||
Patch5: add-loongarch64-support-for-jffi.patch
|
||||
BuildRequires: ant ant-junit fdupes gcc libffi-devel make maven-local unzip mvn(junit:junit)
|
||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
||||
@ -43,6 +44,9 @@ This package contains the API documentation for %{name}.
|
||||
%patch3 -p1
|
||||
%endif
|
||||
%patch4
|
||||
%ifarch loongarch64
|
||||
%patch5 -p1
|
||||
%endif
|
||||
sed -i.cpu -e '/m\$(MODEL)/d' jni/GNUmakefile libtest/GNUmakefile
|
||||
rm -rf archive/* jni/libffi/ jni/win32/ lib/CopyLibs/ lib/junit*
|
||||
find ./ -name '*.jar' -exec rm -f '{}' \;
|
||||
@ -85,6 +89,9 @@ ant -Duse.system.libffi=1 test
|
||||
%doc COPYING.GPL COPYING.LESSER LICENSE
|
||||
|
||||
%changelog
|
||||
* Thu May 18 2023 Wenlong Zhang <zhangwenlong@loongson.cn> - 1.2.13-3
|
||||
- fix build error for loongarch64
|
||||
|
||||
* Thu May 18 2023 wulei <wu_lei@hoperun.com> - 1.2.13-2
|
||||
- Add Buildrequires apache-parent package to fix pkg_vcmp macro not being recognized
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user