apache-commons-daemon/apache-commons-daemon-loongarch64.patch
panchenbo 39f21af1b1 add support for loongarch64 sw_64
(cherry picked from commit e5676fb9a828df7232f3687a218d4091f5a49cf3)
2023-09-21 13:57:51 +08:00

81 lines
2.7 KiB
Diff

From 5e01f749dc35cc1ed56caaf0bcf3da87511c8f4c Mon Sep 17 00:00:00 2001
From: herengui <herengui@kylinsec.com.cn>
Date: Wed, 17 May 2023 18:22:37 +0800
Subject: [PATCH] add loongarch64 support
Signed-off-by: herengui <herengui@kylinsec.com.cn>
---
src/native/unix/configure | 7 ++++++-
src/native/unix/support/apsupport.m4 | 5 ++++-
src/native/unix/support/config.guess | 3 +++
src/native/unix/support/config.sub | 1 +
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/native/unix/configure b/src/native/unix/configure
index 4913319..62f88a0 100755
--- a/src/native/unix/configure
+++ b/src/native/unix/configure
@@ -2713,7 +2713,12 @@ echo "$as_me: error: Unsupported operating system \"$host_os\"" >&2;}
sw64 | sw_64*)
CFLAGS="$CFLAGS -DCPU=\\\"sw_64\\\""
supported_os="sw_64"
- HOST_CPU=sw_64;;
+ HOST_CPU=sw_64
+ ;;
+ loongarch64)
+ CFLAGS="$CFLAGS -DCPU=\\\"loongarch64\\\""
+ supported_os="loongarch64"
+ HOST_CPU=loongarch64;;
*)
echo "$as_me:$LINENO: result: failed" >&5
echo "${ECHO_T}failed" >&6
diff --git a/src/native/unix/support/apsupport.m4 b/src/native/unix/support/apsupport.m4
index b43ea86..119e012 100644
--- a/src/native/unix/support/apsupport.m4
+++ b/src/native/unix/support/apsupport.m4
@@ -178,11 +178,14 @@ AC_DEFUN(AP_SUPPORTED_HOST,[
CFLAGS="$CFLAGS -DCPU=\\\"aarch64\\\""
supported_os="aarch64"
HOST_CPU=aarch64;;
- *)
sw64 | sw_64*)
CFLAGS="$CFLAGS -DCPU=\\\"sw_64\\\""
supported_os="sw_64"
HOST_CPU=sw_64;;
+ loongarch64)
+ CFLAGS="$CFLAGS -DCPU=\\\"loongarch64\\\""
+ supported_os="loongarch64"
+ HOST_CPU=loongarch64;;
*)
AC_MSG_RESULT([failed])
AC_MSG_ERROR([Unsupported CPU architecture "$host_cpu"]);;
diff --git a/src/native/unix/support/config.guess b/src/native/unix/support/config.guess
index 19474d3..306f46a 100755
--- a/src/native/unix/support/config.guess
+++ b/src/native/unix/support/config.guess
@@ -868,6 +868,9 @@ EOF
sw_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
+ loongarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-gnu
diff --git a/src/native/unix/support/config.sub b/src/native/unix/support/config.sub
index cd54017..2d02c4e 100755
--- a/src/native/unix/support/config.sub
+++ b/src/native/unix/support/config.sub
@@ -249,6 +249,7 @@ case $basic_machine in
1750a | 580 \
| a29k \
| sw_64 | sw64 \
+ | loongarch64 \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
--
2.40.1