You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch

36 lines
1.3 KiB

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)