diff mbox series

[meta-ti,master] gdbserver-c6x: Fix "buildpaths" QA error

Message ID 20240721154426.12219-1-reatmon@ti.com
State Rejected
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master] gdbserver-c6x: Fix "buildpaths" QA error | expand

Commit Message

Ryan Eatmon July 21, 2024, 3:44 p.m. UTC
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.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 .../recipes-devtools/gdbc6x/gdbserver-c6x_git.bb         | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb
index 3460eadb..0a31c67d 100644
--- a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb
+++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserver-c6x_git.bb
@@ -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"