Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 1 | From f71b32eb8a5c173fc5733847437b9485d75bb2e5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Leon Anavi <leon.anavi@konsulko.com> |
| 3 | Date: Fri, 9 Apr 2021 14:06:36 +0300 |
| 4 | Subject: [PATCH] setup.py: Fix determining target platform |
| 5 | |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 6 | Do not poke at the build machine to determine target platform or architecture |
| 7 | pass it from environment instead for cross compiling to work |
| 8 | |
| 9 | Upstream-Status: Inappropriate [OE-Specific] |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 11 | Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> |
| 12 | --- |
| 13 | setup.py | 11 +++++++---- |
| 14 | 1 file changed, 7 insertions(+), 4 deletions(-) |
| 15 | |
| 16 | diff --git a/setup.py b/setup.py |
| 17 | index c93d419f32..71a944a9d0 100644 |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 18 | --- a/setup.py |
| 19 | +++ b/setup.py |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 20 | @@ -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 Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 23 | |
| 24 | +BORING_SSL_PLATFORM = os.environ.get('GRPC_BORING_SSL_PLATFORM', |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 25 | + '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 Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 31 | LINUX_X86_64 = 'linux-x86_64' |
| 32 | LINUX_ARM = 'linux-arm' |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 33 | LINUX_AARCH64 = 'linux-aarch64' |
| 34 | - if LINUX_X86_64 == boringssl_asm_platform: |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 35 | + if LINUX_X86_64 == BORING_SSL_PLATFORM: |
| 36 | asm_key = 'crypto_linux_x86_64' |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 37 | - elif LINUX_ARM == boringssl_asm_platform: |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 38 | + elif LINUX_ARM == BORING_SSL_PLATFORM: |
| 39 | asm_key = 'crypto_linux_arm' |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 40 | - 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 Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 45 | asm_key = 'crypto_mac_x86_64' |
| 46 | else: |
| 47 | print("ASM Builds for BoringSSL currently not supported on:", |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 48 | -- |
| 49 | 2.17.1 |
| 50 | |