Skip to contentSkip to conversation

libulm: Fix "buildpaths" QA error

PATCH In review Ryan Eatmon 2 participants 3 messages Jul 19, 2024 – Jul 20, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libulm: Fix "buildpaths" QA error

The TI cl6x compiler does not have a mechanism for replacing paths in the obj files it creates. So replace the string we want to remove with an equally sized replacement string that does not contain the path.

---
 ...m-makefile-Fix-reproducibility-error.patch | 31 +++++++++++++++++++
 .../recipes-bsp/dsptop/libulm_git.bb          | 12 +++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +31 -0
new file mode 100644
index 00000000..6ea59517
@@ -0,0 +1,31 @@
+From 8619e4b2f983130bf1909cc9c9bc238cd43ded41 Mon Sep 17 00:00:00 2001
+From: Ryan Eatmon <[email protected]>
+Date: Fri, 19 Jul 2024 14:37:55 -0500
+Subject: [master][PATCH] dstop/ulm/makefile: Fix reproducibility error
+
+The TI cl6x compiler does not have a mechanism for replacing paths in
+the obj files it creates.  So replace the string we want to remove with
+an equally sized replacement string that does not contain the path.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Ryan Eatmon <[email protected]>
+---
+ makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/makefile b/makefile
+index dffb211..586dcc2 100644
+--- a/makefile
++++ b/makefile
+@@ -82,6 +82,7 @@ $(OBJDIR)/%.obj: %.c $(INCLUDE_FILES)
+ 	@echo "Compiling" $<
+ 	@mkdir -p $(OBJDIR)
+ 	$(CC) $(CFLAGS) $(INCLUDE_PATH) -fe $@ $<
++	perl -pi -e 's#${SEARCH}#${REPLACE}#g' $@
+ 
+ libtiulm.a libtiulm.ae66: $(OBJECTS)
+ 	@echo "Building target" $@
+-- 
+2.17.1
+
meta-ti-extras/recipes-bsp/dsptop/libulm_git.bb +10 -2
index 6a2cde30..aafae21f 100644
@@ -6,7 +6,7 @@ inherit features_check
 
 REQUIRED_MACHINE_FEATURES = "dsp"
 
-DEPENDS = "ti-cgt6x-native"
+DEPENDS = "ti-cgt6x-native perl-native"
 PR = "${INC_PR}.0"
 
 S = "${WORKDIR}/git/dsptop/ulm"
@@ -14,7 +14,13 @@ S = "${WORKDIR}/git/dsptop/ulm"
 DEVICE=""
 DEVICE:dra7xx = "DRA7xx"
 
