All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] package.bbclass: provide debug sources in externalsrc -dbg packages
@ 2018-05-17  5:50 Vignesh Rajendran
  2018-05-17  5:55 ` Vignesh Rajendran (RBEI/ECF3)
  2018-05-20 22:26 ` Paul Eggleton
  0 siblings, 2 replies; 16+ messages in thread
From: Vignesh Rajendran @ 2018-05-17  5:50 UTC (permalink / raw)
  To: openembedded-core

The recipes which are using externalsrc method doesn't contain the
debug sources in their -dbg packages.

Add a handling in copydebugsources function to copy the debugsources for
externalsrc -dbg packages.

Signed-off-by: Vignesh Rajendran <vignesh.rajendran@in.bosch.com>
---
 meta/classes/externalsrc.bbclass |  3 +++
 meta/classes/package.bbclass     | 12 ++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index c9f5cf7..135670d 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -129,6 +129,9 @@ python () {
             d.setVar('CONFIGURESTAMPFILE', configstamp)
             d.setVar('STAMP', '${STAMPS_DIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}')
             d.setVar('STAMPCLEAN', '${STAMPS_DIR}/work-shared/${PN}/*-*')
+
+	# set DEBUG_PREFIX_MAP to external source path
+	d.appendVar("DEBUG_PREFIX_MAP", "-fdebug-prefix-map=${EXTERNALSRC}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}")
 }
 
 python externalsrc_configure_prefunc() {
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index edeffa9..f071a2e 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -420,6 +420,7 @@ def copydebugsources(debugsrcdir, d):
         workdir = d.getVar("WORKDIR")
         workparentdir = os.path.dirname(os.path.dirname(workdir))
         workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)
+        externalsrc = d.getVar('EXTERNALSRC', True)
 
         # If build path exists in sourcefile, it means toolchain did not use
         # -fdebug-prefix-map to compile
@@ -444,9 +445,16 @@ def copydebugsources(debugsrcdir, d):
         processdebugsrc += "fgrep -zw '%s' | "
         # Remove prefix in the source paths
         processdebugsrc += "sed 's#%s##g' | "
-        processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)"
+        # handle external sources to provide sources in -dbg packages
+        if externalsrc:
+            localsrc_prefix = "/usr/src/debug/"
+            processdebugsrc += "sed 's#%s/##g' | "
+            processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s/%s' 2>/dev/null)"
+            cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workbasedir, externalsrc, dvar, debugsrcdir, workbasedir)
+        else:
+            processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)"
+            cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workparentdir, dvar, debugsrcdir)
 
-        cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workparentdir, dvar, debugsrcdir)
         (retval, output) = oe.utils.getstatusoutput(cmd)
         # Can "fail" if internal headers/transient sources are attempted
         #if retval:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread
* [meta-oe][PATCH] package.bbclass: provide debug sources in externalsrc -dbg packages
@ 2018-05-07  5:50 Vignesh Rajendran
  2018-05-16 12:11 ` Vignesh Rajendran (RBEI/ECF3)
  0 siblings, 1 reply; 16+ messages in thread
From: Vignesh Rajendran @ 2018-05-07  5:50 UTC (permalink / raw)
  To: openembedded-core

The recipes which are using externalsrc method doesn't contain the
debug sources in their -dbg packages.

Add a handling in copydebugsources function to copy the debugsources for
externalsrc -dbg packages.

Signed-off-by: Vignesh Rajendran <vignesh.rajendran@in.bosch.com>
---
 meta/classes/externalsrc.bbclass |  3 +++
 meta/classes/package.bbclass     | 14 +++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index c9f5cf7..135670d 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -129,6 +129,9 @@ python () {
             d.setVar('CONFIGURESTAMPFILE', configstamp)
             d.setVar('STAMP', '${STAMPS_DIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}')
             d.setVar('STAMPCLEAN', '${STAMPS_DIR}/work-shared/${PN}/*-*')
+
+	# set DEBUG_PREFIX_MAP to external source path
+	d.appendVar("DEBUG_PREFIX_MAP", "-fdebug-prefix-map=${EXTERNALSRC}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}")
 }
 
 python externalsrc_configure_prefunc() {
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index edeffa9..2c4472d 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -420,6 +420,7 @@ def copydebugsources(debugsrcdir, d):
         workdir = d.getVar("WORKDIR")
         workparentdir = os.path.dirname(os.path.dirname(workdir))
         workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)
+	externalsrc = d.getVar('EXTERNALSRC', True)
 
         # If build path exists in sourcefile, it means toolchain did not use
         # -fdebug-prefix-map to compile
@@ -444,10 +445,17 @@ def copydebugsources(debugsrcdir, d):
         processdebugsrc += "fgrep -zw '%s' | "
         # Remove prefix in the source paths
         processdebugsrc += "sed 's#%s##g' | "
-        processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)"
+        # handle external sources to provide sources in -dbg packages
+        if externalsrc:
+            localsrc_prefix = "/usr/src/debug/"
+            processdebugsrc += "sed 's#%s/##g' | "
+            processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s/%s' 2>/dev/null)"
+            cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workbasedir, externalsrc, dvar, debugsrcdir, workbasedir)
+        else:
+            processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)"
+            cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workparentdir, dvar, debugsrcdir)
 
-        cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workparentdir, dvar, debugsrcdir)
-        (retval, output) = oe.utils.getstatusoutput(cmd)
+	(retval, output) = oe.utils.getstatusoutput(cmd)
         # Can "fail" if internal headers/transient sources are attempted
         #if retval:
         #    bb.fatal("debug source copy failed with exit code %s (cmd was %s)" % (retval, cmd))
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-08-10  5:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17  5:50 [meta-oe][PATCH] package.bbclass: provide debug sources in externalsrc -dbg packages Vignesh Rajendran
2018-05-17  5:55 ` Vignesh Rajendran (RBEI/ECF3)
2018-05-20 22:26 ` Paul Eggleton
2018-05-21  4:50   ` Vignesh Rajendran (RBEI/ECF3)
2018-06-18  6:38   ` Vignesh Rajendran (RBEI/ECF3)
2018-06-18 17:43   ` Khem Raj
2018-06-19  4:54     ` Vignesh Rajendran (RBEI/ECF3)
2018-07-06  4:29     ` Vignesh Rajendran (RBEI/ECF3)
2018-07-06  4:50       ` Khem Raj
2018-07-12  7:00         ` Vignesh Rajendran (RBEI/ECF3)
2018-07-23 10:02         ` Vignesh Rajendran (RBEI/ECF3)
2018-07-30  4:46         ` Vignesh Rajendran (RBEI/ECF3)
2018-08-10  5:36         ` Vignesh Rajendran (RBEI/ECF3)
  -- strict thread matches above, loose matches on Subject: below --
2018-05-07  5:50 Vignesh Rajendran
2018-05-16 12:11 ` Vignesh Rajendran (RBEI/ECF3)
2018-05-16 12:53   ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.