public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: Re: [PATCH] make debug symbols of kernel build relocatable
Date: Tue, 19 Jul 2022 11:05:05 +0300	[thread overview]
Message-ID: <4704443.OV4Wx5bFTl@home> (raw)
In-Reply-To: <20220718155056.2305093-1-felix.moessbauer@siemens.com>

In the email from Monday, 18 July 2022 18:50:56 +03 user Felix Moessbauer 
wrote:
> This patch adds support to inject custom KCFLAGS into
> the linux-custom kernel build.
> Using this infrastructure, we add the debug-prefix-map
> flag to strip off the absolute prefix of the sources location.
> This makes the debug information relocatable.
> 
> By that, we also fix low ccache hit rates in combination with ssbuild
> due to the random builddir that sbuild uses.

Hello.

I also came to the similar solution while debugging the issue, but I tried to 
use `-fdebug-prefix-map` directly in the build scripts.

The idea with placing it on recipe side and passing to the builder via KCFLAGS 
looks better and more extendable.

A small typo 'ssbuild' in commit message could be fixed during merge.

> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  meta/recipes-kernel/linux/files/debian/isar/build.tmpl | 2 +-
>  meta/recipes-kernel/linux/files/debian/rules.tmpl      | 3 ++-
>  meta/recipes-kernel/linux/linux-custom.inc             | 4 ++++
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
> b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl index
> b7749cec..8fe816b3 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
> @@ -22,7 +22,7 @@ do_build() {
>      set -x
> 
>      # Build the Linux kernel
> -    ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} || exit ${?}
> +    ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" ||
> exit ${?}
> 
>      # Stop tracing
>      set +x
> diff --git a/meta/recipes-kernel/linux/files/debian/rules.tmpl
> b/meta/recipes-kernel/linux/files/debian/rules.tmpl index
> a1166287..8063c495 100755
> --- a/meta/recipes-kernel/linux/files/debian/rules.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/rules.tmpl
> @@ -13,7 +13,8 @@ isar_env=$(strip \
>  	export DEB_HOST_GNU_TYPE='$(DEB_HOST_GNU_TYPE)' && \
>  	export MAKE='$(MAKE)' && \
>  	export O='${O}' && \
> -	export S='${S}' \
> +	export S='${S}' && \
> +	export CURDIR='$(CURDIR)' \
>  )
> 
>  %:
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc index a6b1cdab..55bf0418
> 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -78,11 +78,15 @@ TEMPLATE_VARS += "                \
>      LINUX_VERSION_EXTENSION       \
>      KERNEL_NAME_PROVIDED          \
>      KERNEL_CONFIG_FRAGMENTS       \
> +    KCFLAGS                       \
>  "
> 
>  inherit dpkg
>  inherit template
> 
> +# Add custom cflags to the kernel build
> +KCFLAGS ?= "-fdebug-prefix-map=${CURDIR}=."
> +
>  # Derive name of the kernel packages from the name of this recipe
>  KERNEL_NAME_PROVIDED ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"


-- 
Uladzimir Bely




  reply	other threads:[~2022-07-19  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 15:50 Felix Moessbauer
2022-07-19  8:05 ` Uladzimir Bely [this message]
2022-07-21 12:50 ` Anton Mikanovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4704443.OV4Wx5bFTl@home \
    --to=ubely@ilbers.de \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox