Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame^] | 1 | Do not poke at the build machine to determine target platform or architecture |
| 2 | pass it from environment instead for cross compiling to work |
| 3 | |
| 4 | Upstream-Status: Inappropriate [OE-Specific] |
| 5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 6 | --- a/setup.py |
| 7 | +++ b/setup.py |
| 8 | @@ -109,6 +109,8 @@ CLASSIFIERS = [ |
| 9 | BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', |
| 10 | True) |
| 11 | |
| 12 | +BORING_SSL_PLATFORM = os.environ.get('GRPC_BORING_SSL_PLATFORM', |
| 13 | + True) |
| 14 | # Environment variable to determine whether or not the Cython extension should |
| 15 | # *use* Cython or use the generated C files. Note that this requires the C files |
| 16 | # to have been generated by building first *with* Cython support. Even if this |
| 17 | @@ -306,15 +308,15 @@ asm_key = '' |
| 18 | if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL: |
| 19 | LINUX_X86_64 = 'linux-x86_64' |
| 20 | LINUX_ARM = 'linux-arm' |
| 21 | - if LINUX_X86_64 == util.get_platform(): |
| 22 | + if LINUX_X86_64 == BORING_SSL_PLATFORM: |
| 23 | asm_key = 'crypto_linux_x86_64' |
| 24 | - elif LINUX_ARM == util.get_platform(): |
| 25 | + elif LINUX_ARM == BORING_SSL_PLATFORM: |
| 26 | asm_key = 'crypto_linux_arm' |
| 27 | - elif "mac" in util.get_platform() and "x86_64" in util.get_platform(): |
| 28 | + elif "mac" in BORING_SSL_PLATFORM and "x86_64" in BORING_SSL_PLATFORM: |
| 29 | asm_key = 'crypto_mac_x86_64' |
| 30 | else: |
| 31 | print("ASM Builds for BoringSSL currently not supported on:", |
| 32 | - util.get_platform()) |
| 33 | + BORING_SSL_PLATFORM) |
| 34 | if asm_key: |
| 35 | asm_files = grpc_core_dependencies.ASM_SOURCE_FILES[asm_key] |
| 36 | else: |