python-native: Fix a compiler finding issue
cover python-native: Fix a compiler finding issue
Hi,
This patch will fix an compiler finding issue.
The CC variable, its value sometimes like "x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. This will confuse python when finding the compiler name, wrong compiler name "qemux86-64" were found rather than the "x86_64-poky-linux-gcc".
When I fixing python-pycairo multilib dir issue, above issue appeared and block the compile process. Please review it.
Thanks
Lei
The following changes since commit 819f18f8bc000f13b644edc194d2a12b4ea5fecf:
Richard Purdie (1):
Move architecture specific TARGET_OS mangling into tune files
are available in the git repository at:
git://git.pokylinux.org/poky-contrib lmei3/python-pycairo
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lmei3/python-pycairo
Mei Lei (1):
python-native: Fix a compiler finding issue
.../python/python-native/unixccompiler.patch | 20 ++++++++++++++++++++ .../recipes-devtools/python/python-native_2.6.6.bb | 3 ++- 2 files changed, 22 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python-native/unixccompiler.patch
PATCH 1/1 python-native: Fix a compiler finding issue
The CC variable sometimes add option information after compiler name, but python can't get the real compiler name if those information added. Fix this issue by dropping the option information when finding compiler name.
--- .../python/python-native/unixccompiler.patch | 20 ++++++++++++++++++++ .../recipes-devtools/python/python-native_2.6.6.bb | 3 ++- 2 files changed, 22 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python-native/unixccompiler.patch
meta/recipes-devtools/python/python-native/unixccompiler.patch new file +20 -0
@@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [embedded specific] + +# The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. +# This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name. + +#Signed-off-by: Mei Lei <[email protected]> + +diff --git Python-2.6.6/Lib/distutils/unixccompiler.py Python-2.6.6/Lib/distutils/unixccompiler.py +index 6d0b84d..aaf49cb 100644 +--- Python-2.6.6/Lib/distutils/unixccompiler.py ++++ Python-2.6.6/Lib/distutils/unixccompiler.py +@@ -282,7 +282,7 @@ class UnixCCompiler(CCompiler): + # this time, there's no way to determine this information from + # the configuration data stored in the Python installation, so + # we use this hack. +- compiler = os.path.basename(sysconfig.get_config_var("CC")) ++ compiler = os.path.basename(sysconfig.get_config_var("CC").split()[0]) + if sys.platform[:6] == "darwin": + # MacOSX's linker doesn't understand the -R flag at all + return "-L" + dir
meta/recipes-devtools/python/python-native_2.6.6.bb +2 -1
@@ -1,6 +1,6 @@ require python.inc DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" -PR = "${INC_PR}.2" +PR = "${INC_PR}.3" LIC_FILES_CHKSUM = "file://LICENSE;md5=38fdd546420fab09ac6bd3d8a1c83eb6"
@@ -12,6 +12,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ file://11-distutils-never-modify-shebang-line.patch \ file://12-distutils-prefix-is-inside-staging-area.patch \ file://debug.patch \ + file://unixccompiler.patch \ file://nohostlibs.patch" S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.6.3.3
Quoted 4 lines · Mei Lei
The CC variable sometimes add option information after compiler name, but python can't get the real compiler name if those information added. Fix this issue by dropping the option information when finding compiler name.
Signed-off-by Mei Lei <[email protected]>
I think this is going to cause problems when you must pass flags to gcc to have it work, eg 'gcc -m64'.
Signature · 2 lines
Tom Rini Mentor Graphics Corporation
Quoted 11 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Rini
Sent: Thursday, July 28, 2011 11:09 PM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler finding issueOn 07/28/2011 12:20 AM, Mei Lei wrote:
Quoted 8 lines
Quoted 1 line
The CC variable sometimes add option information after compiler name, but
python can't get the real compiler name if those information added.
Quoted 3 lines
Fix this issue by dropping the option information when finding compiler name.
Signed-off-by Mei Lei <[email protected]>I think this is going to cause problems when you must pass flags to gcc to have it work, eg 'gcc -m64'.
This patch fixed your worried issue.
The CC variable, sometimes like: "x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains flags information.
This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name, so add this patch to find the real gcc name.
Thanks
Lei
Quoted 9 lines
--
Tom Rini
Mentor Graphics Corporation_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 15 lines · Lei
Quoted 15 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Rini
Sent: Thursday, July 28, 2011 11:09 PM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler finding issueQuoted 1 line · Mei Lei
The CC variable sometimes add option information after compiler name, but
python can't get the real compiler name if those information added.
Quoted 2 lines
Fix this issue by dropping the option information when finding compiler name.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Mei Lei <[email protected]>I think this is going to cause problems when you must pass flags to gcc to have it work, eg 'gcc -m64'.
This patch fixed your worried issue.
The CC variable, sometimes like: "x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains flags information.
This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name, so add this patch to find the real gcc name.
No, what I'm saying is I have a compiler that must be invoked as 'gcc -m64' (which is what BUILD_CC is). So, I think after saying that, the right answer is to modify python to read the OE-specific BUILD_CC variable.
Signature · 2 lines
Tom Rini Mentor Graphics Corporation
Quoted 37 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Rini
Sent: Friday, July 29, 2011 9:44 AM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler finding issueQuoted 5 lines · Lei
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On BehalfOf
Quoted 4 lines
Quoted 4 lines
Tom Rini
Sent: Thursday, July 28, 2011 11:09 PM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler findingissue
Quoted 3 lines
Quoted 3 lines · Mei Lei
Quoted 1 line
The CC variable sometimes add option information after compiler name,
but
Quoted 2 lines
Quoted 2 lines
python can't get the real compiler name if those information added.
Quoted 1 line
Fix this issue by dropping the option information when finding compiler
name.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Mei Lei <[email protected]>I think this is going to cause problems when you must pass flags to gcc to have it work, eg 'gcc -m64'.
This patch fixed your worried issue.
The CC variable, sometimes like: "x86_64-poky-linux-gcc -m64
Quoted 8 lines
--sysroot=/${TMPDIR}/sysroots/qemux86-64", contains flags information.
Quoted 1 line
This will lead to wrong compiler name "qemux86-64" rather than
"x86_64-poky-linux-gcc" when python finding the compiler name, so add this patch to find the real gcc name.
No, what I'm saying is I have a compiler that must be invoked as 'gcc -m64' (which is what
BUILD_CCis). So, I think after saying that, the right answer is to modify python to read the OE-specificBUILD_CCvariable.
I think I didn't describe this patch exactly before.
This patch is only for function runtime_library_dir_option, this function is to detect which platform we are running and what compiler we used, then decide what option information should be passed to compiler.
By default, our cross-compiler's name be recognized as "qemux86" rather than " x86_64-poky-linux-gcc" in this function, this is wrong, this will induce a wrong option information passed to x86_64-poky-linux-gcc and block the compile process.
And function runtime_library_dir_option only return the option information, so didn't influence compiler name in global.
By the way, I think BUILD_CC is host compiler name, not for target.
Thanks
Lei
Quoted 9 lines
--
Tom Rini
Mentor Graphics Corporation_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 49 lines · Lei
Quoted 37 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Rini
Sent: Friday, July 29, 2011 9:44 AM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler finding issueQuoted 5 lines · Lei
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On BehalfOf
Quoted 4 lines
Quoted 4 lines
Tom Rini
Sent: Thursday, July 28, 2011 11:09 PM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler findingissue
Quoted 3 lines
Quoted 3 lines · Mei Lei
Quoted 1 line
The CC variable sometimes add option information after compiler name,
but
Quoted 2 lines
Quoted 2 lines
python can't get the real compiler name if those information added.
Quoted 1 line
Fix this issue by dropping the option information when finding compiler
name.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Mei Lei <[email protected]>I think this is going to cause problems when you must pass flags to gcc to have it work, eg 'gcc -m64'.
This patch fixed your worried issue.
The CC variable, sometimes like: "x86_64-poky-linux-gcc -m64Quoted 8 lines
--sysroot=/${TMPDIR}/sysroots/qemux86-64", contains flags information.
Quoted 1 line
This will lead to wrong compiler name "qemux86-64" rather than
"x86_64-poky-linux-gcc" when python finding the compiler name, so add this patch to find the real gcc name.
No, what I'm saying is I have a compiler that must be invoked as 'gcc -m64' (which is what
BUILD_CCis). So, I think after saying that, the right answer is to modify python to read the OE-specificBUILD_CCvariable.I think I didn't describe this patch exactly before.
Quoted 7 lines
This patch is only for function
runtime_library_dir_option, this function is to detect which platform we are running and what compiler we used, then decide what option information should be passed to compiler.By default, our cross-compiler's name be recognized as "qemux86" rather than " x86_64-poky-linux-gcc" in this function, this is wrong, this will induce a wrong option information passed to x86_64-poky-linux-gcc and block the compile process.
And function
runtime_library_dir_optiononly return the option information, so didn't influence compiler name in global.By the way, I think
BUILD_CCis host compiler name, not for target.
You're patching python-native, not python, which means the host python and not the target python.
Signature · 2 lines
Tom Rini Mentor Graphics Corporation
Quoted 72 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Rini
Sent: Friday, July 29, 2011 11:29 PM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler finding issueQuoted 5 lines · Lei
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On BehalfOf
Quoted 4 lines
Quoted 4 lines
Tom Rini
Sent: Friday, July 29, 2011 9:44 AM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler findingissue
Quoted 7 lines
Quoted 7 lines · Lei
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] OnBehalf
Quoted 26 lines
Quoted 26 lines
Of
Quoted 4 lines
Quoted 4 lines
Tom Rini
Sent: Thursday, July 28, 2011 11:09 PM
To: [email protected]
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler findingissue
Quoted 3 lines
Quoted 3 lines · Mei Lei
Quoted 1 line
The CC variable sometimes add option information after compiler name,
but
Quoted 2 lines
Quoted 2 lines
python can't get the real compiler name if those information added.
Quoted 1 line
Fix this issue by dropping the option information when finding compiler
name.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Mei Lei <[email protected]>I think this is going to cause problems when you must pass flags to gcc to have it work, eg 'gcc -m64'.
This patch fixed your worried issue.
The CC variable, sometimes like: "x86_64-poky-linux-gcc -m64--sysroot=/${TMPDIR}/sysroots/qemux86-64", contains flags information.
Quoted 1 line
This will lead to wrong compiler name "qemux86-64" rather than
"x86_64-poky-linux-gcc" when python finding the compiler name, so add this patch to find the real gcc name.
Quoted 8 lines
Quoted 3 lines
No, what I'm saying is I have a compiler that must be invoked as 'gcc -m64' (which is what
BUILD_CCis). So, I think after saying that, the right answer is to modify python to read the OE-specificBUILD_CCvariable.I think I didn't describe this patch exactly before.
This patch is only for function
runtime_library_dir_option, this function is todetect which platform we are running and what compiler we used, then decide what option information should be passed to compiler.
Quoted 2 lines
By default, our cross-compiler's name be recognized as "qemux86" rather
than " x86_64-poky-linux-gcc" in this function, this is wrong, this will induce a wrong option information passed to x86_64-poky-linux-gcc and block the compile process.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
And function
runtime_library_dir_optiononly return the option information,so didn't influence compiler name in global.
Quoted 2 lines
By the way, I think
BUILD_CCis host compiler name, not for target.You're patching python-native, not python, which means the host python and not the target python.
Yes, but I think this function will be called by python-pycairo, which will use cross compiler name in this function, so we should get the compiler name from CC.
Thanks
Lei
Quoted 9 lines
--
Tom Rini
Mentor Graphics Corporation_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 6 lines · Lei
Quoted 4 lines
You're patching python-native, not python, which means the host python and not the target python.
Yes, but I think this function will be called by python-pycairo, which will use cross compiler name in this function, so we should get the compiler name from CC.
so we inject the cross compiler name hardcoded into python and then python uses it when it needs to do cross compilation ?
Quoted 16 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Khem Raj
Sent: Tuesday, August 02, 2011 1:27 AM
To: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH 1/1] python-native: Fix a compiler finding issueQuoted 5 lines · Lei
Quoted 4 lines
You're patching python-native, not python, which means the host python and not the target python.
Quoted 6 lines
Quoted 1 line
Yes, but I think this function will be called by python-pycairo, which will use
cross compiler name in this function, so we should get the compiler name from CC.
so we inject the cross compiler name hardcoded into python and then python uses it when it needs to do cross compilation ?
No hardcode, I think. Python use the cross compiler name from CC, which will be exported to environment when we do cross compilation. If environment didn't define the CC, the default compiler name will be used, I mean, host compiler name.
Thanks
Lei
Quoted 5 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Saul Wold
AppliedQuoted 23 lines · Mei Lei
Hi,
This patch will fix an compiler finding issue.
The CC variable, its value sometimes like "x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. This will confuse python when finding the compiler name, wrong compiler name "qemux86-64" were found rather than the "x86_64-poky-linux-gcc".
When I fixing python-pycairo multilib dir issue, above issue appeared and block the compile process. Please review it.Thanks
LeiThe following changes since commit
819f18f8bc000f13b644edc194d2a12b4ea5fecf:
Richard Purdie (1):
Move architecture specificTARGET_OSmangling into tune filesare available in the git repository at:
git://git.pokylinux.org/poky-contriblmei3/python-pycairo
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lmei3/python-pycairoMei Lei (1):
python-native: Fix a compiler finding issue.../python/python-native/unixccompiler.patch | 20 ++++++++++++++++++++ .../recipes-devtools/python/python-native_2.6.6.bb | 3 ++- 2 files changed, 22 insertions(+), 1 deletions(-)
Quoted 8 lines
create mode 100644
meta/recipes-devtools/python/python-native/unixccompiler.patch_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Merged to OE-Core
Thanks
Sau!