summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-02-17 13:54:40 -0800
committerKhem Raj <raj.khem@gmail.com>2021-02-19 10:02:43 -0800
commit9cdca949b67bd681707b74c0264b20125c5ea8a5 (patch)
tree55e83203f13bbe28423ddfe7d0fa61a241b1051d /meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
parent31aceae5e73318d6003ba0141ea28596b6117a9b (diff)
downloadmeta-openembedded-9cdca949b67bd681707b74c0264b20125c5ea8a5.tar.gz
python3-grpcio: Upgrade to 1.35.0
Drop 0001-Fix-build-on-riscv32.patch, its upstreamed Forward port rest of the patches Use OPENSSL_NO_ASM only for armv7+/aarch64 Signed-off-by: Khem Raj <raj.khem@gmail.com> Acked-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch86
1 files changed, 44 insertions, 42 deletions
diff --git a/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch b/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
index bff50a0a11..373669461b 100644
--- a/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
+++ b/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
@@ -1,26 +1,18 @@
1From 2ef8a85933f3ac36b289979ff9edd49dd12d0d16 Mon Sep 17 00:00:00 2001 1From de10fbc2386dcac3ab810c49b6977b2ee01bf426 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 4 Aug 2017 09:04:07 -0700 3Date: Wed, 17 Feb 2021 13:30:23 -0800
4Subject: [PATCH] setup.py: Do not mix C and C++ compiler options 4Subject: [PATCH] setup.py: Do not mix C and C++ compiler options
5 5
6EXTRA_ENV_COMPILE_ARGS is used both with CC and CXX 6EXTRA_ENV_COMPILE_ARGS is used both with CC and CXX
7so using -std=c++11 or -std=gnu99 together will cause 7so using -std=c++11 or -std=gnu99 together will cause
8build time errors espcially with clang 8build time errors espcially with clang
9 9
10error: invalid argument '-std=gnu99' not allowed with 'C++' 10Keep '-std=c++11' to fix native build error
11
12gcc7 ( defaults are -std=gnu11 and -std=gnu++14 )
13 as well clang default to these standards mode or newer
14anyway
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17
181. Keep '-std=c++11' and '-std=gnu99' to fix native build error
19with old gcc (such as gcc 5.4.0 on ubuntu 16.04), for clang 11with old gcc (such as gcc 5.4.0 on ubuntu 16.04), for clang
20we will remove them through GRPC_PYTHON_CFLAGS at do_compile 12we will remove them through GRPC_PYTHON_CFLAGS at do_compile
21in bb recipe. 13in bb recipe.
22 14
232. While export CC="gcc ", cc_args is None, it will 15While export CC="gcc ", cc_args is None, it will
24cause subprocess.Popen always return 1. On centos 8, if you don't 16cause subprocess.Popen always return 1. On centos 8, if you don't
25install package libatomic, there will be a native build error 17install package libatomic, there will be a native build error
26`cannot find /usr/lib64/libatomic.so.1.2.0'. 18`cannot find /usr/lib64/libatomic.so.1.2.0'.
@@ -28,47 +20,57 @@ install package libatomic, there will be a native build error
28Add no harm '-g' to cc_args if cc_args is empty. 20Add no harm '-g' to cc_args if cc_args is empty.
29 21
30Upstream-Status: Inappropriate [oe specific] 22Upstream-Status: Inappropriate [oe specific]
23
24Signed-off-by: Khem Raj <raj.khem@gmail.com>
31Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 25Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
32--- 26---
33 setup.py | 6 +++++- 27 setup.py | 9 ++++++---
34 src/python/grpcio/commands.py | 5 ++++- 28 src/python/grpcio/commands.py | 5 ++++-
35 2 files changed, 9 insertions(+), 2 deletions(-) 29 2 files changed, 10 insertions(+), 4 deletions(-)
36 30
37diff --git a/setup.py b/setup.py 31diff --git a/setup.py b/setup.py
38index e950057..1b68221 100644 32index 4b8c9d4..271b7b1 100644
39--- a/setup.py 33--- a/setup.py
40+++ b/setup.py 34+++ b/setup.py
41@@ -144,9 +144,13 @@ ENABLE_DOCUMENTATION_BUILD = os.environ.get( 35@@ -172,8 +172,11 @@ def check_linker_need_libatomic():
42 36 """Test if linker on system needs libatomic."""
43 def check_linker_need_libatomic(): 37 code_test = (b'#include <atomic>\n' +
44 """Test if linker on system needs libatomic.""" 38 b'int main() { return std::atomic<int64_t>{}; }')
45+ compiler, cc_args = os.environ.get('CC').split(' ', 1) or 'gcc' 39- cxx = os.environ.get('CXX', 'c++')
46+ if not cc_args: 40- cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'],
47+ cc_args = "-g" 41+ cxx, cxx_args = os.environ.get('CXX').split(' ', 1) or 'c++'
42+ if not cxx_args:
43+ cxx_args = "-g"
48+ 44+
49 code_test = (b'#include <atomic>\n' + 45+ cpp_test = subprocess.Popen([cxx, cxx_args, '-x', 'c++', '-std=c++11', '-'],
50 b'int main() { return std::atomic<int64_t>{}; }') 46 stdin=PIPE,
51- cc_test = subprocess.Popen(['cc', '-x', 'c++', '-std=c++11', '-'], 47 stdout=PIPE,
52+ cc_test = subprocess.Popen([compiler, cc_args, '-x', 'c++', '-std=c++11', '-'], 48 stderr=PIPE)
53 stdin=PIPE, 49@@ -183,7 +186,7 @@ def check_linker_need_libatomic():
54 stdout=PIPE, 50 # Double-check to see if -latomic actually can solve the problem.
55 stderr=PIPE) 51 # https://github.com/grpc/grpc/issues/22491
52 cpp_test = subprocess.Popen(
53- [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'],
54+ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-latomic', '-'],
55 stdin=PIPE,
56 stdout=PIPE,
57 stderr=PIPE)
56diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py 58diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
57index 064dda9..a75d8b9 100644 59index a8b2ff5..b928201 100644
58--- a/src/python/grpcio/commands.py 60--- a/src/python/grpcio/commands.py
59+++ b/src/python/grpcio/commands.py 61+++ b/src/python/grpcio/commands.py
60@@ -216,7 +216,10 @@ class BuildExt(build_ext.build_ext): 62@@ -219,7 +219,10 @@ class BuildExt(build_ext.build_ext):
61 when invoked in C mode. GCC is okay with this, while clang is not.
62 """ 63 """
63 # TODO(lidiz) Remove the generated a.out for success tests. 64 try:
64- cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'], 65 # TODO(lidiz) Remove the generated a.out for success tests.
65+ compiler, cc_args = os.environ.get('CC').split(' ', 1) or 'gcc' 66- cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'],
66+ if not cc_args: 67+ cc_test, cc_args = os.environ.get('CC').split(' ', 1) or 'gcc'
67+ cc_args = "-g" 68+ if not cc_args:
68+ cc_test = subprocess.Popen([compiler, cc_args, '-x', 'c', '-std=c++11', '-'], 69+ cc_args = "-g"
69 stdin=subprocess.PIPE, 70+ cc_test = subprocess.Popen([cc_test, cc_args, '-x', 'c', '-std=c++11', '-'],
70 stdout=subprocess.PIPE, 71 stdin=subprocess.PIPE,
71 stderr=subprocess.PIPE) 72 stdout=subprocess.PIPE,
73 stderr=subprocess.PIPE)
72-- 74--
732.7.4 752.30.1
74 76