diff --git a/setup.py b/setup.py index 94aa7793a79..613959550d4 100644 --- a/setup.py +++ b/setup.py @@ -293,6 +293,11 @@ if EXTRA_ENV_LINK_ARGS is None: if "linux" in sys.platform: EXTRA_ENV_LINK_ARGS += " -static-libgcc" +# Explicitly link Core Foundation framework for MacOS to ensure no symbol is +# missing when compiled using package managers like Conda. +if "darwin" in sys.platform: + EXTRA_ENV_LINK_ARGS += " -framework CoreFoundation" + EXTRA_COMPILE_ARGS = shlex.split(EXTRA_ENV_COMPILE_ARGS) EXTRA_LINK_ARGS = shlex.split(EXTRA_ENV_LINK_ARGS) diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index 5d6b8a0a974..c5c7243d233 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -190,6 +190,11 @@ if EXTRA_ENV_LINK_ARGS is None: if check_linker_need_libatomic(): EXTRA_ENV_LINK_ARGS += " -latomic" +# Explicitly link Core Foundation framework for MacOS to ensure no symbol is +# missing when compiled using package managers like Conda. +if "darwin" in sys.platform: + EXTRA_ENV_LINK_ARGS += " -framework CoreFoundation" + EXTRA_COMPILE_ARGS = shlex.split(EXTRA_ENV_COMPILE_ARGS) EXTRA_LINK_ARGS = shlex.split(EXTRA_ENV_LINK_ARGS)