]> code.ossystems Code Review - openembedded-core.git/commitdiff
gdb-cross-canadian: Fix linking issues when python support is enabled
authorKhem Raj <raj.khem@gmail.com>
Fri, 23 Mar 2012 12:50:41 +0000 (05:50 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Mar 2012 14:00:43 +0000 (14:00 +0000)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gdb/gdb-cross-canadian.inc
meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb

index 47d7d28a2b79e8097b5598957f2442113caa0208..2b6069883e06fee5c6e848b572121afa3d5c9bcd 100644 (file)
@@ -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
index dfb7d8122ae8e52dad280ddb50526d1d4235e541..8e68c757827645df069d781c5fccb9967fdb8010 100644 (file)
@@ -1,7 +1,7 @@
 require gdb-common.inc
 require gdb-cross-canadian.inc
 
-PR = "${INC_PR}.4"
+PR = "${INC_PR}.5"
 
 GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
 EXPAT = "--with-expat"