]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
4d589dd759b26c06ed14c4548ee39e52c0c00204
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From 175ed10e0a59a5395546ef88702f23d100b909f9 Mon Sep 17 00:00:00 2001
2 From: Changqing Li <changqing.li@windriver.com>
3 Date: Mon, 22 Oct 2018 15:19:51 +0800
4 Subject: [PATCH] python3: 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 python3:
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: Submitted [https://github.com/python/cpython/pull/96399]
18
19 Signed-off-by: Li Zhou <li.zhou@windriver.com>
20
21 patch originally from Li Zhou, I just rework it to new version
22
23 Signed-off-by: Changqing Li <changqing.li@windriver.com>
24
25 ---
26 configure.ac | 19 ++++++++++---------
27 1 file changed, 10 insertions(+), 9 deletions(-)
28
29 diff --git a/configure.ac b/configure.ac
30 index 77fb609..358b6ea 100644
31 --- a/configure.ac
32 +++ b/configure.ac
33 @@ -134,6 +134,7 @@ AC_CONFIG_HEADERS([pyconfig.h])
34 AC_CANONICAL_HOST
35 AC_SUBST(build)
36 AC_SUBST(host)
37 +LT_INIT
38
39 AS_VAR_IF([cross_compiling], [maybe],
40 [AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])]
41 @@ -877,7 +878,7 @@ AC_MSG_RESULT($with_cxx_main)
42 preset_cxx="$CXX"
43 if test -z "$CXX"
44 then
45 - case "$CC" in
46 + case "$cc_basename" in
47 gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
48 cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
49 clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
50 @@ -1290,7 +1291,7 @@ rmdir CaseSensitiveTestDir
51
52 case $ac_sys_system in
53 hp*|HP*)
54 - case $CC in
55 + case $cc_basename in
56 cc|*/cc) CC="$CC -Ae";;
57 esac;;
58 esac
59 @@ -1798,7 +1799,7 @@ esac
60 ],
61 [AC_MSG_RESULT(no)])
62 if test "$Py_LTO" = 'true' ; then
63 - case $CC in
64 + case $cc_basename in
65 *clang*)
66 dnl flag to disable lto during linking
67 LDFLAGS_NOLTO="-fno-lto"
68 @@ -1917,7 +1918,7 @@ then
69 fi
70 fi
71 LLVM_PROF_ERR=no
72 -case $CC in
73 +case $cc_basename in
74 *clang*)
75 # Any changes made here should be reflected in the GCC+Darwin case below
76 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
77 @@ -1978,7 +1979,7 @@ esac
78 # compiler and platform. BASECFLAGS tweaks need to be made even if the
79 # user set OPT.
80
81 -case $CC in
82 +case $cc_basename in
83 *clang*)
84 cc_is_clang=1
85 ;;
86 @@ -2197,7 +2198,7 @@ yes)
87
88 # ICC doesn't recognize the option, but only emits a warning
89 ## XXX does it emit an unused result warning and can it be disabled?
90 - AS_CASE([$CC],
91 + AS_CASE([$cc_basename],
92 [*icc*], [ac_cv_disable_unused_result_warning=no]
93 [PY_CHECK_CC_WARNING([disable], [unused-result])])
94 AS_VAR_IF([ac_cv_disable_unused_result_warning], [yes],
95 @@ -2439,7 +2440,7 @@ yes)
96 ;;
97 esac
98
99 -case "$CC" in
100 +case "$cc_basename" in
101 *icc*)
102 # ICC needs -fp-model strict or floats behave badly
103 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
104 @@ -3281,7 +3282,7 @@ then
105 then
106 LINKFORSHARED="-Wl,--export-dynamic"
107 fi;;
108 - SunOS/5*) case $CC in
109 + SunOS/5*) case $cc_basename in
110 *gcc*)
111 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
112 then
113 @@ -6370,7 +6371,7 @@ if test "$ac_cv_gcc_asm_for_x87" = yes; then
114 # Some versions of gcc miscompile inline asm:
115 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
116 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
117 - case $CC in
118 + case $cc_basename in
119 *gcc*)
120 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
121 saved_cflags="$CFLAGS"