diff --git a/0001-add-loongarch64-support-for-tongsuo3.patch b/0001-add-loongarch64-support-for-tongsuo3.patch new file mode 100644 index 0000000000000000000000000000000000000000..eb6d8fb5ff17c24abfcfa2989e495e3d155f7865 --- /dev/null +++ b/0001-add-loongarch64-support-for-tongsuo3.patch @@ -0,0 +1,73 @@ +From 9d1b7f984d63d6a1b5dd991c977922c28b9ac10a Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Thu, 16 Nov 2023 08:28:12 +0000 +Subject: [PATCH] add loongarch64 support for tongsuo3 + +--- + Configurations/10-main.conf | 8 ++++++++ + crypto/sha/keccak1600.c | 2 +- + util/perl/OpenSSL/config.pm | 2 ++ + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf +index aa46435..4f51085 100644 +--- a/Configurations/10-main.conf ++++ b/Configurations/10-main.conf +@@ -514,6 +514,10 @@ my %targets = ( + inherit_from => [ "linux-generic64"], + perlasm_scheme => "linux64", + }, ++ "linux-loongarch64" => { ++ inherit_from => [ "linux-generic64"], ++ perlasm_scheme => "linux64", ++ }, + + #### IA-32 targets... + #### These two targets are a bit aged and are to be used on older Linux +@@ -715,6 +719,10 @@ my %targets = ( + inherit_from => [ "BSD-generic64"], + perlasm_scheme => "linux64", + }, ++ "BSD-loongarch64" => { ++ inherit_from => [ "BSD-generic64"], ++ perlasm_scheme => "linux64", ++ }, + + "bsdi-elf-gcc" => { + inherit_from => [ "BASE_unix" ], +diff --git a/crypto/sha/keccak1600.c b/crypto/sha/keccak1600.c +index e3dd6f1..ccba24e 100644 +--- a/crypto/sha/keccak1600.c ++++ b/crypto/sha/keccak1600.c +@@ -28,7 +28,7 @@ void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r); + #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ + (defined(__x86_64) && !defined(__BMI__)) || defined(_M_X64) || \ + defined(__mips) || defined(__riscv) || defined(__s390__) || \ +- defined(__EMSCRIPTEN__) ++ defined(__EMSCRIPTEN__) || defined(__loongarch64) + /* + * These don't have "and with complement" instruction, so minimize amount + * of "not"-s. Implemented only in the [default] KECCAK_2X variant. +diff --git a/util/perl/OpenSSL/config.pm b/util/perl/OpenSSL/config.pm +index 6fbfa82..6e4b688 100755 +--- a/util/perl/OpenSSL/config.pm ++++ b/util/perl/OpenSSL/config.pm +@@ -617,6 +617,7 @@ EOF + ], + [ '.*86-.*-linux1', { target => "linux-aout" } ], + [ 'riscv64-.*-linux.', { target => "linux64-riscv64" } ], ++ [ 'loongarch64-.*-linux.', { target => "linux-loongarch64" } ], + [ '.*-.*-linux.', { target => "linux-generic32" } ], + [ '.*86.*-.*-solaris2', + sub { +@@ -646,6 +647,7 @@ EOF + [ 'powerpc64-.*-.*bsd.*', { target => "BSD-generic64", + defines => [ 'B_ENDIAN' ] } ], + [ 'riscv64-.*-.*bsd.*', { target => "BSD-riscv64" } ], ++ [ 'loongarch64-.*-.*bsd.*', { target => "BSD-loongarch64" } ], + [ 'ia64-.*-.*bsd.*', { target => "BSD-ia64" } ], + [ 'x86_64-.*-dragonfly.*', { target => "BSD-x86_64" } ], + [ 'amd64-.*-.*bsd.*', { target => "BSD-x86_64" } ], +-- +2.41.0 + diff --git a/tongsuo3.spec b/tongsuo3.spec index 465453831112b53d3a6a85998712b64211abe91f..24b2bf1df5f80ff79a496c326fd0e352d077229d 100644 --- a/tongsuo3.spec +++ b/tongsuo3.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %define install_prefix /opt/tongsuo3 @@ -22,6 +22,7 @@ Url: https://www.yuque.com/tsdoc Source0: https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/8.4.0-pre2.tar.gz Patch1: 0001-use-relative-path-for-tongsuo-symlink.patch +Patch2: 0001-add-loongarch64-support-for-tongsuo3.patch # For build BuildRequires: perl(Config) @@ -59,6 +60,9 @@ sslarch=linux-x86_64 %ifarch aarch64 sslarch=linux-aarch64 %endif +%ifarch longarch64 +sslarch=linux-loongarch64 +%endif ./Configure \ --prefix=%{install_prefix} -Wl,-rpath,%{install_prefix}/lib64 \ @@ -89,6 +93,9 @@ export QA_RPATHS=$(( 0x0002 )) %dir %{install_prefix} %changelog +* Thu Nov 16 2023 Wenlong Zhang - 8.4.0~pre2-3 +- add loongarch64 support for tongsuo3 + * Tue Aug 29 2023 Tianjia Zhang - 8.4.0~pre2-2 - Fix for dynamic link path