[OE-core] [meta-oe][PATCH] package.bbclass: provide debug sources in externalsrc -dbg packages

Vignesh Rajendran (RBEI/ECF3) Vignesh.Rajendran at in.bosch.com
Mon Jun 18 06:38:24 UTC 2018


Hello Openembedded-Core maintainers,

Since the commit from myself has its age more than a month at patchwork.openembedded.org, it is not arrived to master/next branch.
https://patchwork.openembedded.org/series/12005/# 
I could see some latest commits after mine just before few days are available at master branch.

Can you please let me know if anything went wrong from my end?

Mit freundlichen Grüßen / Best regards

Rajendran Vignesh
RBEI/ECF33  

Tel. +91 422 67-65103 


-----Original Message-----
From: Vignesh Rajendran (RBEI/ECF3) 
Sent: Monday, May 21, 2018 10:21 AM
To: 'Paul Eggleton' <paul.eggleton at linux.intel.com>
Cc: openembedded-core at lists.openembedded.org; Avanashilingam Gokulnath (RBEI/ECF3) <Gokulnath.Avanashilingam at in.bosch.com>; Thangaraj Sathish (RBEI/ECF3) <Sathish.Thangaraj at in.bosch.com>; Ramadevi Sennakeseavan <ramadevi.sennakesavan at in.bosch.com>
Subject: RE: [OE-core] [meta-oe][PATCH] package.bbclass: provide debug sources in externalsrc -dbg packages

Hello Paul,

>> Is there a way we can fix this without adding a reference to externalsrc in
>> package.bbclass?

>From my knowledge, No. 
Because the path of source location in debug binaries is pointed to the external path.
copydebugsources was the only option in my point of view to copy the sources from external path.

Do you find/foresee any issues regarding that change in package.bbclass?

Mit freundlichen Grüßen / Best regards

Rajendran Vignesh
RBEI/ECF33  

Tel. +91 422 67-65103 


-----Original Message-----
From: Paul Eggleton [mailto:paul.eggleton at linux.intel.com] 
Sent: Monday, May 21, 2018 3:56 AM
To: Vignesh Rajendran (RBEI/ECF3) <Vignesh.Rajendran at in.bosch.com>
Cc: openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] [meta-oe][PATCH] package.bbclass: provide debug sources in externalsrc -dbg packages

Hi Vignesh,

Thanks for the patch, a question below.

On Thursday, 17 May 2018 5:50:00 PM NZST Vignesh Rajendran wrote:
> 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 at 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:
> 

Is there a way we can fix this without adding a reference to externalsrc in
package.bbclass?

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre





More information about the Openembedded-core mailing list