blob: d12e35a993e81dcbe85e43e1c9ee4d9f8d7ebba7 [file] [log] [blame]
Andrew Geisslere34f8962021-04-15 15:53:51 -05001From f71b32eb8a5c173fc5733847437b9485d75bb2e5 Mon Sep 17 00:00:00 2001
2From: Leon Anavi <leon.anavi@konsulko.com>
3Date: Fri, 9 Apr 2021 14:06:36 +0300
4Subject: [PATCH] setup.py: Fix determining target platform
5
Andrew Geissler97771a32021-03-05 15:23:11 -06006Do not poke at the build machine to determine target platform or architecture
7pass it from environment instead for cross compiling to work
8
9Upstream-Status: Inappropriate [OE-Specific]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
Andrew Geisslere34f8962021-04-15 15:53:51 -050011Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
12---
13 setup.py | 11 +++++++----
14 1 file changed, 7 insertions(+), 4 deletions(-)
15
16diff --git a/setup.py b/setup.py
17index c93d419f32..71a944a9d0 100644
Andrew Geissler97771a32021-03-05 15:23:11 -060018--- a/setup.py
19+++ b/setup.py
Andrew Geisslere34f8962021-04-15 15:53:51 -050020@@ -116,6 +116,9 @@ def _env_bool_value(env_name, default):
21 BUILD_WITH_BORING_SSL_ASM = _env_bool_value('GRPC_BUILD_WITH_BORING_SSL_ASM',
22 'True')
Andrew Geissler97771a32021-03-05 15:23:11 -060023
24+BORING_SSL_PLATFORM = os.environ.get('GRPC_BORING_SSL_PLATFORM',
Andrew Geisslere34f8962021-04-15 15:53:51 -050025+ 'True')
26+
27 # Export this environment variable to override the platform variant that will
28 # be chosen for boringssl assembly optimizations. This option is useful when
29 # crosscompiling and the host platform as obtained by distutils.utils.get_platform()
30@@ -336,13 +339,13 @@ if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL:
Andrew Geissler97771a32021-03-05 15:23:11 -060031 LINUX_X86_64 = 'linux-x86_64'
32 LINUX_ARM = 'linux-arm'
Andrew Geisslere34f8962021-04-15 15:53:51 -050033 LINUX_AARCH64 = 'linux-aarch64'
34- if LINUX_X86_64 == boringssl_asm_platform:
Andrew Geissler97771a32021-03-05 15:23:11 -060035+ if LINUX_X86_64 == BORING_SSL_PLATFORM:
36 asm_key = 'crypto_linux_x86_64'
Andrew Geisslere34f8962021-04-15 15:53:51 -050037- elif LINUX_ARM == boringssl_asm_platform:
Andrew Geissler97771a32021-03-05 15:23:11 -060038+ elif LINUX_ARM == BORING_SSL_PLATFORM:
39 asm_key = 'crypto_linux_arm'
Andrew Geisslere34f8962021-04-15 15:53:51 -050040- elif LINUX_AARCH64 == boringssl_asm_platform:
41+ elif LINUX_AARCH64 == BORING_SSL_PLATFORM:
42 asm_key = 'crypto_linux_aarch64'
43- elif "mac" in boringssl_asm_platform and "x86_64" in boringssl_asm_platform:
44+ elif "mac" in boringssl_asm_platform and "x86_64" in BORING_SSL_PLATFORM:
Andrew Geissler97771a32021-03-05 15:23:11 -060045 asm_key = 'crypto_mac_x86_64'
46 else:
47 print("ASM Builds for BoringSSL currently not supported on:",
Andrew Geisslere34f8962021-04-15 15:53:51 -050048--
492.17.1
50