Patchwork [meta-oe] gdb-cross-canadian: build gdb with python support

login
register
mail settings
Submitter Eric BENARD
Date Dec. 23, 2011, 7:12 a.m.
Message ID <1324624336-18713-1-git-send-email-eric@eukrea.com>
Download mbox | patch
Permalink /patch/17543/
State Accepted
Commit d3c1760a8fc9365585888b5d6a3db9965eb0174f
Headers show

Comments

Eric BENARD - Dec. 23, 2011, 7:12 a.m.
* python support is needed for providing finer scripting control
in gdb, and for remote controling gdb for example from qtcreator
* gdb/configure tries to autodetect python using python executable
with --includes --ldflags --exec-prefix to get the right flags
As it's difficult to achieve in OE's context, we generate a
script which will return the right values and make gdb's build
system happy. This idea was taken from the following article :
http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
* tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 .../gdb/gdb-cross-canadian_7.3.1.bbappend          |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
Otavio Salvador - Dec. 23, 2011, 11:02 a.m.
+1 :-) very cool :-D

2011/12/23 Eric Bénard <eric@eukrea.com>

> * python support is needed for providing finer scripting control
> in gdb, and for remote controling gdb for example from qtcreator
> * gdb/configure tries to autodetect python using python executable
> with --includes --ldflags --exec-prefix to get the right flags
> As it's difficult to achieve in OE's context, we generate a
> script which will return the right values and make gdb's build
> system happy. This idea was taken from the following article :
>
> http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0
>
> Signed-off-by: Eric Bénard <eric@eukrea.com>
> ---
>  .../gdb/gdb-cross-canadian_7.3.1.bbappend          |   20
> ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
>  create mode 100644
> meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
>
> diff --git
> a/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
> b/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
> new file mode 100644
> index 0000000..3bbfe38
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
> @@ -0,0 +1,20 @@
> +DEPENDS += "python-nativesdk"
> +RDEPENDS += "python-nativesdk-core python-nativesdk-lang
> python-nativesdk-re \
> +                        python-nativesdk-codecs
> python-nativesdk-netclient"
> +
> +EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
> +PRINC = "1"
> +
> +do_configure_prepend() {
> +cat > ${WORKDIR}/python << EOF
> +#! /bin/sh
> +case "\$2" in
> +       --includes) echo
> "-I${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/"
> ;;
> +       --ldflags) echo
> "-L${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config
> -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
> +       --exec-prefix) echo "/usr" ;;
> +       *) exit 1 ;;
> +esac
> +exit 0
> +EOF
> +       chmod +x ${WORKDIR}/python
> +}
> --
> 1.7.6.4
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
Khem Raj - Jan. 4, 2012, 5:18 a.m.
On (23/12/11 08:12), Eric Bénard wrote:
> * python support is needed for providing finer scripting control
> in gdb, and for remote controling gdb for example from qtcreator
> * gdb/configure tries to autodetect python using python executable
> with --includes --ldflags --exec-prefix to get the right flags
> As it's difficult to achieve in OE's context, we generate a
> script which will return the right values and make gdb's build
> system happy. This idea was taken from the following article :
> http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0

I think this change should go into oe-core. Can you please redo it
w.r.t. oe-core 

> 
> Signed-off-by: Eric Bénard <eric@eukrea.com>
> ---
>  .../gdb/gdb-cross-canadian_7.3.1.bbappend          |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
>  create mode 100644 meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
> 
> diff --git a/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend b/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
> new file mode 100644
> index 0000000..3bbfe38
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
> @@ -0,0 +1,20 @@
> +DEPENDS += "python-nativesdk"
> +RDEPENDS += "python-nativesdk-core python-nativesdk-lang python-nativesdk-re \
> +			 python-nativesdk-codecs python-nativesdk-netclient"
> +
> +EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
> +PRINC = "1"
> +
> +do_configure_prepend() {
> +cat > ${WORKDIR}/python << EOF
> +#! /bin/sh
> +case "\$2" in
> +	--includes) echo "-I${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/" ;;
> +	--ldflags) echo "-L${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
> +	--exec-prefix) echo "/usr" ;;
> +	*) exit 1 ;;
> +esac
> +exit 0
> +EOF
> +	chmod +x ${WORKDIR}/python
> +}
> -- 
> 1.7.6.4
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Eric BENARD - Jan. 4, 2012, 8:05 a.m.
Hi Khem,