-EXTRA_OEMAKE = "release DEVICE=${DEVICE} CROSS_COMPILE=${TARGET_PREFIX}"
+EXTRA_OEMAKE = " \
+    release \
+    DEVICE=${DEVICE} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    SEARCH=${WORKDIR} \
+    REPLACE=${@'_'*(len(d.getVar('WORKDIR'))-7)+"workdir"} \
+"
 
 do_compile() {
     oe_runmake arm XPORT_ONLY CC="${CC}"
@@ -40,6 +46,8 @@ FILES:${PN}-dev += "\
 
 include dsptop.inc
 
+SRC_URI += "file://0001-dstop-ulm-makefile-Fix-reproducibility-error.patch"
+
 ALLOW_EMPTY:${PN} = "1"
 
 PARALLEL_MAKE= ""
Signature · 1 line
2.17.1
#1 lore raw
Quoted 32 lines · Ryan Eatmon via lists.yoctoproject.org

The TI cl6x compiler does not have a mechanism for replacing paths in the obj files it creates. So replace the string we want to remove with an equally sized replacement string that does not contain the path.

---
 ...m-makefile-Fix-reproducibility-error.patch | 31 +++++++++++++++++++
 .../recipes-bsp/dsptop/libulm_git.bb          | 12 +++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +15 -0
new file mode 100644
index 00000000..6ea59517
@@ -0,0 +1,31 @@
+From 8619e4b2f983130bf1909cc9c9bc238cd43ded41 Mon Sep 17 00:00:00 2001
+From: Ryan Eatmon <[email protected]>
+Date: Fri, 19 Jul 2024 14:37:55 -0500
+Subject: [master][PATCH] dstop/ulm/makefile: Fix reproducibility error
+
+The TI cl6x compiler does not have a mechanism for replacing paths in
+the obj files it creates.  So replace the string we want to remove with
+an equally sized replacement string that does not contain the path.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Ryan Eatmon <[email protected]>
+---
+ makefile | 1 +
+ 1 file changed, 1 insertion(+)

meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch line 25

Quoted 10 lines
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +10 -0
+
+diff --git a/makefile b/makefile
+index dffb211..586dcc2 100644
+--- a/makefile
++++ b/makefile
+@@ -82,6 +82,7 @@ $(OBJDIR)/%.obj: %.c $(INCLUDE_FILES)
+ 	@echo "Compiling" $<
+ 	@mkdir -p $(OBJDIR)
+ 	$(CC) $(CFLAGS) $(INCLUDE_PATH) -fe $@ $<
++	perl -pi -e 's#${SEARCH}#${REPLACE}#g' $@

That assumes perl host tool dependency - is it safe? Can this be done with sed instead?

Quoted 45 lines
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +6 -0
+ 
+ libtiulm.a libtiulm.ae66: $(OBJECTS)
+ 	@echo "Building target" $@
+-- 
+2.17.1
+
meta-ti-extras/recipes-bsp/dsptop/libulm_git.bb +10 -2
index 6a2cde30..aafae21f 100644
@@ -6,7 +6,7 @@ inherit features_check
 
 REQUIRED_MACHINE_FEATURES = "dsp"
 
-DEPENDS = "ti-cgt6x-native"
+DEPENDS = "ti-cgt6x-native perl-native"
 PR = "${INC_PR}.0"
 
 S = "${WORKDIR}/git/dsptop/ulm"
@@ -14,7 +14,13 @@ S = "${WORKDIR}/git/dsptop/ulm"
 DEVICE=""
 DEVICE:dra7xx = "DRA7xx"
 
-EXTRA_OEMAKE = "release DEVICE=${DEVICE} CROSS_COMPILE=${TARGET_PREFIX}"
+EXTRA_OEMAKE = " \
+    release \
+    DEVICE=${DEVICE} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    SEARCH=${WORKDIR} \
+    REPLACE=${@'_'*(len(d.getVar('WORKDIR'))-7)+"workdir"} \
+"
 
 do_compile() {
     oe_runmake arm XPORT_ONLY CC="${CC}"
@@ -40,6 +46,8 @@ FILES:${PN}-dev += "\
 
 include dsptop.inc
 
+SRC_URI += "file://0001-dstop-ulm-makefile-Fix-reproducibility-error.patch"
+
 ALLOW_EMPTY:${PN} = "1"
 
 PARALLEL_MAKE= ""
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 38 lines · Denys Dmytriyenko
Quoted 37 lines · Ryan Eatmon via lists.yoctoproject.org

The TI cl6x compiler does not have a mechanism for replacing paths in the obj files it creates. So replace the string we want to remove with an equally sized replacement string that does not contain the path.

---
 ...m-makefile-Fix-reproducibility-error.patch | 31 +++++++++++++++++++
 .../recipes-bsp/dsptop/libulm_git.bb          | 12 +++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +20 -0
new file mode 100644
index 00000000..6ea59517
@@ -0,0 +1,31 @@
+From 8619e4b2f983130bf1909cc9c9bc238cd43ded41 Mon Sep 17 00:00:00 2001
+From: Ryan Eatmon <[email protected]>
+Date: Fri, 19 Jul 2024 14:37:55 -0500
+Subject: [master][PATCH] dstop/ulm/makefile: Fix reproducibility error
+
+The TI cl6x compiler does not have a mechanism for replacing paths in
+the obj files it creates.  So replace the string we want to remove with
+an equally sized replacement string that does not contain the path.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Ryan Eatmon <[email protected]>
+---
+ makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/makefile b/makefile
+index dffb211..586dcc2 100644
+--- a/makefile
++++ b/makefile
Quoted 8 lines

meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch line 25

Quoted 5 lines
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +5 -0
+@@ -82,6 +82,7 @@ $(OBJDIR)/%.obj: %.c $(INCLUDE_FILES)
+ 	@echo "Compiling" $<
+ 	@mkdir -p $(OBJDIR)
+ 	$(CC) $(CFLAGS) $(INCLUDE_PATH) -fe $@ $<
++	perl -pi -e 's#${SEARCH}#${REPLACE}#g' $@

That assumes perl host tool dependency - is it safe? Can this be done with sed instead?

Never mind - I see you have perl-native in DEPENDS.

And for patching binary files perl is definitely better than sed.

Quoted 44 lines
Quoted 44 lines
meta-ti-extras/recipes-bsp/dsptop/files/0001-dstop-ulm-makefile-Fix-reproducibility-error.patch new file +5 -0
+ libtiulm.a libtiulm.ae66: $(OBJECTS)
+ 	@echo "Building target" $@
+-- 
+2.17.1
+
meta-ti-extras/recipes-bsp/dsptop/libulm_git.bb +10 -2
index 6a2cde30..aafae21f 100644
@@ -6,7 +6,7 @@ inherit features_check
 
 REQUIRED_MACHINE_FEATURES = "dsp"
 
-DEPENDS = "ti-cgt6x-native"
+DEPENDS = "ti-cgt6x-native perl-native"
 PR = "${INC_PR}.0"
 
 S = "${WORKDIR}/git/dsptop/ulm"
@@ -14,7 +14,13 @@ S = "${WORKDIR}/git/dsptop/ulm"
 DEVICE=""
 DEVICE:dra7xx = "DRA7xx"
 
-EXTRA_OEMAKE = "release DEVICE=${DEVICE} CROSS_COMPILE=${TARGET_PREFIX}"
+EXTRA_OEMAKE = " \
+    release \
+    DEVICE=${DEVICE} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    SEARCH=${WORKDIR} \
+    REPLACE=${@'_'*(len(d.getVar('WORKDIR'))-7)+"workdir"} \
+"
 
 do_compile() {
     oe_runmake arm XPORT_ONLY CC="${CC}"
@@ -40,6 +46,8 @@ FILES:${PN}-dev += "\
 
 include dsptop.inc
 
+SRC_URI += "file://0001-dstop-ulm-makefile-Fix-reproducibility-error.patch"
+
 ALLOW_EMPTY:${PN} = "1"
 
 PARALLEL_MAKE= ""
Signature · 1 line
2.17.1