Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7065078rdb; Fri, 15 Dec 2023 17:25:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpiG42ahuUTsz56FultE5rZIlDGv92QVhhOI+tf0v9M7nOxTpgDkMkCjjhh5RoCoByZYo4 X-Received: by 2002:a05:6808:ecb:b0:3b8:b063:ae0b with SMTP id q11-20020a0568080ecb00b003b8b063ae0bmr14787306oiv.104.1702689934124; Fri, 15 Dec 2023 17:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702689934; cv=none; d=google.com; s=arc-20160816; b=JOS/vJLh6GESWdjpjxAA6sdvDiYtVVj+PVwrVJ1n7frydy9ZQSMDsYEnjsmaH/bhA/ rFRY2f0JjlhAffVI2xbRbdabltTZAINBwZw0fBP73NLOqOUakLcKyaF3lig0BaF9qfwl J8MIUyDhT7lovacbNS5BcAi0Sc/nxIQaKXXGqQf7Tvvk4XTsHcBEtcMI4zfx0Ae8j5Dp g7dD2k3VWc6oPPuOLpS1df+fYx91jA/2K1kxgrg2hJiy5zBcgqGW8pOkMHWcxywiTA1N xObj/FBG35y0G6r/Wt8BAE6KLiqXqmSwWeVjKWM8nr5N1cxlTff9FWNCi2Tc382OJIbk nRGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=QxCicugglJzL7zrhOH4HAow06j/jqHC8FuLc3UZlZyo=; fh=LopFy8wtJfnMb8/BQCBgvBbV2Mav7b06O3HqI0nLfz0=; b=ojSOkmEd2nw0CRhS9JSfnMpj3hYpLfj2mNW5zHvJXidj2zJ8qAJOnDwvTvlu4juabW c3QMhqH4unqR0kiu+IdCTl3ggHBI2GPaUwxmP3k1+FXxMP4G+IZSkWcHHWVvgiOrl6dO /BVi74pb+YaT1GcK40phUOqkDWyCagHE30IVvbQ79oDrLFIuuizSA0pZE57IEsJIQsit DPF8AKdAln4TT9uP/YLq5zadt5DWdZl27lN+DGZzOsIi9Ii3cct37iIxhgjRZUDVetfS Yrfn9LNzjdjJXVMja6+ETWaeQqQrAteI+w8SUsT7viO+ZfSZRx6VKPU7UagPHUZqCi5p igrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KroAWxM3; spf=pass (google.com: domain of linux-kernel+bounces-1926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id br5-20020a056a00440500b006d27e451899si1884294pfb.126.2023.12.15.17.25.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 17:25:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KroAWxM3; spf=pass (google.com: domain of linux-kernel+bounces-1926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2399FB24039 for ; Sat, 16 Dec 2023 01:25:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C94B1116; Sat, 16 Dec 2023 01:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KroAWxM3" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36CD310EE; Sat, 16 Dec 2023 01:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B7B9C433CB; Sat, 16 Dec 2023 01:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702689922; bh=occtvWUQzDAQVVpXxNZtIid/3QZhQJ78ogsGIb239N4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KroAWxM3X8tRxn5qSsu8U09GCAvrF0XKdNmvVDazPxGWnrchrR2veYaURK4PjN4dT KQFeMeldFE1eepTnrf4fXWbcEJ2zkxuwJifA9/yJ5B9GtFhEr2MDpI3WZ1CNWXskgI 44TiKf00Jw4bgtyhIsN0kgme4x3L0YiOSQNK8lGA5j20KXmLBEymTNBjpf2wt+j2VQ bm9XL76B7SJTtIUhgov6qYjMcJb/xxQol4ujRVD0T4znhfHZwTZZYxn01HdI4lN135 jHMqeyya/b0aqCJFSL+vLil0M0T/jBiF1qGkBGRFCHxGrUWoJ2GnycoRGdqW6v6gSD turdbQtvOyLXQ== Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-1f060e059a3so897418fac.1; Fri, 15 Dec 2023 17:25:22 -0800 (PST) X-Gm-Message-State: AOJu0YzjZOw1fLQbGez6IPeh12V5dyMS739dRnXB3onm75TE4PFhcyl5 3FwEWB0AxqYgez6WFw8ur9Ta2jNZqT8+EQz0u00= X-Received: by 2002:a05:6870:b605:b0:1fa:fcd5:9bb6 with SMTP id cm5-20020a056870b60500b001fafcd59bb6mr15146364oab.22.1702689921925; Fri, 15 Dec 2023 17:25:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Sat, 16 Dec 2023 10:24:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: make deb-pkg: Does not strip debug symbols when compressing modules To: Salvatore Bonaccorso Cc: Nathan Chancellor , Nicolas Schier , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Hutchings , Bastian Blank Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2023 at 5:16=E2=80=AFAM Salvatore Bonaccorso wrote: > > Hi, > > On Thu, Dec 14, 2023 at 09:10:41PM +0100, Salvatore Bonaccorso wrote: > > Hi > > > > When using (only tested with XZ compression, but the others should > > behave similarly) CONFIG_MODULE_COMPRESS_XZ=3Dy to compress the modules= , > > it looks that the debug symbols are not striped. > > > > Building with the attached test configuration results in packages: > > > > -rw-r--r-- 1 build build 8.9M Dec 14 20:47 linux-headers-6.7.0-rc5+_6.= 7.0-rc5-00042-g88035e5694a8-1_amd64.deb > > -rw-r--r-- 1 build build 75M Dec 14 20:48 linux-image-6.7.0-rc5+-dbg_= 6.7.0-rc5-00042-g88035e5694a8-1_amd64.deb > > -rw-r--r-- 1 build build 1014M Dec 14 20:47 linux-image-6.7.0-rc5+_6.7.= 0-rc5-00042-g88035e5694a8-1_amd64.deb > > -rw-r--r-- 1 build build 1.3M Dec 14 20:47 linux-libc-dev_6.7.0-rc5-00= 042-g88035e5694a8-1_amd64.deb > > > > This is odd, the linux-image-6.7.0-rc5+ package has a size of almost > > 1G and the modules are not stripped. > > > > Switching the values instread to > > > > CONFIG_MODULE_COMPRESS_NONE=3Dy > > # CONFIG_MODULE_COMPRESS_XZ is not set > > > > the packages are again produced correctly: > > > > -rw-r--r-- 1 build build 8.9M Dec 14 20:59 linux-headers-6.7.0-rc5+_6.7= .0-rc5-00042-g88035e5694a8-2_amd64.deb > > -rw-r--r-- 1 build build 819M Dec 14 21:00 linux-image-6.7.0-rc5+-dbg_6= .7.0-rc5-00042-g88035e5694a8-2_amd64.deb > > -rw-r--r-- 1 build build 73M Dec 14 20:59 linux-image-6.7.0-rc5+_6.7.0= -rc5-00042-g88035e5694a8-2_amd64.deb > > -rw-r--r-- 1 build build 1.3M Dec 14 20:59 linux-libc-dev_6.7.0-rc5-000= 42-g88035e5694a8-2_amd64.deb > > and the classical one. Missed to attach the promised attachement. The > used config is now here. > > Regards, > Salvatore The debug package never compiled properly with module compression. The suffix of modules is .ko.xz instead of .ko in your case. The following line in scripts/package/builddeb does not match anything. for module in $(find ${image_pdir}/lib/modules/ -name *.ko -printf '%P\n'); do So, nothing is copied to linux-image-dbg, nothing is stripped from linux-im= age. Debian kernel does similar, and it was OK because Debian does not enable CONFIG_MODULE_COMPRESS_*. Recently, the following commit was applied. [1] commit de26137e2a9f847ce65e370d4bf61745f75a4e5d Author: Bastian Blank AuthorDate: Wed Dec 14 09:52:23 2022 +0100 Commit: Bastian Blank CommitDate: Sun Oct 8 10:29:38 2023 +0200 Drop not needed extra step to add debug links The build step already includes a sufficient GNU debug link section containing a build ID in the kernel modules. This means we don't have to manually create one later, so remove the code that does it. Perhaps, upstream kernel can do similar things to make the code simpler. ('make module_install INSTALL_MOD_STRIP=3D1' for linux-image, 'make modules_install' for linux-image-dbg) I CCed Ben and Bastian. [1] https://salsa.debian.org/kernel-team/linux/-/commit/de26137e2a9f847ce65= e370d4bf61745f75a4e5d --=20 Best Regards Masahiro Yamada