From patchwork Mon Nov 14 08:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 15454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 784E0C4332F for ; Mon, 14 Nov 2022 08:17:38 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web10.3290.1668413853442512888 for ; Mon, 14 Nov 2022 00:17:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nathanrossi.com header.s=google header.b=I/Nx32UK; spf=pass (domain: nathanrossi.com, ip: 209.85.216.50, mailfrom: nathan@nathanrossi.com) Received: by mail-pj1-f50.google.com with SMTP id c15-20020a17090a1d0f00b0021365864446so9902328pjd.4 for ; Mon, 14 Nov 2022 00:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; h=mime-version:content-transfer-encoding:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=RK/SqMMJjbIUbuck5Lk+tyl0Jt8j8OWilGE8F6EJ41E=; b=I/Nx32UKaucuccMZvMd2Ex0LU7IvmITblER+vNHnDjBxfDnWfcxn3Vbl1Pza6cKCBT cYJ8Uo5VTpqcBpWpEdlNgpIwX0trm6go9hGZFXPPeTfO2SouHMV4kBUpew1r+JFon0ER j0PoQQ4JvThlxaAuujC7piMVBOFxWPtQWH4eZoW8dEV0pLjws5nwtJ4WcZvJCiSXUzs9 fJUVnHWRqsHlWDR+9zjR4aX2DIKpx0NoAPRB4ZBvfFxHCr8mW6niI9lNap3lW5PNTn9n nBJ7scr+350up5SmO4aC9t4xZr0x8bOfdxnaUrS6ocKXIUOS96JZOo+DU+TUxyDJi3Ry 8bkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:content-transfer-encoding:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RK/SqMMJjbIUbuck5Lk+tyl0Jt8j8OWilGE8F6EJ41E=; b=vSARm9L9/qQ+JmvufS6tmKH6rV1clJkC180CeoM+y52WkFRf1LyxmaLWkZ2r0G/yvi dzXOB5Qa3VTbLJ/ySrO36L24re6PchXSnKTQDSwl2O1jJHQpLG68y/9I0oUGiHYmPmzX 6+h+1HmmizCkt6kHzkTT0BS5JjFC8xgw+QpE41dQjU070XhFq+3gfm+hzmGaYKUIrDyf f9UpIUR10EQKEDh7MvUgpSXryGj+jnhV7D7RPbgOT8bV65mwj9cEA+ZVJCXFFTMgXBJT hQa+NPEtZfVQzLt0cvnqpAgn89Pd2QIOj1AUmPkW0d2HAzW+DYfZhsNQDewn3qY6kQSW j0iw== X-Gm-Message-State: ANoB5ploG8/XEMenFryrq8crIw3gY24SXXg5oUjXS6EMdFARC2dJqxZB gvbwtvs8rpgEU1l/wPGuoPQ9Y8Wv2Dbl8w== X-Google-Smtp-Source: AA0mqf6W37j5KgDhoDk1qrwgERMiWY8GuDLGe/nROT/OAOlI/+VvVlJ7qPvzmbHWrI+42ukfZfn8Kg== X-Received: by 2002:a17:90b:3755:b0:213:f0bb:a44d with SMTP id ne21-20020a17090b375500b00213f0bba44dmr12739936pjb.237.1668413852315; Mon, 14 Nov 2022 00:17:32 -0800 (PST) Received: from [127.0.1.1] (117-20-68-146.751444.bne.nbn.aussiebb.net. [117.20.68.146]) by smtp.gmail.com with UTF8SMTPSA id x128-20020a623186000000b0056da2ad6503sm6095871pfx.39.2022.11.14.00.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 00:17:30 -0800 (PST) Date: Mon, 14 Nov 2022 08:17:18 +0000 Message-Id: <20221114081718.50468-1-nathan@nathanrossi.com> From: Nathan Rossi To: openembedded-core@lists.openembedded.org Cc: Nathan Rossi , Nathan Rossi , Steve Sakoman Subject: [kirkstone][PATCH 1/4] oeqa/selftest/lic_checksum: Cleanup changes to emptytest include MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 14 Nov 2022 08:17:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173228 From: Nathan Rossi Config written to the emptytest include file is invalid after the test has cleaned up its temporary directories resulting in the emptytest recipe potentially having invalid content when parsed by successive bitbake runs. This presents the following error in tests after lic_checksum execution, e.g. 'oe-selftest -r lic_checksum recipetool' ERROR: .../emptytest.bb: Unable to get checksum for emptytest SRC_URI entry tmpn_nyosnq: file could not be found Remove the recipe include content once the bitbake runs are completed in each lic_checksum test case. Signed-off-by: Nathan Rossi Signed-off-by: Alexandre Belloni (cherry picked from commit 087df767a64b271b503d714df3df6d8b3caad1c0) --- meta/lib/oeqa/selftest/cases/lic_checksum.py | 2 ++ 1 file changed, 2 insertions(+) --- 2.38.1 diff --git a/meta/lib/oeqa/selftest/cases/lic_checksum.py b/meta/lib/oeqa/selftest/cases/lic_checksum.py index 8f1226e6a5..bc0a2b5d8e 100644 --- a/meta/lib/oeqa/selftest/cases/lic_checksum.py +++ b/meta/lib/oeqa/selftest/cases/lic_checksum.py @@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e" SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e" """ % (urllib.parse.quote(lic_path), urllib.parse.quote(lic_path))) result = bitbake(bitbake_cmd) + self.delete_recipeinc('emptytest') # Verify that changing a license file that has an absolute path causes @@ -51,5 +52,6 @@ SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e" f.write("data") result = bitbake(bitbake_cmd, ignore_status=True) + self.delete_recipeinc('emptytest') if error_msg not in result.output: raise AssertionError(result.output) From patchwork Mon Nov 14 08:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 15455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 515DAC4332F for ; Mon, 14 Nov 2022 08:17:48 +0000 (UTC) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mx.groups.io with SMTP id smtpd.web10.3292.1668413859768674215 for ; Mon, 14 Nov 2022 00:17:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nathanrossi.com header.s=google header.b=PlSdBzyX; spf=pass (domain: nathanrossi.com, ip: 209.85.215.179, mailfrom: nathan@nathanrossi.com) Received: by mail-pg1-f179.google.com with SMTP id 62so1277852pgb.13 for ; Mon, 14 Nov 2022 00:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; h=mime-version:content-transfer-encoding:subject:cc:to:from :references:in-reply-to:message-id:date:from:to:cc:subject:date :message-id:reply-to; bh=J/V7cdNfquPszFuAEW9Mq3ArFg++fV3I2r9x3HEfZZc=; b=PlSdBzyX49Fu7RnKuDOpH0IGJOut+FHnz1RjwByB+X6vgqTRJnT+5ZvEzDZ2WbfY2Z pwYhi0Pwn9vaeGdUTI5aGlKdUtXVMZVDhNfMcQ9EchESe8LJwwiPIWBrXkRqJGjZJnus HKsJqmDfKlWRSecQpZBqyBp629dg5YuNizKTa5Z5xUBx4CqdO72LktzaV1NUN+FR/jdu asKqA13AM26lkWrQyXrDUu/el9+uUJL0gF1ju+LZj6iQr/IRqVjnQyOa/oGiJWfEw/ar +5yuFE4TVChuqKXp4J9c5SaAwsuW3KPG4xZxQGGCkgHCj8/zB+gNsibSXOS7RWarDMmD 5lZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:content-transfer-encoding:subject:cc:to:from :references:in-reply-to:message-id:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=J/V7cdNfquPszFuAEW9Mq3ArFg++fV3I2r9x3HEfZZc=; b=oDlRe4f0EBs1ljM+OXWgPy2Xv1/tOIKtwrl/OYP/YAuQLKL/ILQIIfWH8UD85USRAa yk308XBUizirBKLD3I2GuMhwt3Kigj1VR64mDA9SQa/cGkl5Ahoyivjbw5EskzMOHuIE vpeWaSBvVGOH8wInckhqTRuRFWMMSaL0WxBv+Cv7iKsPn8ToSbWx+htn1ob4c2EFmLMG gUr25gBYNRCmrBhsSVqvapmfWmHuBIrQJ0rCoSYNYzVch//cjAqX7jW+AA60Fh4pfLbW /TKhVHbRFUkPoCH0kMUJ9hq7ebJEYMbMuEB1DR1YwcRPwxm7Jiejbspy9Rbyx0TXP0jR BQwQ== X-Gm-Message-State: ANoB5pkW6uB8bJ2KqIph5g7V7JP3o387IS5li6MFQNXwzOcMr3nZLiPO W91QERNRVx0uJLjJstVUCCt9ECQwK/1uwg== X-Google-Smtp-Source: AA0mqf7n5/jmHrobhUko0KUW2KbfmGQCEUpIaaIBXD6grYc/ohhRZHLWRISvi3TOjFb5fG4QDYhn4w== X-Received: by 2002:a63:4859:0:b0:457:4863:2e85 with SMTP id x25-20020a634859000000b0045748632e85mr10850476pgk.6.1668413858747; Mon, 14 Nov 2022 00:17:38 -0800 (PST) Received: from [127.0.1.1] (117-20-68-146.751444.bne.nbn.aussiebb.net. [117.20.68.146]) by smtp.gmail.com with UTF8SMTPSA id d14-20020a170902654e00b001743ba85d39sm6731707pln.110.2022.11.14.00.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 00:17:37 -0800 (PST) Date: Mon, 14 Nov 2022 08:17:18 +0000 Message-Id: <20221114081718.50468-2-nathan@nathanrossi.com> In-Reply-To: <20221114081718.50468-1-nathan@nathanrossi.com> References: <20221114081718.50468-1-nathan@nathanrossi.com> From: Nathan Rossi To: openembedded-core@lists.openembedded.org Cc: Nathan Rossi , Nathan Rossi , Steve Sakoman Subject: [kirkstone][PATCH 2/4] oeqa/selftest/minidebuginfo: Create selftest for minidebuginfo MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 14 Nov 2022 08:17:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173229 From: Nathan Rossi Add a new selftest to validate minidebuginfo support. This selftest builds a complete target image with PACKAGE_MINIDEBUGINFO enabled. ELFs included in the image are expected to have minidebuginfo included in the resulting executables and shared libraries, the self test validates this by unpacking the image and checking for the associated ".gnu_debugdata" section on busybox and libc ELFs. Signed-off-by: Nathan Rossi Signed-off-by: Alexandre Belloni (cherry picked from commit 5063a31ad05b75ec6ac12158fe759e81fcdb1585) --- The commit from master relies on the 'target_sys' parameter of runCmd, this was introduced in afa3d3ba00b40fd29e9852eeaa2c2c9b68f18659 (langdale and later). That commit could be backported alongside this commit however it adds '/bin' to the PATH by default which may cause issues (?). As such this commit is modified to add the TARGET_SYS path into the PATH environment passed into the runCmd call. --- meta/lib/oeqa/selftest/cases/minidebuginfo.py | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/minidebuginfo.py --- 2.38.1 diff --git a/meta/lib/oeqa/selftest/cases/minidebuginfo.py b/meta/lib/oeqa/selftest/cases/minidebuginfo.py new file mode 100644 index 0000000000..414dad64a3 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/minidebuginfo.py @@ -0,0 +1,49 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# +import os +import subprocess +import tempfile +import shutil + +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake, get_bb_var, runCmd + + +class Minidebuginfo(OESelftestTestCase): + def test_minidebuginfo(self): + target_sys = get_bb_var("TARGET_SYS") + binutils = "binutils-cross-{}".format(get_bb_var("TARGET_ARCH")) + + self.write_config(""" +PACKAGE_MINIDEBUGINFO = "1" +IMAGE_FSTYPES = "tar.bz2" +""") + bitbake("core-image-minimal {}:do_addto_recipe_sysroot".format(binutils)) + + deploy_dir = get_bb_var("DEPLOY_DIR_IMAGE") + native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", binutils) + readelf = get_bb_var("READELF", "core-image-minimal") + + # add usr/bin/${TARGET_SYS} to PATH + env = os.environ.copy() + paths = [os.path.join(native_sysroot, "usr", "bin", target_sys)] + paths += env["PATH"].split(":") + env["PATH"] = ":".join(paths) + + # confirm that executables and shared libraries contain an ELF section + # ".gnu_debugdata" which stores minidebuginfo. + with tempfile.TemporaryDirectory(prefix = "unpackfs-") as unpackedfs: + filename = os.path.join(deploy_dir, "core-image-minimal-{}.tar.bz2".format(self.td["MACHINE"])) + shutil.unpack_archive(filename, unpackedfs) + + r = runCmd([readelf, "-W", "-S", os.path.join(unpackedfs, "bin", "busybox")], + native_sysroot = native_sysroot, env = env) + self.assertIn(".gnu_debugdata", r.output) + + r = runCmd([readelf, "-W", "-S", os.path.join(unpackedfs, "lib", "libc.so.6")], + native_sysroot = native_sysroot, env = env) + self.assertIn(".gnu_debugdata", r.output) + From patchwork Mon Nov 14 08:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 15456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52417C433FE for ; Mon, 14 Nov 2022 08:17:48 +0000 (UTC) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.web11.3322.1668413866729481408 for ; Mon, 14 Nov 2022 00:17:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nathanrossi.com header.s=google header.b=iKUSAe0g; spf=pass (domain: nathanrossi.com, ip: 209.85.214.171, mailfrom: nathan@nathanrossi.com) Received: by mail-pl1-f171.google.com with SMTP id w23so2959569ply.12 for ; Mon, 14 Nov 2022 00:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; h=mime-version:content-transfer-encoding:subject:cc:to:from :references:in-reply-to:message-id:date:from:to:cc:subject:date :message-id:reply-to; bh=WkswO2YP8PCN/C7p5/C85ie00YIW3dLhkfH9lHLBedc=; b=iKUSAe0gtVjOUb/HTQDa+OFQ0ZyCDJc5Lz2kjdWkmgJi9phdWoOgEOyPB76IoN5HG8 /iycxf/p0ADB7VpObmjKAn692elNfgY5aMbqQxuaA7Mdnwl2ZP6ChOjWBF28/YaUI7b/ Eb1HlKLKlgDus5xdLj4WSxmDTHauwqzDmbJvDiGiXyo8J1Y67N2X4+zq6d+iAVOch7cu xWozvZ5r5AJ9JkKZnQgrO/11wbXUIQdvqQiCw1C/r0Eu52E63mmdSQDEIaA2/1YoJoyI WarIcU1UEMcK/72tGoaJ0Xxk6IajaF+zyad7AGiE0FX9Ob3JAwdKZ17/0B4cy3esImpG mKKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:content-transfer-encoding:subject:cc:to:from :references:in-reply-to:message-id:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WkswO2YP8PCN/C7p5/C85ie00YIW3dLhkfH9lHLBedc=; b=ziKa8wxVYhKSYCmBlYFFqCTteSk5+y3ltjZegTbutuPunJTiyIZozmFB5NCVeDFf1p 65Pgygj2TzjoHeNiMoappU4ajoX9gjyVEUW/U5uh1NH5NFlIJhz9yIrdaTKJMHdE+H9b ZvFpQG4N0QTqDpzOA90sXWENrRrcZ3y5LIvJ9mAmT3lB0NDbjMvLJTWcz0XdyNW2448k 7lPpEy+hvx95synCHPikY+Zyo3cujUDUBJ09p9+R2WuUH6y5ReGfRqyX05/4uRQbk8Lj kg+UnS58EyQA9vI9MugYLf8y1O7tzZAfbyJUwr5qxKJy1kKO44WfZZXQCE5M0tA9JYTE NVOQ== X-Gm-Message-State: ANoB5pl9EPOZkmxbJ6L13Mjsov0dHHZ8/fm64zxsAaVT9EvXVVVLUt0c KmoopZwYFNy3JoXhxsHS4kF5MrPSfbPmzA== X-Google-Smtp-Source: AA0mqf4CrF2rhtA3IyX0L5KlN4U2ctkKoOug2ZMgyOB4g9X8sUuszLhUh3VilFEwbvLJ6KvmGnGkUA== X-Received: by 2002:a17:903:210a:b0:186:9f20:e7e2 with SMTP id o10-20020a170903210a00b001869f20e7e2mr12244552ple.174.1668413865821; Mon, 14 Nov 2022 00:17:45 -0800 (PST) Received: from [127.0.1.1] (117-20-68-146.751444.bne.nbn.aussiebb.net. [117.20.68.146]) by smtp.gmail.com with UTF8SMTPSA id jb1-20020a170903258100b00183c67844aesm6722885plb.22.2022.11.14.00.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 00:17:44 -0800 (PST) Date: Mon, 14 Nov 2022 08:17:18 +0000 Message-Id: <20221114081718.50468-3-nathan@nathanrossi.com> In-Reply-To: <20221114081718.50468-1-nathan@nathanrossi.com> References: <20221114081718.50468-1-nathan@nathanrossi.com> From: Nathan Rossi To: openembedded-core@lists.openembedded.org Cc: Nathan Rossi , Nathan Rossi , Steve Sakoman Subject: [kirkstone][PATCH 3/4] glibc-locale: Do not INHIBIT_DEFAULT_DEPS MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 14 Nov 2022 08:17:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173230 From: Nathan Rossi The glibc-locale recipe already partially depends on the base depends in order to satisfy the do_package dependency on binutils. However since commit d6ffd683bf6 NM has defaulted to gcc-nm, meaning do_package depends on gcc (for minidebuginfo). Whilst the do_package task could handle having the dependencies explicitly defined (either in glibc-locale or in package.bbclass), setting these would require some amount of conditional dependency configuration (cross/crosssdk/etc.). Since both binutils and gcc are already dependencies of virtual/libc (although compilerlibs is not), having glibc-locale not inhibit the default depends simplifies the handling of this situation for both glibc-locale and package.bbclass. Signed-off-by: Nathan Rossi Signed-off-by: Alexandre Belloni (cherry picked from commit 8a40d0a6039e87a5b4b26a0e84dd797fe5c75cba) --- meta/recipes-core/glibc/glibc-locale.inc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) --- 2.38.1 diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc index 7c14abfe99..7f70b3ca4f 100644 --- a/meta/recipes-core/glibc/glibc-locale.inc +++ b/meta/recipes-core/glibc/glibc-locale.inc @@ -5,14 +5,9 @@ SUMMARY = "Locale data from glibc" BPN = "glibc" LOCALEBASEPN = "${MLPREFIX}glibc" -# glibc-collateral.inc inhibits all default deps, but do_package needs objcopy -# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'glibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'glibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so') -# ERROR: Function failed: split_and_strip_files -BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot" -BINUTILSDEP:class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot" -do_package[depends] += "${BINUTILSDEP}" - -DEPENDS += "virtual/libc" +# Do not inhibit default deps, do_package requires binutils/gcc for +# objcopy/gcc-nm and glibc-locale depends on virtual/libc directly. +INHIBIT_DEFAULT_DEPS = "" # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION # is set. The idea is to avoid running localedef on the target (at first boot) From patchwork Mon Nov 14 08:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 15457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2854C4332F for ; Mon, 14 Nov 2022 08:17:58 +0000 (UTC) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mx.groups.io with SMTP id smtpd.web08.3263.1668413874758705392 for ; Mon, 14 Nov 2022 00:17:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nathanrossi.com header.s=google header.b=WHLVtTnx; spf=pass (domain: nathanrossi.com, ip: 209.85.210.171, mailfrom: nathan@nathanrossi.com) Received: by mail-pf1-f171.google.com with SMTP id b29so10286860pfp.13 for ; Mon, 14 Nov 2022 00:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; h=mime-version:content-transfer-encoding:subject:cc:to:from :references:in-reply-to:message-id:date:from:to:cc:subject:date :message-id:reply-to; bh=KQCBCyr2ptTR5++CHLIG+yLPB8BCJlU1KfYjd3p0AC4=; b=WHLVtTnxU7Jkm/RTQkELKwwaP7lMRyIOOiaALiloam9sjLnPhU0fa3fs5FPlnqaVoG KiPZuC/cXTXuXexGxoMAd10+nY3x/O7ZZNGQlqlUP8W06t0tXDfYh7mVPgoNbF9ICgOm Yg2ZpKGY6e3uwD+LLWmD6l3b7i0Zjr+ysYaI5lxA+ZzM9vkvh6siuU2Ac/2F505hh8D+ nUQq+DCqbdlaDNmwi89Frmid575d/WYP0UOm64MPmDO5/YxHxQSVyNurMqDrkRWWj8+5 DzqHPFS+oCj2Oal1wYo6OiPcqi/G3tWzi84XlwFDN6PlFdNQ8Y1bVkiyKm+EkJgxHqHy ut2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:content-transfer-encoding:subject:cc:to:from :references:in-reply-to:message-id:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KQCBCyr2ptTR5++CHLIG+yLPB8BCJlU1KfYjd3p0AC4=; b=S5g+rIKb6kQV13+GxDaXo/yaTJlYCpc3luMTl/1lcWX+U/FxbT7xBKhvUyi72KZygH bxcEWaVfmCxrLS4Y9Ytn909NFa1jsO75uGSaOinL5JCN1yFbJ8whkkM/kmy86Fg/KiAa d3q1pcik223yjGut3h4naPw/02MtXUXkA5R3RD6lfHO5PzjA/Mm5apeFULl/ndItCDci 7J10p4b9R4bnxclEDDe5Iz2vWheB2AVKLr6k5Asuxj0oe/MwdpvyNLJphGBLawINhFDa 1hdAHrsb7srCQD/9AIB8EIudZKgSxTIhz7Uk0aeDelX9XBaurhwTJ/lhdTdmyLYQ3EdI giRQ== X-Gm-Message-State: ANoB5pmI4T2BlaBvfZ+mzO8/NUuyYbvUxVKnMNQyHe94bii0PG+v0CJX BVU2t2Hk+d2NEFbJ26ahSrWmST2mFPTlew== X-Google-Smtp-Source: AA0mqf5/8Ei/1bIsjz/+uebEygTwPsBmFL4ftl+FTo8H7cizcZsuxbBOYiduJ8iBElV+2vXUU39khQ== X-Received: by 2002:a63:4622:0:b0:46f:9c0c:809c with SMTP id t34-20020a634622000000b0046f9c0c809cmr10940218pga.523.1668413873772; Mon, 14 Nov 2022 00:17:53 -0800 (PST) Received: from [127.0.1.1] (117-20-68-146.751444.bne.nbn.aussiebb.net. [117.20.68.146]) by smtp.gmail.com with UTF8SMTPSA id q13-20020aa7960d000000b0056a7486da77sm6272222pfg.13.2022.11.14.00.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 00:17:51 -0800 (PST) Date: Mon, 14 Nov 2022 08:17:18 +0000 Message-Id: <20221114081718.50468-4-nathan@nathanrossi.com> In-Reply-To: <20221114081718.50468-1-nathan@nathanrossi.com> References: <20221114081718.50468-1-nathan@nathanrossi.com> From: Nathan Rossi To: openembedded-core@lists.openembedded.org Cc: Nathan Rossi , Nathan Rossi , Steve Sakoman Subject: [kirkstone][PATCH 4/4] package: Fix handling of minidebuginfo with newer binutils MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 14 Nov 2022 08:17:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/173231 From: Nathan Rossi Newer versions of binutils (2.38+) have changed how the "--only-keep-debug" of objcopy behaves when stripping non-debug sections from an ELF. https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=68f543154e92ab0f5d6c569e0fa143f5e8bd2d80 This change causes associated sections to be correctly marked as NOBITS with the section contents removed from the output. The side effect is that this causes issues with objcopy's ability to perform symbol and relocation stripping (-S/--strip-all) on the debug split ELF, such that with some object files (e.g. kernel modules) objcopy fails to strip symbols/relocations with an error like the following: .../.debug/nls_cp950.ko[.rodata]: file truncated Because of this it is now problematic to generate minidebuginfo for these types of ELF objects. However it is not typically useful to inject minidebuginfo into these types of ELFs, and other distributions (e.g. Fedora, referring to find-debuginfo.sh of debugedit) only insert minidebuginfo into executables and shared libraries. This change causes the minidebuginfo injection to only apply to EXEC/DYN type ELFs, which limits the injection to executables and shared libraires. Additionally this change fixes the parsing of the sections from the "readelf -W -S" output which was not accounting for the section index column having leading spaces for single digit index values e.g. "[ 1]". Signed-off-by: Nathan Rossi Signed-off-by: Alexandre Belloni (cherry picked from commit 2084cfcb3d15db3e02637f1cd63ab9c997f38a65) --- meta/classes/package.bbclass | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) --- 2.38.1 diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 97e97d2703..8b11fdd155 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -484,16 +484,31 @@ def inject_minidebuginfo(file, dvar, dv, d): bb.debug(1, 'ELF file {} has no debuginfo, skipping minidebuginfo injection'.format(file)) return + # minidebuginfo does not make sense to apply to ELF objects other than + # executables and shared libraries, skip applying the minidebuginfo + # generation for objects like kernel modules. + for line in subprocess.check_output([readelf, '-h', debugfile], universal_newlines=True).splitlines(): + if not line.strip().startswith("Type:"): + continue + elftype = line.split(":")[1].strip() + if not any(elftype.startswith(i) for i in ["EXEC", "DYN"]): + bb.debug(1, 'ELF file {} is not executable/shared, skipping minidebuginfo injection'.format(file)) + return + break + # Find non-allocated PROGBITS, NOTE, and NOBITS sections in the debuginfo. # We will exclude all of these from minidebuginfo to save space. remove_section_names = [] for line in subprocess.check_output([readelf, '-W', '-S', debugfile], universal_newlines=True).splitlines(): - fields = line.split() - if len(fields) < 8: + # strip the leading " [ 1]" section index to allow splitting on space + if ']' not in line: + continue + fields = line[line.index(']') + 1:].split() + if len(fields) < 7: continue name = fields[0] type = fields[1] - flags = fields[7] + flags = fields[6] # .debug_ sections will be removed by objcopy -S so no need to explicitly remove them if name.startswith('.debug_'): continue