From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7121740689689280512 X-Received: by 2002:ab0:5964:0:b0:384:2576:fcd with SMTP id o33-20020ab05964000000b0038425760fcdmr191111uad.21.1658217914042; Tue, 19 Jul 2022 01:05:14 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a67:d307:0:b0:357:655:94fd with SMTP id a7-20020a67d307000000b00357065594fdls66389vsj.9.-pod-prod-gmail; Tue, 19 Jul 2022 01:05:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t2RM5JSa9P9y1yQ66hSlMJ5f+NClBhS9Inx/lrsGksmAU2kb24+Tv/yCUR0cc0fldlXKlr X-Received: by 2002:a67:d194:0:b0:357:8ea:5554 with SMTP id w20-20020a67d194000000b0035708ea5554mr11266029vsi.0.1658217912440; Tue, 19 Jul 2022 01:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658217912; cv=none; d=google.com; s=arc-20160816; b=pQHP2k3uiyBvazF/KqK3Q1IP4XEWUgIagf7lItnGM45gggIa66dnSJ1tuYDumdZwp8 Rle28R/kJ8/kHMThZV6mx13ETgbPGncokiyYmb/Z9cEieZ4eczwP4+bG2vNCrQEpMk8a UVYrJPGizARv8FFIJDew5qjL1Oid9fwM1FkPNIEblWGijUtE4q/UynXNHrTe++9PWAw7 AjhdEm40Z5UGG9RRY06XLqr65DDwTjxQSANSxYKghG+v+I4gClbtEPUbCeTnVAP9fYci rKCRLfl64EnKK01YgfaHu95tNrGh0t9B5Nl0tni49/zPL8QRVsUfJPqlyST4MVsYKqPd ToCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=L+jJV+blznCvyM9TT8SA2Q2s3mUDAsWVcaFYlV5Laes=; b=i8vG899g0EztmE/AwbkN/CnAmZ6OBpKvr9YTQy9mKAXsR3FVXWur+TWgdy7JxV8NNw xzq8zSvZBASF5aosajFZSkDBRhEjqb/cJ8MUWqbjdJ88qJhivtGJztdRMwmOfoppRGXH mlFfnX4W4DDu7sLXeZJOyGu6wuSJIiEscuXoOlzuyp4IbbU/alzWuZTFrBqZuyXdpi8E tamGYVTr1BvBngXYYeqsRPPtEcMS3bM9uaDNP/FRSP+2JMGVCkmmxFdYiNe9w5iIKk/v whTwY4YfO0uEhmoLT0nR0MnXUQBTLoA5M7vSUm95ElvbdPve1XZQ9KmEk29irjoaStHV RaLw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id g15-20020a1f200f000000b0036c18b4c646si683345vkg.2.2022.07.19.01.05.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jul 2022 01:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from home.localnet (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 26J8588j014204 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jul 2022 10:05:09 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com, Felix Moessbauer Subject: Re: [PATCH] make debug symbols of kernel build relocatable Date: Tue, 19 Jul 2022 11:05:05 +0300 Message-ID: <4704443.OV4Wx5bFTl@home> In-Reply-To: <20220718155056.2305093-1-felix.moessbauer@siemens.com> References: <20220718155056.2305093-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: hFxFCigVyJmx 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 > --- > 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