Le Tue, 3 Jan 2012 21:18:49 -0800,
Khem Raj <raj.khem@gmail.com> a écrit :
> On (23/12/11 08:12), Eric Bénard wrote:
> > * python support is needed for providing finer scripting control
> > in gdb, and for remote controling gdb for example from qtcreator
> > * gdb/configure tries to autodetect python using python executable
> > with --includes --ldflags --exec-prefix to get the right flags
> > As it's difficult to achieve in OE's context, we generate a
> > script which will return the right values and make gdb's build
> > system happy. This idea was taken from the following article :
> > http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> > * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0
> 
> I think this change should go into oe-core. Can you please redo it
> w.r.t. oe-core 
> 
I agree with you, I initally submited it for oe-core and was asked
to put it into meta-oe by Jessica :
http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014828.html
http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014833.html

Eric
Martin Jansa - Feb. 2, 2012, 7:45 a.m.
On Wed, Jan 4, 2012 at 9:05 AM, Eric Bénard <eric@eukrea.com> wrote:
> Hi Khem,
>
> Le Tue, 3 Jan 2012 21:18:49 -0800,
> Khem Raj <raj.khem@gmail.com> a écrit :
>> On (23/12/11 08:12), Eric Bénard wrote:
>> > * python support is needed for providing finer scripting control
>> > in gdb, and for remote controling gdb for example from qtcreator
>> > * gdb/configure tries to autodetect python using python executable
>> > with --includes --ldflags --exec-prefix to get the right flags
>> > As it's difficult to achieve in OE's context, we generate a
>> > script which will return the right values and make gdb's build
>> > system happy. This idea was taken from the following article :
>> > http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
>> > * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0
>>
>> I think this change should go into oe-core. Can you please redo it
>> w.r.t. oe-core
>>
> I agree with you, I initally submited it for oe-core and was asked
> to put it into meta-oe by Jessica :
> http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014828.html
> http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014833.html
>
> Eric

Hi Eric,

with this patch I see gdb-cross-canadian_7.3.1.bb failing with:
| checking whether to use python...
/OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
| checking for python2.7... no
| configure: error: no usable python found at
/OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python

and
/OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
is really script from this patch

Any hint how to fix this?

Cheers,
Eric BENARD - Feb. 2, 2012, 8:06 a.m.
Hi Martin,

Le Thu, 2 Feb 2012 08:45:13 +0100,
Martin Jansa <martin.jansa@gmail.com> a écrit :

