Skip to contentSkip to conversation

gdbserver-c6x: Fix "buildpaths" QA error

PATCH New Ryan Eatmon 1 participant 1 message Jul 21, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gdbserver-c6x: Fix "buildpaths" QA error

The older TI compilers do not have a mechanism for replacing paths in the obj files they create. So replace the string we want to remove with an equally sized replacement string that does not contain the path.

---
 .../recipes-devtools/gdbc6x/gdbserver-c6x_git.bb         | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb +8 -1
index 3460eadb..0a31c67d 100644
@@ -2,7 +2,7 @@ DESCRIPTION = "TI gdb-server to be used with c6xgdb."
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://../debian/copyright;md5=82c616b6c8f9c11c46feaaf8f9a11495"
 
-DEPENDS = "ti-xdais ti-framework-components ti-cgt6x-native ti-sysbios ti-xdctools-native"
+DEPENDS = "ti-xdais ti-framework-components ti-cgt6x-native ti-sysbios ti-xdctools-native perl-native"
 
 PR = "${INC_PR}.0"
 
@@ -26,11 +26,18 @@ do_configure() {
     :
 }
 
+# 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_install() {
     install -d ${D}${datadir}/ti/gdbc6x/include
     install -d ${D}${datadir}/ti/gdbc6x/lib
     cp -f ../include/* ${D}${datadir}/ti/gdbc6x/include
     cp -f ../lib/* ${D}${datadir}/ti/gdbc6x/lib
+
+    # Update compiled files to remove build host paths
+    find ${D}${datadir}/ti/gdbc6x/lib -type f -exec perl -pi -e 's#${TMPDIR_FIX_SEARCH}#${TMPDIR_FIX_REPLACE}#g' {} \;
 }
 
 COMPATIBLE_MACHINE = "dra7xx"
Signature · 1 line
2.17.1