]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
79978112280607f87e4bbbfc1d685821df3f1cfb
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From f834492007487e9e87b3d3f1f3c5cc440e6ec5e2 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 configure.ac | 19 ++++++++++---------
26 1 file changed, 10 insertions(+), 9 deletions(-)
27
28 diff --git a/configure.ac b/configure.ac
29 index d0d5405..093f8b5 100644
30 --- a/configure.ac
31 +++ b/configure.ac
32 @@ -137,6 +137,7 @@ AC_CONFIG_HEADERS([pyconfig.h])
33 AC_CANONICAL_HOST
34 AC_SUBST([build])
35 AC_SUBST([host])
36 +LT_INIT
37
38 AS_VAR_IF([cross_compiling], [maybe],
39 [AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])]
40 @@ -896,7 +897,7 @@ AC_SUBST([CXX])
41 preset_cxx="$CXX"
42 if test -z "$CXX"
43 then
44 - case "$CC" in
45 + case "$cc_basename" in
46 gcc) AC_PATH_TOOL([CXX], [g++], [g++], [notfound]) ;;
47 cc) AC_PATH_TOOL([CXX], [c++], [c++], [notfound]) ;;
48 clang|*/clang) AC_PATH_TOOL([CXX], [clang++], [clang++], [notfound]) ;;
49 @@ -1328,7 +1329,7 @@ rmdir CaseSensitiveTestDir
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 esac
58 @@ -1854,7 +1855,7 @@ esac
59 ],
60 [AC_MSG_RESULT([no])])
61 if test "$Py_LTO" = 'true' ; then
62 - case $CC in
63 + case $cc_basename in
64 *clang*)
65 LDFLAGS_NOLTO="-fno-lto"
66 dnl Clang linker requires -flto in order to link objects with LTO information.
67 @@ -1983,7 +1984,7 @@ then
68 fi
69 fi
70 LLVM_PROF_ERR=no
71 -case $CC in
72 +case $cc_basename in
73 *clang*)
74 # Any changes made here should be reflected in the GCC+Darwin case below
75 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
76 @@ -2155,7 +2156,7 @@ AC_MSG_RESULT([$BOLT_APPLY_FLAGS])
77 # compiler and platform. BASECFLAGS tweaks need to be made even if the
78 # user set OPT.
79
80 -case $CC in
81 +case $cc_basename in
82 *clang*)
83 cc_is_clang=1
84 ;;
85 @@ -2427,7 +2428,7 @@ yes)
86
87 # ICC doesn't recognize the option, but only emits a warning
88 ## XXX does it emit an unused result warning and can it be disabled?
89 - AS_CASE([$CC],
90 + AS_CASE([$cc_basename],
91 [*icc*], [ac_cv_disable_unused_result_warning=no]
92 [PY_CHECK_CC_WARNING([disable], [unused-result])])
93 AS_VAR_IF([ac_cv_disable_unused_result_warning], [yes],
94 @@ -2673,7 +2674,7 @@ yes)
95 ;;
96 esac
97
98 -case "$CC" in
99 +case "$cc_basename" in
100 *mpicc*)
101 CFLAGS_NODIST="$CFLAGS_NODIST"
102 ;;
103 @@ -3508,7 +3509,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 @@ -6831,7 +6832,7 @@ if test "$ac_cv_gcc_asm_for_x87" = yes; then
113 # Some versions of gcc miscompile inline asm:
114 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
115 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
116 - case $CC in
117 + case $cc_basename in
118 *gcc*)
119 AC_MSG_CHECKING([for gcc ipa-pure-const bug])
120 saved_cflags="$CFLAGS"