Update and comment BoringSSL prefix hacks

pull/20975/head
Muxi Yan 5 years ago
parent 42003f8596
commit 44ddaa31e8
  1. 15
      templates/src/objective-c/BoringSSL-GRPC.podspec.template

@ -223,13 +223,18 @@
% endfor
EOF
# Remove lines of the format "#define SOME_MACRO SOME_MACRO" because they mess up the symbol prefix
# The symbol prefixing mechanism is performed by redefining BoringSSL symbols with
# "#define SOME_BORINGSSL_SYMBOL GRPC_SHADOW_SOME_BORINGSSL_SYMBOL". Unfortunately, some symbols are already
# redefined as macros in BoringSSL headers in the form "#define SOME_BORINGSSL_SYMBOL SOME_BORINGSSL_SYMBOL"
# Such type of redefinition will cause "duplicate symbols" when using together with our prefix header. So
# the workaround in the below lines removes all such type of #define directives.
sed -i'.back' '/^#define \\([A-Za-z0-9_]*\\) \\1/d' include/openssl/*.h
# Remove lines of the format below because they mess up the symbol prefix
# #define SOME_MACRO ${"\\"}
# SOME_MACRO
# Remove lines of the format below for the same reason above
# #define SOME_BORINGSSL_SYMBOL ${"\\"}
# SOME_BORINGSSL_SYMBOL
sed -i'.back' '/^#define.*\\\\$/{N;/^#define \\([A-Za-z0-9_]*\\) *\\\\\\n *\\1/d;}' include/openssl/*.h
sed -i'.back' 's/#ifndef md5_block_data_order/#ifndef GRPC_SHADOW_md5_block_data_order/g' crypto/fipsmodule/md5/md5.c
# We are renaming openssl to openssl_grpc so that there is no conflict with openssl if it exists
find . -type f \\( -path '*.h' -or -path '*.cc' -or -path '*.c' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/;#include <openssl_grpc/;g'
END_OF_COMMAND

Loading…
Cancel
Save