> On Wed, Jan 4, 2012 at 9:05 AM, Eric Bénard <eric@eukrea.com> wrote:
> > Hi Khem,
> >
> > Le Tue, 3 Jan 2012 21:18:49 -0800,
> > Khem Raj <raj.khem@gmail.com> a écrit :
> >> On (23/12/11 08:12), Eric Bénard wrote:
> >> > * python support is needed for providing finer scripting control
> >> > in gdb, and for remote controling gdb for example from qtcreator
> >> > * gdb/configure tries to autodetect python using python executable
> >> > with --includes --ldflags --exec-prefix to get the right flags
> >> > As it's difficult to achieve in OE's context, we generate a
> >> > script which will return the right values and make gdb's build
> >> > system happy. This idea was taken from the following article :
> >> > http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> >> > * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0
> >>
> >> I think this change should go into oe-core. Can you please redo it
> >> w.r.t. oe-core
> >>
> > I agree with you, I initally submited it for oe-core and was asked
> > to put it into meta-oe by Jessica :
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014828.html
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014833.html
> >
> > Eric
> 
> Hi Eric,
> 
> with this patch I see gdb-cross-canadian_7.3.1.bb failing with:
> | checking whether to use python...
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> | checking for python2.7... no
> | configure: error: no usable python found at
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> 
> and
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> is really script from this patch
> 
> Any hint how to fix this?
> 
can you check the content of :
${WORKDIR}/python
and if
${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/
and
${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config  
exist ?

Eric
Martin Jansa - Feb. 2, 2012, 8:40 a.m.
On Thu, Feb 02, 2012 at 08:45:13AM +0100, Martin Jansa wrote:
> On Wed, Jan 4, 2012 at 9:05 AM, Eric Bénard <eric@eukrea.com> wrote:
> > Hi Khem,
> >
> > Le Tue, 3 Jan 2012 21:18:49 -0800,
> > Khem Raj <raj.khem@gmail.com> a écrit :
> >> On (23/12/11 08:12), Eric Bénard wrote:
> >> > * python support is needed for providing finer scripting control
> >> > in gdb, and for remote controling gdb for example from qtcreator
> >> > * gdb/configure tries to autodetect python using python executable
> >> > with --includes --ldflags --exec-prefix to get the right flags
> >> > As it's difficult to achieve in OE's context, we generate a
> >> > script which will return the right values and make gdb's build
> >> > system happy. This idea was taken from the following article :
> >> > http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> >> > * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0
> >>
> >> I think this change should go into oe-core. Can you please redo it
> >> w.r.t. oe-core
> >>
> > I agree with you, I initally submited it for oe-core and was asked
> > to put it into meta-oe by Jessica :
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014828.html
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014833.html
> >
> > Eric
> 
> Hi Eric,
> 
> with this patch I see gdb-cross-canadian_7.3.1.bb failing with:
> | checking whether to use python...
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> | checking for python2.7... no
> | configure: error: no usable python found at
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> 
> and
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> is really script from this patch
> 
> Any hint how to fix this?

And here are details from:
gdb-cross-canadian-arm-7.3.1-r5.1/build-arm-oe-linux-gnueabi/gdb/config.log

configure:10440: $? = 0
configure:10440: result: yes
configure:10465: checking whether to use python
configure:10467: result: /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
configure:10685: checking for python2.7
configure:10703: x86_64-oesdk-linux-gcc  --sysroot=/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux -o conftest -isystem/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include -O2 -pipe -isystem/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include  -I/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include/python2.7/  -L/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi -Wl,-rpath-link,/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi -Wl,-rpath,/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi -Wl,-O1 -L/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-rpath-link,/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-rpath,/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-O1 conftest.c -lncurses -lz -lm    -L/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi/python2.7/config/config -lpthread -ldl -lutil -lm -lpython2.7 >&5
conftest.c:91:20: fatal error: Python.h: No such file or directory
compilation terminated.

And Python.h is in
/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7/Python.h
not
/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include/python2.7/

oecore-x86_64-arm doesn't exist at all in /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local

Cheers,
Eric BENARD - Feb. 2, 2012, 8:58 a.m.
Hi Martin,

(sorry if you get the mail twice, I'm trying with a new smtp as the
previous one seems to have high latency with mailing lists).

Le Thu, 2 Feb 2012 08:45:13 +0100,
Martin Jansa <martin.jansa@gmail.com> a écrit :

> On Wed, Jan 4, 2012 at 9:05 AM, Eric Bénard <eric@eukrea.com> wrote:  
> > Hi Khem,
> >
> > Le Tue, 3 Jan 2012 21:18:49 -0800,
> > Khem Raj <raj.khem@gmail.com> a écrit :  
> >> On (23/12/11 08:12), Eric Bénard wrote:  
> >> > * python support is needed for providing finer scripting control
> >> > in gdb, and for remote controling gdb for example from qtcreator
> >> > * gdb/configure tries to autodetect python using python executable
> >> > with --includes --ldflags --exec-prefix to get the right flags
> >> > As it's difficult to achieve in OE's context, we generate a
> >> > script which will return the right values and make gdb's build
> >> > system happy. This idea was taken from the following article :
> >> > http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> >> > * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0  
> >>
> >> I think this change should go into oe-core. Can you please redo it
> >> w.r.t. oe-core
> >>  
> > I agree with you, I initally submited it for oe-core and was asked
> > to put it into meta-oe by Jessica :
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014828.html
> > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014833.html
> >
> > Eric  
> 
> Hi Eric,
> 
> with this patch I see gdb-cross-canadian_7.3.1.bb failing with:
> | checking whether to use python...
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> | checking for python2.7... no
> | configure: error: no usable python found at
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> 
> and
> /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> is really script from this patch
> 
> Any hint how to fix this?
>   
can you check the content of :
${WORKDIR}/python
and if
${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/
and
${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config  
exist ?

Eric
Martin Jansa - Feb. 2, 2012, 9:17 a.m.
On Thu, Feb 02, 2012 at 09:40:00AM +0100, Martin Jansa wrote:
> On Thu, Feb 02, 2012 at 08:45:13AM +0100, Martin Jansa wrote:
> > On Wed, Jan 4, 2012 at 9:05 AM, Eric Bénard <eric@eukrea.com> wrote:
> > > Hi Khem,
> > >
> > > Le Tue, 3 Jan 2012 21:18:49 -0800,
> > > Khem Raj <raj.khem@gmail.com> a écrit :
> > >> On (23/12/11 08:12), Eric Bénard wrote:
> > >> > * python support is needed for providing finer scripting control
> > >> > in gdb, and for remote controling gdb for example from qtcreator
> > >> > * gdb/configure tries to autodetect python using python executable
> > >> > with --includes --ldflags --exec-prefix to get the right flags
> > >> > As it's difficult to achieve in OE's context, we generate a
> > >> > script which will return the right values and make gdb's build
> > >> > system happy. This idea was taken from the following article :
> > >> > http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> > >> > * tested using angstrom & armv7/armv5 targets & qtcreator 201005 & 2.4.0
> > >>
> > >> I think this change should go into oe-core. Can you please redo it
> > >> w.r.t. oe-core
> > >>
> > > I agree with you, I initally submited it for oe-core and was asked
> > > to put it into meta-oe by Jessica :
> > > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014828.html
> > > http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014833.html
> > >
> > > Eric
> > 
> > Hi Eric,
> > 
> > with this patch I see gdb-cross-canadian_7.3.1.bb failing with:
> > | checking whether to use python...
> > /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> > | checking for python2.7... no
> > | configure: error: no usable python found at
> > /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> > 
> > and
> > /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> > is really script from this patch
> > 
> > Any hint how to fix this?
> 
> And here are details from:
> gdb-cross-canadian-arm-7.3.1-r5.1/build-arm-oe-linux-gnueabi/gdb/config.log
> 
> configure:10440: $? = 0
> configure:10440: result: yes
> configure:10465: checking whether to use python
> configure:10467: result: /OE/shr-core/tmp/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm/gdb-cross-canadian-arm-7.3.1-r5.1/python
> configure:10685: checking for python2.7
> configure:10703: x86_64-oesdk-linux-gcc  --sysroot=/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux -o conftest -isystem/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include -O2 -pipe -isystem/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include  -I/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include/python2.7/  -L/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi -Wl,-rpath-link,/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi -Wl,-rpath,/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi -Wl,-O1 -L/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-rpath-link,/OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-rpath,/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-O1 conftest.c -lncurses -lz -lm    -L/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv4t-oe-linux-gnueabi/python2.7/config/config -lpthread -ldl -lutil -lm -lpython2.7 >&5
> conftest.c:91:20: fatal error: Python.h: No such file or directory
> compilation terminated.
> 
> And Python.h is in
> /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7/Python.h
> not
> /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include/python2.7/
> 
> oecore-x86_64-arm doesn't exist at all in /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local

OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/
oecore-x86_64-arm
OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/
oecore-x86_64-x86_64

OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/ -name python2.7
OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/ -name python2.7
/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/python2.7
/OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7

and gdb is trying to use oecore-x86_64-arm in x86_64-nativesdk-oesdk-linux

Cheers,
Eric BENARD - Feb. 2, 2012, 10:11 a.m.
Hi Martin,

Le Thu, 2 Feb 2012 10:17:26 +0100,
Martin Jansa <martin.jansa@gmail.com> a écrit :
> OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/
> oecore-x86_64-arm
> OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/
> oecore-x86_64-x86_64
> 
using Angstrom I don't have the same directories here :
[ebenard@eb-e6520 setup-scripts]$ ls
build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/
angstrom-eglibc-x86_64-armv5te

> OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/ -name python2.7
> OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/ -name python2.7
> /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/python2.7
> /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7
> 
strange :
$ find build/tmp-angstrom_2010_x-eglibc/sysroots/ -name python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/at91sam9m10g45ek/usr/include/python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/at91sam9m10g45ek/usr/lib/python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/angstrom-eglibc-x86_64-armv5te/sysroots/x86_64-angstromsdk-linux/usr/include/python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/angstrom-eglibc-x86_64-armv5te/sysroots/x86_64-angstromsdk-linux/usr/lib/python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/bin/python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/include/python2.7
build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/lib/python2.7

Eric
Martin Jansa - Feb. 3, 2012, 7:28 a.m.
On Thu, Feb 02, 2012 at 11:11:27AM +0100, Eric Bénard wrote:
> Hi Martin,
> 
> Le Thu, 2 Feb 2012 10:17:26 +0100,
> Martin Jansa <martin.jansa@gmail.com> a écrit :
> > OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/
> > oecore-x86_64-arm
> > OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/
> > oecore-x86_64-x86_64
> > 
> using Angstrom I don't have the same directories here :
> [ebenard@eb-e6520 setup-scripts]$ ls
> build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/
> angstrom-eglibc-x86_64-armv5te

I usually don't build SDKs, so I'm not really not familiar with
oesdk-linux-nativesdk and nativesdk-oesdk-linux differences :/

But I'll try your patch for oe-core
http://patchwork.openembedded.org/patch/17129/
with oe-core only (and distroless) and if it behaves the same I'll
report on oe-core ML.

Cheers,

> 
> > OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/ -name python2.7
> > OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/ -name python2.7
> > /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/python2.7
> > /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7
> > 
> strange :
> $ find build/tmp-angstrom_2010_x-eglibc/sysroots/ -name python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/at91sam9m10g45ek/usr/include/python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/at91sam9m10g45ek/usr/lib/python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/angstrom-eglibc-x86_64-armv5te/sysroots/x86_64-angstromsdk-linux/usr/include/python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/angstrom-eglibc-x86_64-armv5te/sysroots/x86_64-angstromsdk-linux/usr/lib/python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/bin/python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/include/python2.7
> build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/lib/python2.7
> 
> Eric
> -- 
> http://eukrea.com/en/news/104-2012
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Martin Jansa - Feb. 3, 2012, 9:41 a.m.
On Fri, Feb 03, 2012 at 08:28:08AM +0100, Martin Jansa wrote:
> On Thu, Feb 02, 2012 at 11:11:27AM +0100, Eric Bénard wrote:
> > Hi Martin,
> > 
> > Le Thu, 2 Feb 2012 10:17:26 +0100,
> > Martin Jansa <martin.jansa@gmail.com> a écrit :
> > > OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/
> > > oecore-x86_64-arm
> > > OE @ ~ $ ls /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/
> > > oecore-x86_64-x86_64
> > > 
> > using Angstrom I don't have the same directories here :
> > [ebenard@eb-e6520 setup-scripts]$ ls
> > build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/
> > angstrom-eglibc-x86_64-armv5te
> 
> I usually don't build SDKs, so I'm not really not familiar with
> oesdk-linux-nativesdk and nativesdk-oesdk-linux differences :/
> 
> But I'll try your patch for oe-core
> http://patchwork.openembedded.org/patch/17129/
> with oe-core only (and distroless) and if it behaves the same I'll
> report on oe-core ML.

It fails the same when building from scratch for qemuarm in distroless
oe-core:

bitbake -k gdb-cross-canadian-arm
...
| checking whether to use python... /OE/oe-core/tmp-eglibc/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm-7.3.1-r5.1/python
| checking for python2.7... no
| configure: error: no usable python found at /OE/oe-core/tmp-eglibc/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm-7.3.1-r5.1/python
...

from config.log
configure:10465: checking whether to use python
configure:10467: result: /OE/oe-core/tmp-eglibc/work/x86_64-nativesdk-oesdk-linux/gdb-cross-canadian-arm-7.3.1-r5.1/python
configure:10685: checking for python2.7
configure:10703: x86_64-oesdk-linux-gcc  --sysroot=/OE/oe-core/tmp-eglibc/sysroots/x86_64-nativesdk-oesdk-linux -o conftest -isystem/OE/oe-core/tmp-eglibc/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include -O2 -pipe -isystem/OE/oe-core/tmp-eglibc/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include  -I/OE/oe-core/tmp-eglibc/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/include/python2.7/  -L/OE/oe-core/tmp-eglibc/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv5te-oe-linux-gnueabi -Wl,-rpath-link,/OE/oe-core/tmp-eglibc/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv5te-oe-linux-gnueabi -Wl,-rpath,/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv5te-oe-linux-gnueabi -Wl,-O1 -L/OE/oe-core/tmp-eglibc/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-rpath-link,/OE/oe-core/tmp-eglibc/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-rpath,/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/lib -Wl,-O1 conftest.c -lncurses -lz -lm    -L/OE/oe-core/tmp-eglibc/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr/lib/armv5te-oe-linux-gnueabi/python2.7/config/config -lpthread -ldl -lutil -lm -lpython2.7 >&5
conftest.c:91:20: fatal error: Python.h: No such file or directory

OE @ ~/oe-core/tmp-eglibc $ find sysroots/ -name python2.7
sysroots/x86_64-linux/usr/bin/python2.7
sysroots/x86_64-linux/usr/lib/python2.7
sysroots/x86_64-linux/usr/include/python2.7
sysroots/qemuarm/usr/lib/python2.7
sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/python2.7
sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7

in x86_64-oesdk-linux there are only gcc+binutils crosssdk
binutils-crosssdk-2.22-r2  gcc-crosssdk-4.6.2+svnr181430-r22  gcc-crosssdk-initial-4.6.2+svnr181430-r22  gcc-crosssdk-intermediate-4.6.2+svnr181430-r22
the rest is in 
x86_64-nativesdk-oesdk-linux

gdb-cross-canadian-arm is only package were exec_prefix points to oecore-x86_64-arm
./gdb-cross-canadian-arm-7.3.1-r5.1/temp/run.do_configure.1688
export exec_prefix="/usr/local/oecore-x86_64-arm/sysroots/x86_64-oesdk-linux/usr"

while all nativesdk packages are using oecore-x86_64-x86_64
./python-nativesdk-2.7.2-r0.5/temp/run.do_configure.14043
export exec_prefix="/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr"

So I think that using exec_prefix/libdir is wrong to when cross-canadian-arm is looking 
for nativesdk headers/libs. Don't know what are correct variables to use...

Cheers,

> 
> Cheers,
> 
> > 
> > > OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-oesdk-linux-nativesdk/usr/local/ -name python2.7
> > > OE @ ~ $ find /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/ -name python2.7
> > > /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/python2.7
> > > /OE/shr-core/tmp/sysroots/x86_64-nativesdk-oesdk-linux/usr/local/oecore-x86_64-x86_64/sysroots/x86_64-oesdk-linux/usr/include/python2.7
> > > 
> > strange :
> > $ find build/tmp-angstrom_2010_x-eglibc/sysroots/ -name python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/at91sam9m10g45ek/usr/include/python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/at91sam9m10g45ek/usr/lib/python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/angstrom-eglibc-x86_64-armv5te/sysroots/x86_64-angstromsdk-linux/usr/include/python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-nativesdk-angstromsdk-linux/usr/local/angstrom-eglibc-x86_64-armv5te/sysroots/x86_64-angstromsdk-linux/usr/lib/python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/bin/python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/include/python2.7
> > build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/lib/python2.7
> > 
> > Eric
> > -- 
> > http://eukrea.com/en/news/104-2012
> > 
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

Patch

diff --git a/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend b/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
new file mode 100644
index 0000000..3bbfe38
--- /dev/null
+++ b/meta-oe/recipes-devtools/gdb/gdb-cross-canadian_7.3.1.bbappend
@@ -0,0 +1,20 @@ 
+DEPENDS += "python-nativesdk"
+RDEPENDS += "python-nativesdk-core python-nativesdk-lang python-nativesdk-re \
+			 python-nativesdk-codecs python-nativesdk-netclient"
+
+EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
+PRINC = "1"
+
+do_configure_prepend() {
+cat > ${WORKDIR}/python << EOF
+#! /bin/sh
+case "\$2" in
+	--includes) echo "-I${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/" ;;
+	--ldflags) echo "-L${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+	--exec-prefix) echo "/usr" ;;
+	*) exit 1 ;;
+esac
+exit 0
+EOF
+	chmod +x ${WORKDIR}/python
+}