* [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled
@ 2012-03-23 12:50 Khem Raj
2012-03-23 13:02 ` Eric Bénard
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Khem Raj @ 2012-03-23 12:50 UTC (permalink / raw)
To: openembedded-core
gdb-cross-canadian was linking with static version of libpython
and looking for build host python when run. This could be mismatch
between python-nativesdk and build host provided python. So we
make it consistent to always use python-nativesdk
Instead of adding bunch of -L we add -rpath and -rpath-link
so that gdb finds all needed libraries in SDK and does not
reach out into host
This should fix yocto PR# 2077 as well.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 7 ++++---
.../recipes-devtools/gdb/gdb-cross-canadian_7.4.bb | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
index a7cac61..59412c4 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -1,4 +1,5 @@
inherit cross-canadian
+inherit python-dir
DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger"
PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
@@ -14,9 +15,9 @@ do_configure_prepend() {
cat > ${WORKDIR}/python << EOF
#! /bin/sh
case "\$2" in
- --includes) echo "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}/" ;;
- --ldflags) echo "-L${STAGING_LIBDIR}/../python${PYTHON_BASEVERSION}/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
- --exec-prefix) echo "/usr" ;;
+ --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+ --exec-prefix) echo "${exec_prefix}/bin" ;;
*) exit 1 ;;
esac
exit 0
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
index dbcffde..dfb7d81 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
@@ -1,7 +1,7 @@
require gdb-common.inc
require gdb-cross-canadian.inc
-PR = "${INC_PR}.3"
+PR = "${INC_PR}.4"
GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
EXPAT = "--with-expat"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled
2012-03-23 12:50 [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled Khem Raj
@ 2012-03-23 13:02 ` Eric Bénard
2012-03-23 14:01 ` Richard Purdie
2012-03-23 18:16 ` Kamble, Nitin A
2 siblings, 0 replies; 5+ messages in thread
From: Eric Bénard @ 2012-03-23 13:02 UTC (permalink / raw)
To: openembedded-core
Le Fri, 23 Mar 2012 05:50:41 -0700,
Khem Raj <raj.khem@gmail.com> a écrit :
> gdb-cross-canadian was linking with static version of libpython
> and looking for build host python when run. This could be mismatch
> between python-nativesdk and build host provided python. So we
> make it consistent to always use python-nativesdk
>
> Instead of adding bunch of -L we add -rpath and -rpath-link
> so that gdb finds all needed libraries in SDK and does not
> reach out into host
>
> This should fix yocto PR# 2077 as well.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Tested-by: Eric Bénard <eric@eukrea.com>
> ---
> meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 7 ++++---
> .../recipes-devtools/gdb/gdb-cross-canadian_7.4.bb | 2 +-
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> index a7cac61..59412c4 100644
> --- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> +++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> @@ -1,4 +1,5 @@
> inherit cross-canadian
> +inherit python-dir
>
> DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger"
> PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
> @@ -14,9 +15,9 @@ do_configure_prepend() {
> cat > ${WORKDIR}/python << EOF
> #! /bin/sh
> case "\$2" in
> - --includes) echo "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}/" ;;
> - --ldflags) echo "-L${STAGING_LIBDIR}/../python${PYTHON_BASEVERSION}/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
> - --exec-prefix) echo "/usr" ;;
> + --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;;
> + --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
> + --exec-prefix) echo "${exec_prefix}/bin" ;;
> *) exit 1 ;;
> esac
> exit 0
> diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
> index dbcffde..dfb7d81 100644
> --- a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
> +++ b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
> @@ -1,7 +1,7 @@
> require gdb-common.inc
> require gdb-cross-canadian.inc
>
> -PR = "${INC_PR}.3"
> +PR = "${INC_PR}.4"
>
> GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
> EXPAT = "--with-expat"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled
2012-03-23 12:50 [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled Khem Raj
2012-03-23 13:02 ` Eric Bénard
@ 2012-03-23 14:01 ` Richard Purdie
2012-03-23 18:16 ` Kamble, Nitin A
2 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2012-03-23 14:01 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Fri, 2012-03-23 at 05:50 -0700, Khem Raj wrote:
> gdb-cross-canadian was linking with static version of libpython
> and looking for build host python when run. This could be mismatch
> between python-nativesdk and build host provided python. So we
> make it consistent to always use python-nativesdk
>
> Instead of adding bunch of -L we add -rpath and -rpath-link
> so that gdb finds all needed libraries in SDK and does not
> reach out into host
>
> This should fix yocto PR# 2077 as well.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 7 ++++---
> .../recipes-devtools/gdb/gdb-cross-canadian_7.4.bb | 2 +-
> 2 files changed, 5 insertions(+), 4 deletions(-)
Merged to master, thanks!
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled
2012-03-23 12:50 [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled Khem Raj
2012-03-23 13:02 ` Eric Bénard
2012-03-23 14:01 ` Richard Purdie
@ 2012-03-23 18:16 ` Kamble, Nitin A
2012-03-23 20:51 ` Khem Raj
2 siblings, 1 reply; 5+ messages in thread
From: Kamble, Nitin A @ 2012-03-23 18:16 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Khem Raj
>
> gdb-cross-canadian was linking with static version of libpython
> and looking for build host python when run. This could be mismatch
> between python-nativesdk and build host provided python. So we
> make it consistent to always use python-nativesdk
>
Khem,
In my debug effort, I did not find that gdb-cross-canadian was
linking with static version of libpython. How did you find that out ?
I think I can learn a lot from you :)
Thanks,
Nitin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled
2012-03-23 18:16 ` Kamble, Nitin A
@ 2012-03-23 20:51 ` Khem Raj
0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2012-03-23 20:51 UTC (permalink / raw)
To: Kamble, Nitin A; +Cc: Patches and discussions about the oe-core layer
On Fri, Mar 23, 2012 at 11:16 AM, Kamble, Nitin A
<nitin.a.kamble@intel.com> wrote:
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org
>> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
>> Khem Raj
>>
>> gdb-cross-canadian was linking with static version of libpython
>> and looking for build host python when run. This could be mismatch
>> between python-nativesdk and build host provided python. So we
>> make it consistent to always use python-nativesdk
>>
>
>
> Khem,
> In my debug effort, I did not find that gdb-cross-canadian was
> linking with static version of libpython. How did you find that out ?
> I think I can learn a lot from you :)
Fire up gdb and persevere there is no secret sauce :) and hope for
good luck that you see something.
>
> Thanks,
> Nitin
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-23 21:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23 12:50 [PATCH] gdb-cross-canadian: Fix linking issues when python support is enabled Khem Raj
2012-03-23 13:02 ` Eric Bénard
2012-03-23 14:01 ` Richard Purdie
2012-03-23 18:16 ` Kamble, Nitin A
2012-03-23 20:51 ` Khem Raj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.