From nobody Sun Feb 8 14:43:59 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B17A8335C0 for ; Thu, 23 Jan 2025 03:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737602267; cv=none; b=kpdHC0FTkLw0Fco98C1YUViDHLx6iYpGAhxGeyp51Cn7UCESPUG3+EHz2PazGyJafQcDTZh5x4L6qIhBhHBbitbv9lIsNfQKt1GFl+RFJJCvA+iVU1zmqAWYRfjrGPxdjcpTLPjSBI2qKCcukrUgo1YS08gyYbYTHc1Acn9nnFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737602267; c=relaxed/simple; bh=LoZ24LDHCMkiRgQF7grVTqyM789vNtixibi4AfHB3ig=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=AGCmFIzzBrk/MJRg/0fLjKppyMzQwsaCWo/sznRZp8Sxs162iXw6HnciTjvQ9oeKBBMDOwSD4l5jSDdv4Wm35JNxfXiNjRJIksU6FWWT7zi0u/wGPjBncOVUw4sJNpk/3NKioGqpNllVFqugcZZVfik/T6H4o8EMLfAdyvQ7RNA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=BNCDlgWR; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="BNCDlgWR" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-216426b0865so5853965ad.0 for ; Wed, 22 Jan 2025 19:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1737602265; x=1738207065; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=Yb1dQ0E63aBFcwViVcuk+RodzWEGNhIOogsy9MiuvXQ=; b=BNCDlgWRKmtYDl1U6RtWgxAUTlncUH0pxqcCseBILxBbDHF8pavrFNdQG0U5JNRUOx 3LQkEwRPrynDQH2x33ouL/m5MR8c5DFirY8C326wiWCCYGsC3Of96RIv5f+DLlSuvmSR bSj8sUdM4JVx6lsXxU7HDQsjdB3+KxE48/ogqhdxixHOVlPgm6MZOCIRO1VHpnwz3Cq1 3vQDR3zbcbOE3YrOPYNHHcqqj0Iu+p82jj7wH57mTVnvkbSUIqcG3SzMe+uE2VCrWDme zP1khN/Yblc9ZpaqwHtsqSrQ3CDyzjCLAQU+t9ek7Kl9YGJC+gEHhk7AEJyrbWZst9NQ DVEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737602265; x=1738207065; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Yb1dQ0E63aBFcwViVcuk+RodzWEGNhIOogsy9MiuvXQ=; b=KGDhJqnPB0rmaARIufdiWpwPnxj1TjhRpbHqOCtyhsGFvm3PUTPETJI0DfIYLc8krH 1rCTf3KnK/sqXqE04B2Rl/063+BdHs4Sz6VMdjp6FFKE1E8ly8PuNnHS1a63dcXiutYX hMCbr2zS78IY9MZ39QAhY22lcjU4sWidx1fdN2q4yXhce1z5WGK71WzLX9/6kM6/6tVK 3zUD9J1hrfQFpH5o4uZiu2ACF+mAQya1l7h8dTVJmFbG1RbtxtUF8uSfdmmIqFRPSDAM qb6YpLqm/kvi7PyKwjTEWofgkhNotcjTCfecFkBF+tMTkcQtOYD/JpwXymbu9p8VyNkL 3G1Q== X-Forwarded-Encrypted: i=1; AJvYcCX2YP3vlv6E4zZLvge22af84HYUgPghLlhm35NsANYWMQ7hZR/oIadk/X/6gG6QhFrvU9VMdsj9KOQGpjM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxi4Y78vv3vjkzsjkDWSeefw0eq3v6GYmQrVzMFBM/+zbGjd25J qEpdHv/jIaFhb3DX7i3T7wFpgjm8mTCWrd1eFYchE4N9BLM7D0hQGydzvJWcjTM= X-Gm-Gg: ASbGncvoBV9IfKhjBD39doJ7xVdT7Fmy7Btio24/Dc9HO5B2DWJXaGRO6Gmjm3d8GbS XMx5HxWq2JgQvuKQACuP7IBBeNeRKoaiB9U5vUX1BeI3Taoc0FupLocSfuY3pZ9uKmiS62VIykt s++kH74QkQpPBa3dg8dynaK4g9gfF0CrcxctF4OsFPuUr5CKGE1EvvoP2zrphB58QCGwW87YcjG GN6DEWfbX9WJkeXcaaJn7OtDY8lPYJ1F7hbXo4TKoCAQQEGd+KHOuzbliQN5ddMzEqapRrmKzHX oF8fQPMPSzDW8Y4oEHKZ X-Google-Smtp-Source: AGHT+IFU8PrWDhmlR2RUaT4va/OltWFBDSc2Qwfem7VSPUU1EII1LshhjGhI4Z+xmhDWHCjoruyIEw== X-Received: by 2002:a17:903:2286:b0:21b:b3c9:3908 with SMTP id d9443c01a7336-21c35577cb7mr388491215ad.34.1737602264864; Wed, 22 Jan 2025 19:17:44 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d4027fcsm102659955ad.214.2025.01.22.19.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 19:17:43 -0800 (PST) From: Charlie Jenkins Date: Wed, 22 Jan 2025 19:17:26 -0800 Subject: [PATCH] kbuild: Use --strip-unneeded with INSTALL_MOD_STRIP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250122-strip_unneeded-v1-1-ac29a726cb41@rivosinc.com> X-B4-Tracking: v=1; b=H4sIAMW0kWcC/x3MQQqAIBBA0avIrBPGiYq6SkRYTjUbC60IwrsnL d/i/xciB+EInXoh8C1Rdp9hCgXzZv3KWlw2EFKFhkjHM8gxXt4zO3Z6tlNDbWkQqxpydARe5Pm H/ZDSBx/D79dgAAAA X-Change-ID: 20250122-strip_unneeded-cab729310056 To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Charlie Jenkins X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1326; i=charlie@rivosinc.com; h=from:subject:message-id; bh=LoZ24LDHCMkiRgQF7grVTqyM789vNtixibi4AfHB3ig=; b=owGbwMvMwCXWx5hUnlvL8Y3xtFoSQ/rELRd6OlwDL75cs6XcO+HgyYYdr2Pmn9B71Lp0teTXZ d45n33fd5SyMIhxMciKKbLwXGtgbr2jX3ZUtGwCzBxWJpAhDFycAjCRwIWMDPdz5m4O8Wv5VDVl Z0nHitsH2X4wZx6c8YpB3++ar4rqtA8Mf3g5l024NiGA6dLd5e7Mi0/o/7f82RsYOb3jgvFBxvg 0YR4A X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 On riscv, kernel modules end up with a significant number of local symbols. This becomes apparent when compiling modules with debug symbols enabled. Using amdgpu.ko as an example of a large module, on riscv the size is 754MB (no stripping), 53MB (--strip-debug), and 21MB (--strip-unneeded). ON x86, amdgpu.ko is 482MB (no stripping), 21MB (--strip-debug), and 20MB (--strip-unneeded). Use --strip-unneeded instead of --strip-debug to strip modules so decrease the size of the resulting modules. This is particularly relevant for riscv, but also marginally aids other architectures. Signed-off-by: Charlie Jenkins Reviewed-by: Nathan Chancellor --- scripts/Makefile.modinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index f97c9926ed31b2b14601ff7773a2ea48b225628b..c22f35f6b9db3cac3923b9e787b= 219f752570642 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -80,7 +80,7 @@ quiet_cmd_install =3D INSTALL $@ ifdef INSTALL_MOD_STRIP =20 ifeq ($(INSTALL_MOD_STRIP),1) -strip-option :=3D --strip-debug +strip-option :=3D --strip-unneeded else strip-option :=3D $(INSTALL_MOD_STRIP) endif --- base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04 change-id: 20250122-strip_unneeded-cab729310056 --=20 - Charlie