-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathboringssl-loongarch.patch
More file actions
43 lines (40 loc) · 1.45 KB
/
boringssl-loongarch.patch
File metadata and controls
43 lines (40 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From d39506c373dc03b1bfab2c01abc2232e36d13ed6 Mon Sep 17 00:00:00 2001
From: WANG Rui <wangrui@loongson.cn>
Date: Sun, 27 Apr 2025 16:09:06 +0800
Subject: [PATCH] Add basic support for LoongArch
Signed-off-by: WANG Rui <wangrui@loongson.cn>
---
src/crypto/fipsmodule/rand/getrandom_fillin.h | 2 ++
src/include/openssl/base.h | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/src/crypto/fipsmodule/rand/getrandom_fillin.h b/src/crypto/fipsmodule/rand/getrandom_fillin.h
index 0f290e963..669a9077c 100644
--- a/src/crypto/fipsmodule/rand/getrandom_fillin.h
+++ b/src/crypto/fipsmodule/rand/getrandom_fillin.h
@@ -30,6 +30,8 @@
#define EXPECTED_NR_getrandom 278
#elif defined(OPENSSL_ARM)
#define EXPECTED_NR_getrandom 384
+#elif defined(OPENSSL_LOONGARCH64)
+#define EXPECTED_NR_getrandom 278
#elif defined(OPENSSL_RISCV64)
#define EXPECTED_NR_getrandom 278
#endif
diff --git a/src/include/openssl/base.h b/src/include/openssl/base.h
index 67429c099..6ef32eeec 100644
--- a/src/include/openssl/base.h
+++ b/src/include/openssl/base.h
@@ -96,6 +96,11 @@ extern "C" {
#elif defined(__ARMEL__) || defined(_M_ARM)
#define OPENSSL_32_BIT
#define OPENSSL_ARM
+#elif defined(__loongarch__) && __SIZEOF_POINTER__ == 8
+#define OPENSSL_64_BIT
+#define OPENSSL_LOONGARCH64
+#elif defined(__loongarch__) && __SIZEOF_POINTER__ == 4
+#define OPENSSL_32_BIT
#elif defined(__MIPSEL__) && !defined(__LP64__)
#define OPENSSL_32_BIT
#define OPENSSL_MIPS
--
2.46.0