From d5d69600e5afbf398e129071378a5655478ad4b9 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 27 May 2013 13:51:04 +0300 Subject: gdb-cross-canadian: use correct exec-prefix path for python Incorrect exec-prefix path was given to gdb which leads to gdb startup failure when SDK is not installed to its original destination. Gdb relocates the exec-prefix path, so it will work for SDKs that are installed to different location. PYTHONHOME env in no longer neeeded for gdb. Upstreamed to oe-core, putting here until it gets merged Change-Id: If3f5125a6063bf9eae56b2b6ecbdebb9939ad362 Reviewed-by: Samuli Piippo --- .../0001-help-python-find-itself-correctly.patch | 30 ---------------------- recipes/gdb/gdb-cross-canadian_7.5.1.bbappend | 17 +++++++++--- 2 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 recipes/gdb/files/0001-help-python-find-itself-correctly.patch (limited to 'recipes') diff --git a/recipes/gdb/files/0001-help-python-find-itself-correctly.patch b/recipes/gdb/files/0001-help-python-find-itself-correctly.patch deleted file mode 100644 index c836507..0000000 --- a/recipes/gdb/files/0001-help-python-find-itself-correctly.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d7496f873617892ce82b200c3acdf3d87141d06c Mon Sep 17 00:00:00 2001 -From: Samuli Piippo -Date: Thu, 9 May 2013 15:46:15 +0300 -Subject: [PATCH] help python find itself correctly - -The WITH_PYTHON_PATH python path does not work with relocatable -SDK. Instead use program name since it's bound to be in correct place. ---- - gdb/main.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/gdb/main.c b/gdb/main.c -index 976f8ae..aa1913d 100644 ---- a/gdb/main.c -+++ b/gdb/main.c -@@ -369,10 +369,7 @@ captured_main (void *data) - #ifdef WITH_PYTHON_PATH - { - /* For later use in helping Python find itself. */ -- char *tmp = concat (WITH_PYTHON_PATH, SLASH_STRING, "lib", NULL); -- -- python_libdir = relocate_gdb_directory (tmp, PYTHON_PATH_RELOCATABLE); -- xfree (tmp); -+ python_libdir = gdb_program_name; - } - #endif - --- -1.7.10.4 - diff --git a/recipes/gdb/gdb-cross-canadian_7.5.1.bbappend b/recipes/gdb/gdb-cross-canadian_7.5.1.bbappend index 6f08842..a13df13 100644 --- a/recipes/gdb/gdb-cross-canadian_7.5.1.bbappend +++ b/recipes/gdb/gdb-cross-canadian_7.5.1.bbappend @@ -1,4 +1,13 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI += "file://0001-help-python-find-itself-correctly.patch" - +do_compile_prepend() { +cat > ${WORKDIR}/python << EOF +#! /bin/sh +case "\$2" in + --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}" ;; + *) exit 1 ;; +esac +exit 0 +EOF + chmod +x ${WORKDIR}/python +} -- cgit v1.2.3-54-g00ecf