diff options
author | Changqing Li <changqing.li@windriver.com> | 2018-10-23 13:22:18 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-07 14:38:39 +0000 |
commit | 82315924b79b349b3798dd40786a19ee4f474cd4 (patch) | |
tree | beabc1c48b7226f1a727d2d8487a1e9e0c651cb4 /meta/recipes-devtools/python/python | |
parent | 6a080d90e5001bde30e8a1ade68a02bcd8a29df3 (diff) | |
download | poky-82315924b79b349b3798dd40786a19ee4f474cd4.tar.gz |
python/python3: use cc_basename to replace CC for checking compiler
When working path contains "clang"/"gcc"/"icc", it might be part of $CC
because of the "--sysroot" parameter. That could cause judgement error
about clang/gcc/icc compilers.
eg: if build under /yocto/builds/xicc/, bitbake python, $CC will contains
xicc, will make $CC match *icc, but actuall xicc just folder name.
When "*icc" is matched, below errors are reported when
compiling python/python3:
x86_64-wrs-linux-gcc: error: strict: No such file or directory
x86_64-wrs-linux-gcc: error: unrecognized command line option '-fp-model'
Here use cc_basename to replace CC for checking compiler to avoid such
kind of issue.
(From OE-Core rev: 96383efa2726ed1bf7893332d726112a8552fc24)
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python')
-rw-r--r-- | meta/recipes-devtools/python/python/0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch b/meta/recipes-devtools/python/python/0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch new file mode 100644 index 0000000000..6e4f820913 --- /dev/null +++ b/meta/recipes-devtools/python/python/0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From 3f49be81e31c164654aeb10b65ebade982ca2ed8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Mon, 22 Oct 2018 15:24:48 +0800 | ||
4 | Subject: [PATCH] python2: use cc_basename to replace CC for checking compiler | ||
5 | |||
6 | When working path contains "clang"/"gcc"/"icc", it might be part of $CC | ||
7 | because of the "--sysroot" parameter. That could cause judgement error | ||
8 | about clang/gcc/icc compilers. e.g. | ||
9 | When "icc" is containded in working path, below errors are reported when | ||
10 | compiling python: | ||
11 | x86_64-wrs-linux-gcc: error: strict: No such file or directory | ||
12 | x86_64-wrs-linux-gcc: error: unrecognized command line option '-fp-model' | ||
13 | |||
14 | Here use cc_basename to replace CC for checking compiler to avoid such | ||
15 | kind of issue. | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | |||
19 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
20 | |||
21 | Patch orignally from Li Zhou, I just rework it to new version | ||
22 | |||
23 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
24 | --- | ||
25 | configure.ac | 18 +++++++++--------- | ||
26 | 1 file changed, 9 insertions(+), 9 deletions(-) | ||
27 | |||
28 | diff --git a/configure.ac b/configure.ac | ||
29 | index db1c940..dfcd89a 100644 | ||
30 | --- a/configure.ac | ||
31 | +++ b/configure.ac | ||
32 | @@ -684,7 +684,7 @@ AC_MSG_RESULT($with_cxx_main) | ||
33 | preset_cxx="$CXX" | ||
34 | if test -z "$CXX" | ||
35 | then | ||
36 | - case "$CC" in | ||
37 | + case "$cc_basename" in | ||
38 | gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;; | ||
39 | cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;; | ||
40 | esac | ||
41 | @@ -757,14 +757,14 @@ rmdir CaseSensitiveTestDir | ||
42 | |||
43 | case $MACHDEP in | ||
44 | bsdos*) | ||
45 | - case $CC in | ||
46 | + case $cc_basename in | ||
47 | gcc) CC="$CC -D_HAVE_BSDI";; | ||
48 | esac;; | ||
49 | esac | ||
50 | |||
51 | case $ac_sys_system in | ||
52 | hp*|HP*) | ||
53 | - case $CC in | ||
54 | + case $cc_basename in | ||
55 | cc|*/cc) CC="$CC -Ae";; | ||
56 | esac;; | ||
57 | SunOS*) | ||
58 | @@ -1084,7 +1084,7 @@ then | ||
59 | fi | ||
60 | |||
61 | # Clang also needs -fwrapv | ||
62 | - case $CC in | ||
63 | + case $cc_basename in | ||
64 | *clang*) WRAP="-fwrapv" | ||
65 | ;; | ||
66 | esac | ||
67 | @@ -1304,7 +1304,7 @@ yes) | ||
68 | esac | ||
69 | |||
70 | # ICC needs -fp-model strict or floats behave badly | ||
71 | -case "$CC" in | ||
72 | +case "$cc_basename" in | ||
73 | *icc*) | ||
74 | BASECFLAGS="$BASECFLAGS -fp-model strict" | ||
75 | ;; | ||
76 | @@ -1443,7 +1443,7 @@ else | ||
77 | fi], | ||
78 | [AC_MSG_RESULT(no)]) | ||
79 | if test "$Py_LTO" = 'true' ; then | ||
80 | - case $CC in | ||
81 | + case $cc_basename in | ||
82 | *clang*) | ||
83 | # Any changes made here should be reflected in the GCC+Darwin case below | ||
84 | LTOFLAGS="-flto" | ||
85 | @@ -1508,7 +1508,7 @@ then | ||
86 | fi | ||
87 | fi | ||
88 | LLVM_PROF_ERR=no | ||
89 | -case $CC in | ||
90 | +case $cc_basename in | ||
91 | *clang*) | ||
92 | # Any changes made here should be reflected in the GCC+Darwin case below | ||
93 | PGO_PROF_GEN_FLAG="-fprofile-instr-generate" | ||
94 | @@ -2322,7 +2322,7 @@ then | ||
95 | then CCSHARED="-fPIC" | ||
96 | else CCSHARED="-Kpic -belf" | ||
97 | fi;; | ||
98 | - IRIX*/6*) case $CC in | ||
99 | + IRIX*/6*) case $cc_basename in | ||
100 | *gcc*) CCSHARED="-shared";; | ||
101 | *) CCSHARED="";; | ||
102 | esac;; | ||
103 | @@ -2366,7 +2366,7 @@ then | ||
104 | then | ||
105 | LINKFORSHARED="-Wl,--export-dynamic" | ||
106 | fi;; | ||
107 | - SunOS/5*) case $CC in | ||
108 | + SunOS/5*) case $cc_basename in | ||
109 | *gcc*) | ||
110 | if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null | ||
111 | then | ||
112 | -- | ||
113 | 2.7.4 | ||
114 | |||