From 35c0a4cfff7a8c58150a8665d66e427b0cc391a6 Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Tue, 14 Jul 2020 21:39:43 +0000 Subject: [PATCH 01/10] Adds option of using ASM for BoringSSL in Python. - Adds a new environment variable for turning on the build of ASM for boring SSL. - Only enables for x86_64 for now. I think this is likely the most common target and the only machine I have readily accessible. --- setup.py | 31 +++- src/boringssl/gen_build_yaml.py | 3 + src/python/grpcio/grpc_core_dependencies.py | 146 ++++++++++++++++++ .../grpcio/grpc_core_dependencies.py.template | 10 ++ tools/buildgen/plugins/check_attrs.py | 1 + 5 files changed, 189 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 90df0a1042e..40e5fcd3fe0 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,13 @@ # undesirable behaviors or errors. import setuptools +# Monkey Patch the unix compiler to accept ASM +# files used by boring SSL. +from distutils.unixccompiler import UnixCCompiler +UnixCCompiler.src_extensions.append('.S') +del UnixCCompiler + +from distutils import ccompiler from distutils import cygwinccompiler from distutils import extension as _extension from distutils import util @@ -97,6 +104,8 @@ CLASSIFIERS = [ 'License :: OSI Approved :: Apache Software License', ] +BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', False) + # Environment variable to determine whether or not the Cython extension should # *use* Cython or use the generated C files. Note that this requires the C files # to have been generated by building first *with* Cython support. Even if this @@ -261,9 +270,26 @@ if BUILD_WITH_SYSTEM_ZLIB: if BUILD_WITH_SYSTEM_CARES: EXTENSION_LIBRARIES += ('cares',) -DEFINE_MACROS = (('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600)) +DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) +asm_files = [] +NO_BORING_ASM = True +if BUILD_WITH_BORING_SSL_ASM: + LINUX_X86_64 = "linux-x86_64" + if LINUX_X86_64 == util.get_platform(): + asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES + if (LINUX_X86_64 in f or "hrss/asm" in f) + and "test" not in f] + print(asm_files) + NO_BORING_ASM = False + else: + print("ASM Builds for BoringSSL currently only supported " + "on linux-x86-64. Found:", util.get_platform()) +if NO_BORING_ASM: + DEFINE_MACROS += (('OPENSSL_NO_ASM', 1),) + if not DISABLE_LIBC_COMPATIBILITY: DEFINE_MACROS += (('GPR_BACKWARDS_COMPATIBILITY_MODE', 1),) + if "win32" in sys.platform: # TODO(zyc): Re-enable c-ares on x64 and x86 windows after fixing the # ares_library_init compilation issue @@ -328,7 +354,8 @@ def cython_extensions_and_necessity(): extensions = [ _extension.Extension( name=module_name, - sources=[module_file] + list(CYTHON_HELPER_C_FILES) + core_c_files, + sources=([module_file] + list(CYTHON_HELPER_C_FILES) + + core_c_files + asm_files), include_dirs=list(EXTENSION_INCLUDE_DIRECTORIES), libraries=list(EXTENSION_LIBRARIES), define_macros=list(DEFINE_MACROS), diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py index 0b869fa64f3..404226f645d 100755 --- a/src/boringssl/gen_build_yaml.py +++ b/src/boringssl/gen_build_yaml.py @@ -65,6 +65,9 @@ class Grpc(object): 'src': sorted( map_dir(f) for f in files['ssl'] + files['crypto']), + 'asm_src': + sorted(map_dir(f) + for _, srcs in asm_outputs for f in srcs), 'headers': sorted( map_dir(f) diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 59034638175..10c8e43299e 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -905,3 +905,149 @@ CORE_SOURCE_FILES = [ 'third_party/zlib/uncompr.c', 'third_party/zlib/zutil.c', ] +ASM_SOURCE_FILES = [ + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S', + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S', + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S', + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/md5-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha1-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha256-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/md5-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S', + 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S', + 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S', + 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S', + 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/md5-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm', +] diff --git a/templates/src/python/grpcio/grpc_core_dependencies.py.template b/templates/src/python/grpcio/grpc_core_dependencies.py.template index a62b54e45b0..36c2e38ae92 100644 --- a/templates/src/python/grpcio/grpc_core_dependencies.py.template +++ b/templates/src/python/grpcio/grpc_core_dependencies.py.template @@ -17,14 +17,24 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!! <% srcs = [] + asm_srcs = [] for lib in libs: if lib.name in python_dependencies.transitive_deps: for src in lib.src: srcs.append(src) + if hasattr(lib, 'asm_src'): + for src in lib.asm_src: + asm_srcs.append(src) srcs = sorted(set(srcs)) + asm_srcs = sorted(set(asm_srcs)) %> CORE_SOURCE_FILES = [ % for src in srcs: '${src}', % endfor ] + ASM_SOURCE_FILES = [ + % for src in asm_srcs: + '${src}', + % endfor + ] diff --git a/tools/buildgen/plugins/check_attrs.py b/tools/buildgen/plugins/check_attrs.py index 467406f4b93..a9acd1ea550 100644 --- a/tools/buildgen/plugins/check_attrs.py +++ b/tools/buildgen/plugins/check_attrs.py @@ -38,6 +38,7 @@ VALID_ATTRIBUTE_KEYS_MAP = { 'uses': anything(), }, 'lib': { + 'asm_src': anything(), 'baselib': anything(), 'boringssl': one_of((True,)), 'build_system': anything(), From 8cd8736c2bb75c594b5212d2edbcbdb943d59a18 Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Thu, 16 Jul 2020 04:12:30 +0000 Subject: [PATCH 02/10] address comments --- setup.py | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 40e5fcd3fe0..42e34b11b7a 100644 --- a/setup.py +++ b/setup.py @@ -22,8 +22,10 @@ import setuptools from distutils.unixccompiler import UnixCCompiler UnixCCompiler.src_extensions.append('.S') del UnixCCompiler +from distutils.msvccompiler import MSVCCompiler +MSVCCompiler.src_extensions.append('.asm') +del MSVCCompiler -from distutils import ccompiler from distutils import cygwinccompiler from distutils import extension as _extension from distutils import util @@ -104,7 +106,7 @@ CLASSIFIERS = [ 'License :: OSI Approved :: Apache Software License', ] -BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', False) +BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', True) # Environment variable to determine whether or not the Cython extension should # *use* Cython or use the generated C files. Note that this requires the C files @@ -274,16 +276,27 @@ DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) asm_files = [] NO_BORING_ASM = True if BUILD_WITH_BORING_SSL_ASM: - LINUX_X86_64 = "linux-x86_64" - if LINUX_X86_64 == util.get_platform(): - asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES - if (LINUX_X86_64 in f or "hrss/asm" in f) - and "test" not in f] - print(asm_files) - NO_BORING_ASM = False - else: - print("ASM Builds for BoringSSL currently only supported " - "on linux-x86-64. Found:", util.get_platform()) + LINUX_X86_64 = "linux-x86_64" + LINUX_ARM = "linux-arm" + if LINUX_X86_64 == util.get_platform() or LINUX_ARM == util.get_platform(): + platform = LINUX_X86_64 if LINUX_X86_64 == util.get_platform() else LINUX_ARM + asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES + if (platform in f or "hrss/asm" in f) + and "test" not in f] + NO_BORING_ASM = False + elif "mac" in util.get_platform() and "x86_64" in util.get_platform(): + asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES + if (LINUX_X86_64 in f or "hrss/asm" in f) + and "test" not in f] + NO_BORING_ASM = False + elif "win" in sys.platform and '64bit' in platform.architecture()[0]: + asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES + if ("win-x86_64" in f) + and "test" not in f] + NO_BORING_ASM = False + else: + print("ASM Builds for BoringSSL currently not supported on:", + util.get_platform()) if NO_BORING_ASM: DEFINE_MACROS += (('OPENSSL_NO_ASM', 1),) From cdf2f2f8a34170d9e152efb1d283c66ca05dfa34 Mon Sep 17 00:00:00 2001 From: emkornfield Date: Thu, 16 Jul 2020 11:03:15 -0700 Subject: [PATCH 03/10] Update setup.py Remove windows. Use proper filter for mac. --- setup.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 42e34b11b7a..629b8f7ad89 100644 --- a/setup.py +++ b/setup.py @@ -22,9 +22,6 @@ import setuptools from distutils.unixccompiler import UnixCCompiler UnixCCompiler.src_extensions.append('.S') del UnixCCompiler -from distutils.msvccompiler import MSVCCompiler -MSVCCompiler.src_extensions.append('.asm') -del MSVCCompiler from distutils import cygwinccompiler from distutils import extension as _extension @@ -286,12 +283,7 @@ if BUILD_WITH_BORING_SSL_ASM: NO_BORING_ASM = False elif "mac" in util.get_platform() and "x86_64" in util.get_platform(): asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES - if (LINUX_X86_64 in f or "hrss/asm" in f) - and "test" not in f] - NO_BORING_ASM = False - elif "win" in sys.platform and '64bit' in platform.architecture()[0]: - asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES - if ("win-x86_64" in f) + if ("mac-x86_64" in f or "hrss/asm" in f) and "test" not in f] NO_BORING_ASM = False else: From 8e501c86f5ee7377d14d417f51ce4caab534d786 Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Fri, 17 Jul 2020 18:17:39 +0000 Subject: [PATCH 04/10] Move over to using sources.json from boring.ssl. - Undo a bunch of hacks in src/boringssl/gen_build_yaml.py - Store the structued data in YAML/dependencies.py so we don't need to recreate the filters. - Update setup.py accordingly --- setup.py | 25 ++- src/boringssl/gen_build_yaml.py | 9 +- src/python/grpcio/grpc_core_dependencies.py | 201 ++++++++++-------- .../grpcio/grpc_core_dependencies.py.template | 17 +- 4 files changed, 141 insertions(+), 111 deletions(-) diff --git a/setup.py b/setup.py index 629b8f7ad89..89051ecc3ba 100644 --- a/setup.py +++ b/setup.py @@ -272,24 +272,23 @@ if BUILD_WITH_SYSTEM_CARES: DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) asm_files = [] NO_BORING_ASM = True + +asm_key = '' if BUILD_WITH_BORING_SSL_ASM: - LINUX_X86_64 = "linux-x86_64" - LINUX_ARM = "linux-arm" - if LINUX_X86_64 == util.get_platform() or LINUX_ARM == util.get_platform(): - platform = LINUX_X86_64 if LINUX_X86_64 == util.get_platform() else LINUX_ARM - asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES - if (platform in f or "hrss/asm" in f) - and "test" not in f] - NO_BORING_ASM = False + LINUX_X86_64 = 'linux-x86_64' + LINUX_ARM = 'linux-arm' + if LINUX_X86_64 == util.get_platform(): + asm_key = 'crypto_linux_x86_64' + elif LINUX_ARM == util.get_platform(): + asm_key = 'crypto_linux_arm' elif "mac" in util.get_platform() and "x86_64" in util.get_platform(): - asm_files = [f for f in grpc_core_dependencies.ASM_SOURCE_FILES - if ("mac-x86_64" in f or "hrss/asm" in f) - and "test" not in f] - NO_BORING_ASM = False + asm_key = 'crypto_mac_x86_64' else: print("ASM Builds for BoringSSL currently not supported on:", util.get_platform()) -if NO_BORING_ASM: +if asm_key: + asm_files = grpc_core_dependencies.ASM_SOURCE_FILES[asm_key] +else: DEFINE_MACROS += (('OPENSSL_NO_ASM', 1),) if not DISABLE_LIBC_COMPATIBILITY: diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py index 404226f645d..18adae47eaa 100755 --- a/src/boringssl/gen_build_yaml.py +++ b/src/boringssl/gen_build_yaml.py @@ -46,6 +46,11 @@ class Grpc(object): def WriteFiles(self, files): test_binaries = ['ssl_test', 'crypto_test'] + asm_outputs = {key: value + for key, value in files.items() + if any( + f.endswith(".S") or f.endswith(".asm") + for f in value)} self.yaml = { '#': 'generated with src/boringssl/gen_build_yaml.py', @@ -66,8 +71,8 @@ class Grpc(object): sorted( map_dir(f) for f in files['ssl'] + files['crypto']), 'asm_src': - sorted(map_dir(f) - for _, srcs in asm_outputs for f in srcs), + {k: [map_dir(f) for f in value] + for k, value in asm_outputs.items()}, 'headers': sorted( map_dir(f) diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 10c8e43299e..aa8aad5c38c 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -905,53 +905,79 @@ CORE_SOURCE_FILES = [ 'third_party/zlib/uncompr.c', 'third_party/zlib/zutil.c', ] -ASM_SOURCE_FILES = [ + +ASM_SOURCE_FILES = { + 'crypto_ios_aarch64': [ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S', 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S', + ], + 'crypto_mac_x86_64': [ + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S', + ], + 'crypto_win_x86': [ + 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm', + ], + 'crypto_linux_ppc64le': [ + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S', 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S', 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S', - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S', + ], + 'crypto_mac_x86': [ + 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S', + ], + 'crypto_linux_x86': [ 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S', 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S', 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S', 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S', @@ -963,10 +989,25 @@ ASM_SOURCE_FILES = [ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S', 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S', 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S', + ], + 'crypto_ios_arm': [ + 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S', + ], + 'crypto_linux_x86_64': [ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', @@ -980,60 +1021,15 @@ ASM_SOURCE_FILES = [ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S', 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S', 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S', - 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm', + ], + 'crypto_win_x86_64': [ 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm', @@ -1047,7 +1043,34 @@ ASM_SOURCE_FILES = [ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm', 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm', -] + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm', + ], + 'crypto_linux_aarch64': [ + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S', + ], + 'crypto_linux_arm': [ + 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S', + 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S', + 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S', + ], +} diff --git a/templates/src/python/grpcio/grpc_core_dependencies.py.template b/templates/src/python/grpcio/grpc_core_dependencies.py.template index 36c2e38ae92..3263c57ae44 100644 --- a/templates/src/python/grpcio/grpc_core_dependencies.py.template +++ b/templates/src/python/grpcio/grpc_core_dependencies.py.template @@ -17,24 +17,27 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!! <% srcs = [] - asm_srcs = [] + asm_srcs = {} for lib in libs: if lib.name in python_dependencies.transitive_deps: for src in lib.src: srcs.append(src) if hasattr(lib, 'asm_src'): - for src in lib.asm_src: - asm_srcs.append(src) + asm_srcs = lib.asm_src srcs = sorted(set(srcs)) - asm_srcs = sorted(set(asm_srcs)) %> CORE_SOURCE_FILES = [ % for src in srcs: '${src}', % endfor ] - ASM_SOURCE_FILES = [ - % for src in asm_srcs: + + ASM_SOURCE_FILES = { + % for asm, asm_src in asm_srcs.iteritems(): + '${asm}': [ + % for src in asm_src: '${src}', + % endfor + ], % endfor - ] + } From de2e9e5241ef5b4f0b440f037a5d0194281269ef Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Mon, 27 Jul 2020 22:51:04 -0700 Subject: [PATCH 05/10] remove unused variable --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 89051ecc3ba..b48d60d4545 100644 --- a/setup.py +++ b/setup.py @@ -271,7 +271,6 @@ if BUILD_WITH_SYSTEM_CARES: DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) asm_files = [] -NO_BORING_ASM = True asm_key = '' if BUILD_WITH_BORING_SSL_ASM: From 474ed0453caa86a72b91ca5f36b4e74c537b85ca Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Mon, 27 Jul 2020 23:07:25 -0700 Subject: [PATCH 06/10] fix format setup.py --- setup.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index b48d60d4545..12150e589fc 100644 --- a/setup.py +++ b/setup.py @@ -103,7 +103,8 @@ CLASSIFIERS = [ 'License :: OSI Approved :: Apache Software License', ] -BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', True) +BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', + True) # Environment variable to determine whether or not the Cython extension should # *use* Cython or use the generated C files. Note that this requires the C files @@ -283,12 +284,12 @@ if BUILD_WITH_BORING_SSL_ASM: elif "mac" in util.get_platform() and "x86_64" in util.get_platform(): asm_key = 'crypto_mac_x86_64' else: - print("ASM Builds for BoringSSL currently not supported on:", - util.get_platform()) + print("ASM Builds for BoringSSL currently not supported on:", + util.get_platform()) if asm_key: - asm_files = grpc_core_dependencies.ASM_SOURCE_FILES[asm_key] + asm_files = grpc_core_dependencies.ASM_SOURCE_FILES[asm_key] else: - DEFINE_MACROS += (('OPENSSL_NO_ASM', 1),) + DEFINE_MACROS += (('OPENSSL_NO_ASM', 1),) if not DISABLE_LIBC_COMPATIBILITY: DEFINE_MACROS += (('GPR_BACKWARDS_COMPATIBILITY_MODE', 1),) From 596dcc555de7f9d23c1b5170fdb880564c0d2f14 Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Mon, 27 Jul 2020 23:18:41 -0700 Subject: [PATCH 07/10] fix gen_build_yaml.py formatting --- src/boringssl/gen_build_yaml.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py index 18adae47eaa..1b77fedad01 100755 --- a/src/boringssl/gen_build_yaml.py +++ b/src/boringssl/gen_build_yaml.py @@ -46,11 +46,10 @@ class Grpc(object): def WriteFiles(self, files): test_binaries = ['ssl_test', 'crypto_test'] - asm_outputs = {key: value - for key, value in files.items() - if any( - f.endswith(".S") or f.endswith(".asm") - for f in value)} + asm_outputs = { + key: value for key, value in files.items() if any( + f.endswith(".S") or f.endswith(".asm") for f in value) + } self.yaml = { '#': 'generated with src/boringssl/gen_build_yaml.py', @@ -70,9 +69,10 @@ class Grpc(object): 'src': sorted( map_dir(f) for f in files['ssl'] + files['crypto']), - 'asm_src': - {k: [map_dir(f) for f in value] - for k, value in asm_outputs.items()}, + 'asm_src': { + k: [map_dir(f) for f in value + ] for k, value in asm_outputs.items() + }, 'headers': sorted( map_dir(f) From 6f6778276d85125948b0ff1dd1e94a6939c02cbc Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Mon, 27 Jul 2020 23:22:41 -0700 Subject: [PATCH 08/10] update template format --- src/python/grpcio/grpc_core_dependencies.py | 332 +++++++++--------- .../grpcio/grpc_core_dependencies.py.template | 6 +- 2 files changed, 169 insertions(+), 169 deletions(-) diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index aa8aad5c38c..d0739a4b3af 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -907,170 +907,170 @@ CORE_SOURCE_FILES = [ ] ASM_SOURCE_FILES = { - 'crypto_ios_aarch64': [ - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S', - 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S', - ], - 'crypto_mac_x86_64': [ - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S', - 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S', - ], - 'crypto_win_x86': [ - 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm', - 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm', - ], - 'crypto_linux_ppc64le': [ - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S', - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S', - 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S', - ], - 'crypto_mac_x86': [ - 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S', - 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S', - ], - 'crypto_linux_x86': [ - 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/md5-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha1-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha256-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S', - 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S', - ], - 'crypto_ios_arm': [ - 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S', - 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S', - ], - 'crypto_linux_x86_64': [ - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/md5-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S', - 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S', - 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S', - ], - 'crypto_win_x86_64': [ - 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/md5-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm', - 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm', - ], - 'crypto_linux_aarch64': [ - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S', - 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S', - ], - 'crypto_linux_arm': [ - 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S', - 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S', - ], + 'crypto_ios_aarch64': [ + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S', + 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S', + ], + 'crypto_mac_x86_64': [ + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S', + 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S', + ], + 'crypto_win_x86': [ + 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm', + 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm', + ], + 'crypto_linux_ppc64le': [ + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S', + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S', + 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S', + ], + 'crypto_mac_x86': [ + 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S', + 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S', + ], + 'crypto_linux_x86': [ + 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/md5-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha1-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha256-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S', + 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S', + ], + 'crypto_ios_arm': [ + 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S', + 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S', + ], + 'crypto_linux_x86_64': [ + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/md5-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S', + 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S', + 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S', + ], + 'crypto_win_x86_64': [ + 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/md5-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm', + 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm', + ], + 'crypto_linux_aarch64': [ + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S', + 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S', + ], + 'crypto_linux_arm': [ + 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S', + 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S', + 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S', + 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S', + ], } diff --git a/templates/src/python/grpcio/grpc_core_dependencies.py.template b/templates/src/python/grpcio/grpc_core_dependencies.py.template index 3263c57ae44..153e7f8aef8 100644 --- a/templates/src/python/grpcio/grpc_core_dependencies.py.template +++ b/templates/src/python/grpcio/grpc_core_dependencies.py.template @@ -34,10 +34,10 @@ ASM_SOURCE_FILES = { % for asm, asm_src in asm_srcs.iteritems(): - '${asm}': [ + '${asm}': [ % for src in asm_src: - '${src}', + '${src}', % endfor - ], + ], % endfor } From 458272602a71ddd2b20b13968e0636fd6aa8c90d Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Mon, 27 Jul 2020 23:32:20 -0700 Subject: [PATCH 09/10] remove trailing space --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 12150e589fc..3234353efad 100644 --- a/setup.py +++ b/setup.py @@ -103,7 +103,7 @@ CLASSIFIERS = [ 'License :: OSI Approved :: Apache Software License', ] -BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', +BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM', True) # Environment variable to determine whether or not the Cython extension should From b8b13cf70cec9d7b76543b5403f8c01e8bbe7341 Mon Sep 17 00:00:00 2001 From: Micah Kornfield Date: Wed, 5 Aug 2020 10:30:34 -0700 Subject: [PATCH 10/10] dont remove .S and .asm file --- tools/run_tests/artifacts/build_artifact_python.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index a2b2542ac2b..abd6900152c 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -53,6 +53,7 @@ clean_non_source_files() { | grep -v '\.c$' | grep -v '\.cc$' | grep -v '\.cpp$' \ | grep -v '\.h$' | grep -v '\.hh$' | grep -v '\.inc$' \ | grep -v '\.s$' | grep -v '\.py$' | grep -v '\.hpp$' \ + | grep -v '\.S$' | grep -v '\.asm$' \ | while read -r file; do rm -f "$file" || true done