diff options
Diffstat (limited to 'dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch')
-rw-r--r-- | dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch b/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch new file mode 100644 index 000000000000..71e02eafeb65 --- /dev/null +++ b/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch @@ -0,0 +1,35 @@ +From 05ae3c5a87ba1037bd4c7a94e6b574c8df847065 Mon Sep 17 00:00:00 2001 +From: Lidi Zheng <lidiz@google.com> +Date: Tue, 6 Apr 2021 06:50:40 -0700 +Subject: [PATCH] Remove -std=gnu99 CFlag when compiling C++ with clang + (#25778) + +* Remove -std=gnu99 CFlag when compiling C++ with clang + +* Use endswith instead of hard-coded slices + +* Fix a typo +--- + src/python/grpcio/commands.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py +index f4a3d2bdc041..df8fc46a3cad 100644 +--- a/src/python/grpcio/commands.py ++++ b/src/python/grpcio/commands.py +@@ -258,10 +258,14 @@ def compiler_ok_with_extra_std(): + old_compile = self.compiler._compile + + def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts): +- if src[-2:] == '.c': ++ if src.endswith('.c'): + extra_postargs = [ + arg for arg in extra_postargs if not '-std=c++' in arg + ] ++ elif src.endswith('.cc') or src.endswith('.cpp'): ++ extra_postargs = [ ++ arg for arg in extra_postargs if not '-std=gnu99' in arg ++ ] + return old_compile(obj, src, ext, cc_args, extra_postargs, + pp_opts) + |