Rewrap comment

pull/24992/head
Richard Belleville 4 years ago
parent aa90c5f9fe
commit 46bb9570b2
  1. 31
      tools/distrib/python/grpcio_tools/setup.py

@ -124,24 +124,25 @@ if EXTRA_ENV_COMPILE_ARGS is None:
EXTRA_ENV_COMPILE_ARGS += ' -fno-wrapv -frtti' EXTRA_ENV_COMPILE_ARGS += ' -fno-wrapv -frtti'
if EXTRA_ENV_LINK_ARGS is None: if EXTRA_ENV_LINK_ARGS is None:
EXTRA_ENV_LINK_ARGS = '' EXTRA_ENV_LINK_ARGS = ''
# NOTE(rbellevi): Clang on Mac OS will make all static symbols (both variables # NOTE(rbellevi): Clang on Mac OS will make all static symbols (both
# and objects) global weak symbols. When a process loads the # variables and objects) global weak symbols. When a process loads the
# protobuf wheel's shared object library before loading *this* C extension, # protobuf wheel's shared object library before loading *this* C extension,
# the runtime linker will prefer the protobuf module's version of symbols. This # the runtime linker will prefer the protobuf module's version of symbols.
# results in the process using a mixture of symbols from the protobuf wheel and # This results in the process using a mixture of symbols from the protobuf
# this wheel, which may be using different versions of libprotobuf. In the case # wheel and this wheel, which may be using different versions of
# that they *are* using different versions of libprotobuf *and* there has been a # libprotobuf. In the case that they *are* using different versions of
# change in data layout (or in other invariants) segfaults, data corruption, or # libprotobuf *and* there has been a change in data layout (or in other
# "bad things" may happen. # invariants) segfaults, data corruption, or "bad things" may happen.
# #
# This flag ensures that on Mac, the only global symbol is the one loaded by the # This flag ensures that on Mac, the only global symbol is the one loaded by
# Python interpreter. The problematic global weak symbols become local weak symbols. # the Python interpreter. The problematic global weak symbols become local
# This is not required on Linux since the compiler does not produce global weak # weak symbols. This is not required on Linux since the compiler does not
# symbols. This is not required on Windows as our ".pyd" file does not contain any # produce global weak symbols. This is not required on Windows as our ".pyd"
# symbols. # file does not contain any symbols.
# #
# Finally, the leading underscore here is part of the Mach-O ABI. Unlike more modern # Finally, the leading underscore here is part of the Mach-O ABI. Unlike
# ABIs (ELF et al.), Mach-O prepends an underscore to the names of C functions. # more modern ABIs (ELF et al.), Mach-O prepends an underscore to the names
# of C functions.
if "darwin" in sys.platform: if "darwin" in sys.platform:
EXTRA_ENV_LINK_ARGS += ' -Wl,-exported_symbol,_{}'.format( EXTRA_ENV_LINK_ARGS += ' -Wl,-exported_symbol,_{}'.format(
_EXT_INIT_SYMBOL) _EXT_INIT_SYMBOL)

Loading…
Cancel
Save