add sw_64 loongarch64 support and master 代码归一

This commit is contained in:
panchenbo 2023-09-25 11:31:10 +08:00
parent 003d99f096
commit 9c877f429c
5 changed files with 86 additions and 5588 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
diff -Naur libecap-1.0.1.org/cfgaux/config.guess libecap-1.0.1.sw/cfgaux/config.guess
--- libecap-1.0.1.org/cfgaux/config.guess 2022-03-09 03:56:18.232357080 +0000
+++ libecap-1.0.1.sw/cfgaux/config.guess 2022-03-09 05:38:33.942357080 +0000
@@ -917,6 +917,14 @@
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit ;;
+ sw_64:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ sw) UNAME_MACHINE=sw_64 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-sunway-linux-gnu${LIBC}
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
diff -Naur libecap-1.0.1.org/cfgaux/config.sub libecap-1.0.1.sw/cfgaux/config.sub
--- libecap-1.0.1.org/cfgaux/config.sub 2022-03-09 03:56:18.232357080 +0000
+++ libecap-1.0.1.sw/cfgaux/config.sub 2022-03-09 05:37:39.462357080 +0000
@@ -242,6 +242,7 @@
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | sw_64 \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
@@ -322,6 +323,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | sw_64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \

View File

@ -0,0 +1,34 @@
diff --git a/cfgaux/config.guess b/cfgaux/config.guess
index e8d59a5..8885282 100755
--- a/cfgaux/config.guess
+++ b/cfgaux/config.guess
@@ -885,6 +885,9 @@ EOF
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
diff --git a/cfgaux/config.sub b/cfgaux/config.sub
index 7546199..6b4e215 100755
--- a/cfgaux/config.sub
+++ b/cfgaux/config.sub
@@ -257,6 +257,7 @@ case $basic_machine in
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
+ | loongarch32 | loongarch64 \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -343,6 +344,7 @@ case $basic_machine in
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | loongarch32-* | loongarch64-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \

View File

@ -38,6 +38,8 @@
#include "libecap/common/autoconf-arm.h" #include "libecap/common/autoconf-arm.h"
#elif defined(__alpha__) #elif defined(__alpha__)
#include "libecap/common/autoconf-alpha.h" #include "libecap/common/autoconf-alpha.h"
#elif defined(__sw_64__)
#include "libecap/common/autoconf-sw_64.h"
#elif defined(__sparc__) && defined (__arch64__) #elif defined(__sparc__) && defined (__arch64__)
#include "libecap/common/autoconf-sparc64.h" #include "libecap/common/autoconf-sparc64.h"
#elif defined(__sparc__) #elif defined(__sparc__)

View File

@ -1,14 +1,15 @@
Name: libecap Name: libecap
Version: 1.0.1 Version: 1.0.1
Release: 7 Release: 8
Summary: an loadable eCAP adapter for Squid HTTP-Proxy Summary: an loadable eCAP adapter for Squid HTTP-Proxy
License: BSD License: BSD
URL: http://www.e-cap.org/ URL: http://www.e-cap.org/
Source0: http://www.e-cap.org/archive/%{name}-%{version}.tar.gz Source0: http://www.e-cap.org/archive/%{name}-%{version}.tar.gz
Source1: autoconf.h Source1: autoconf.h
BuildRequires: gcc gcc-c++ Patch1000: 1000-add-sw_64-support-not-upstream-modified-files.patch
Patch0: 0001-update-config.guess-and-config.sub-file.patch Patch1001: 1001-add-loongarch64-support-not-upstream-modified-files.patch
BuildRequires: git gcc gcc-c++
%description %description
eCAP is a software interface that allows a network application, eCAP is a software interface that allows a network application,
@ -28,10 +29,7 @@ BuildArch: noarch
Help files for %{name} Help files for %{name}
%prep %prep
%setup -q %autosetup -n %{name}-%{version} -p1 -Sgit
%ifarch loongarch64
%patch0 -p1
%endif
%build %build
%configure %configure
@ -67,15 +65,18 @@ make check
%doc README %doc README
%changelog %changelog
* Mon Jul 03 2023 wangyangdahai <wangyang22@iscas.ac.cn> - 1.0.1-7 * Mon Sep 25 2023 panchenbo <panchenbo@kylinsec.com.cn> - 1.0.1-8
- fix riscv64 arch autoconf.h include path - add loongarch64 sw_64 support and code integration
* Fri Jan 6 2023 doupengda <doupengda@loongson.cn> 1.0.1-6 * Fri Jan 6 2023 doupengda <doupengda@loongson.cn> 1.0.1-7
- update config.guess and config.sub - update config.guess and config.sub
- fix SOURCE1 file autoconf.h '__loongarch64__' to '__loongarch64' - fix SOURCE1 file autoconf.h '__loongarch64__' to '__loongarch64'
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.0.1-5 * Fri Dec 16 2022 zhangzhixin <zhixin.zhang@i-soft.com.cn> - 1.0.1-6
- DESC: delete -Sgit from %autosetup, and delete BuildRequires git - Add sw64 arch patch
* Thu Dec 1 2022 zhaozhen <zhaozhen@loongson.cn> - 1.0.1-5
- Add loongarch64 support
* Wed Aug 28 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.0.1-4 * Wed Aug 28 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.0.1-4
- Package init - Package init