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 10:54:21 +0000 |
commit | 96383efa2726ed1bf7893332d726112a8552fc24 (patch) | |
tree | 62c1a71e800ebc2bcecd29d535881af342d25f3b /meta/recipes-devtools/python/python | |
parent | 0f87f8522a2c1b5a7042738887952b98060fbd9d (diff) | |
download | openembedded-core-contrib-96383efa2726ed1bf7893332d726112a8552fc24.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.
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 @@ +From 3f49be81e31c164654aeb10b65ebade982ca2ed8 Mon Sep 17 00:00:00 2001 +From: Changqing Li <changqing.li@windriver.com> +Date: Mon, 22 Oct 2018 15:24:48 +0800 +Subject: [PATCH] python2: 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. e.g. +When "icc" is containded in working path, below errors are reported when +compiling python: +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. + +Upstream-Status: Pending + +Signed-off-by: Li Zhou <li.zhou@windriver.com> + +Patch orignally from Li Zhou, I just rework it to new version + +Signed-off-by: Changqing Li <changqing.li@windriver.com> +--- + configure.ac | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/configure.ac b/configure.ac +index db1c940..dfcd89a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -684,7 +684,7 @@ AC_MSG_RESULT($with_cxx_main) + preset_cxx="$CXX" + if test -z "$CXX" + then +- case "$CC" in ++ case "$cc_basename" in + gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;; + cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;; + esac +@@ -757,14 +757,14 @@ rmdir CaseSensitiveTestDir + + case $MACHDEP in + bsdos*) +- case $CC in ++ case $cc_basename in + gcc) CC="$CC -D_HAVE_BSDI";; + esac;; + esac + + case $ac_sys_system in + hp*|HP*) +- case $CC in ++ case $cc_basename in + cc|*/cc) CC="$CC -Ae";; + esac;; + SunOS*) +@@ -1084,7 +1084,7 @@ then + fi + + # Clang also needs -fwrapv +- case $CC in ++ case $cc_basename in + *clang*) WRAP="-fwrapv" + ;; + esac +@@ -1304,7 +1304,7 @@ yes) + esac + + # ICC needs -fp-model strict or floats behave badly +-case "$CC" in ++case "$cc_basename" in + *icc*) + BASECFLAGS="$BASECFLAGS -fp-model strict" + ;; +@@ -1443,7 +1443,7 @@ else + fi], + [AC_MSG_RESULT(no)]) + if test "$Py_LTO" = 'true' ; then +- case $CC in ++ case $cc_basename in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto" +@@ -1508,7 +1508,7 @@ then + fi + fi + LLVM_PROF_ERR=no +-case $CC in ++case $cc_basename in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" +@@ -2322,7 +2322,7 @@ then + then CCSHARED="-fPIC" + else CCSHARED="-Kpic -belf" + fi;; +- IRIX*/6*) case $CC in ++ IRIX*/6*) case $cc_basename in + *gcc*) CCSHARED="-shared";; + *) CCSHARED="";; + esac;; +@@ -2366,7 +2366,7 @@ then + then + LINKFORSHARED="-Wl,--export-dynamic" + fi;; +- SunOS/5*) case $CC in ++ SunOS/5*) case $cc_basename in + *gcc*) + if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null + then +-- +2.7.4 + |