aboutsummaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-grpcio/boring_ssl.patch
blob: d12e35a993e81dcbe85e43e1c9ee4d9f8d7ebba7 (plain)
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
43
44
45
46
47
48
49
50
From f71b32eb8a5c173fc5733847437b9485d75bb2e5 Mon Sep 17 00:00:00 2001
From: Leon Anavi <leon.anavi@konsulko.com>
Date: Fri, 9 Apr 2021 14:06:36 +0300
Subject: [PATCH] setup.py: Fix determining target platform

Do not poke at the build machine to determine target platform or architecture
pass it from environment instead for cross compiling to work

Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 setup.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index c93d419f32..71a944a9d0 100644
--- a/setup.py
+++ b/setup.py
@@ -116,6 +116,9 @@ def _env_bool_value(env_name, default):
 BUILD_WITH_BORING_SSL_ASM = _env_bool_value('GRPC_BUILD_WITH_BORING_SSL_ASM',
                                             'True')
 
+BORING_SSL_PLATFORM = os.environ.get('GRPC_BORING_SSL_PLATFORM',
+                                           'True')
+
 # Export this environment variable to override the platform variant that will
 # be chosen for boringssl assembly optimizations. This option is useful when
 # crosscompiling and the host platform as obtained by distutils.utils.get_platform()
@@ -336,13 +339,13 @@ if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL:
     LINUX_X86_64 = 'linux-x86_64'
     LINUX_ARM = 'linux-arm'
     LINUX_AARCH64 = 'linux-aarch64'
-    if LINUX_X86_64 == boringssl_asm_platform:
+    if LINUX_X86_64 == BORING_SSL_PLATFORM:
         asm_key = 'crypto_linux_x86_64'
-    elif LINUX_ARM == boringssl_asm_platform:
+    elif LINUX_ARM == BORING_SSL_PLATFORM:
         asm_key = 'crypto_linux_arm'
-    elif LINUX_AARCH64 == boringssl_asm_platform:
+    elif LINUX_AARCH64 == BORING_SSL_PLATFORM:
         asm_key = 'crypto_linux_aarch64'
-    elif "mac" in boringssl_asm_platform and "x86_64" in boringssl_asm_platform:
+    elif "mac" in boringssl_asm_platform and "x86_64" in BORING_SSL_PLATFORM:
         asm_key = 'crypto_mac_x86_64'
     else:
         print("ASM Builds for BoringSSL currently not supported on:",
-- 
2.17.1