The final binary contains paths on the host system.  Replace the string
we want to remove with an equally sized replacement string that does
not contain the path.

Signed-off-by: Ryan Eatmon <[email protected]>
---
 meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb 
b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb
index 1f296dc5..6a497e0f 100644
--- a/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb
+++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbc6x_git.bb
@@ -3,7 +3,7 @@ SECTION = "devel"
 LICENSE = "GPL-3.0-or-later"
 LIC_FILES_CHKSUM = 
"file://debian/copyright;md5=bf0fe2872eb3dfeebb2cbe38206fe81f"
 
-DEPENDS = "ncurses bison-native texinfo flex-native gettext"
+DEPENDS = "ncurses bison-native texinfo flex-native gettext perl-native"
 
 COMPATIBLE_MACHINE = "dra7xx"
 
@@ -21,6 +21,10 @@ inherit gettext
 
 CFLAGS += "-fcommon -fpermissive"
 
+# Variables to assist in searching/replacing the WORKDIR in binary files.
+TMPDIR_FIX_SEARCH = "${WORKDIR}"
+TMPDIR_FIX_REPLACE = "${@'_'*(len(d.getVar('WORKDIR'))-7)+"workdir"}"
+
 do_configure () {
     cd ${S}
     ./configure --program-suffix=c6x --target=tic6x-elf-tirtos 
--host=${HOST_SYS} --prefix=${S}/install_gdb
@@ -33,6 +37,9 @@ do_install () {
     install -d ${D}${bindir}
     install -d ${D}${includedir}
     install -m 755  ${S}/install_gdb/bin/gdbc6x ${D}${bindir} 
+
+    perl -pi -e 's#${TMPDIR_FIX_SEARCH}#${TMPDIR_FIX_REPLACE}#g' 
${D}${bindir}/gdbc6x
+
     cp -rf ${S}/install_gdb/include/* ${D}${includedir}
 
     install -d ${D}${sysconfdir}/init.d
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#17902): 
https://lists.yoctoproject.org/g/meta-ti/message/17902
Mute This Topic: https://lists.yoctoproject.org/mt/107468598/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to