Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp653678iog; Thu, 30 Jun 2022 07:45:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u/HiG4STXwyE+11XKfUnRKdB0Zzc5jZOTwHRtfdUsdYQaKNxea2pTtaHXyRstqQ0k16Ax7 X-Received: by 2002:aa7:91d3:0:b0:525:1f61:dacf with SMTP id z19-20020aa791d3000000b005251f61dacfmr16114322pfa.40.1656600309986; Thu, 30 Jun 2022 07:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656600309; cv=none; d=google.com; s=arc-20160816; b=Y2auiUrd7ZUFFtwn6GSrb2yQJRJVVl/vUfqrhbvcdy6gNEX8apKwe/zZGAo0e8VC3G tti9q0M1IVUXTmxqKpWKC1YmtXKHrsD7ctEoD1Liv0Lm7txtmQF9M/qBE3mgQsGhXnl1 2x8zTwxQ48a60XfrYzbKKcmg7ZWg8PEhK4yaxlgmNXZXn8Ia9Tf9CjGvF+WLqtj8M3YS eTqA3ed3HYnklL4Oeyi++1dUJWPLOT9Dsec5MsxhJLvpN7WzztbJxF57ktl6fsKW1Du7 1MYBX8QhH6LtVDd4KnAjHroKnqvUl1iH5qM8KKZSrQxXTJEShzkqzZvF2t5UxVsAyMm+ gIrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BC5maL5cQmzfgPl1lPWodeNmXz9ey+LUCNw2wCwEC2U=; b=i6ivCSZoRo+LC+1ojEg7kY9VgskACbICte6hldzp954/eVFatRF1pg/bB/aIHbkPgr ygPFInHsZ7HjBr31VtqBbcO92XOVoISUBIyk4i/9Sqau8MNM43SZ6yEq1960RZ5UhjwC 0BjUAGj/AVXYPhNbaqDpPP1B4OvyYovwDNuXW/cbgdEKP0Km4jFqR0+qBr/zSP2Bt0hd obznd0m/v96WqbxxJaY6Ix1uEl1rFBdWbJUxuD7j4dgYwaLHnzAEP58j6cffQhSGLb2O sK1cKfOb2CNzBEWU3HmFAIDcUnF9RWCrt11ryNcvR6lMtaHfKd0PVXaag4i1zuFUjNKE wPYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k2CmtP1c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa18-20020a17090b1bd200b001ecb608ea41si3339022pjb.167.2022.06.30.07.44.58; Thu, 30 Jun 2022 07:45:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k2CmtP1c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236356AbiF3OBx (ORCPT + 99 others); Thu, 30 Jun 2022 10:01:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236797AbiF3N7g (ORCPT ); Thu, 30 Jun 2022 09:59:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F032427C3; Thu, 30 Jun 2022 06:52:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C18E3B82AED; Thu, 30 Jun 2022 13:52:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 385FFC34115; Thu, 30 Jun 2022 13:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597141; bh=xfVKWAN7dZP6tDpOaNa0Xen3miKWJorW1sLauxWrqCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2CmtP1cGsdW+El2uhgPYC+JhhIc1UHZBCdxUMfUAB5a+S9wifkXQYB9pVyj1UnEG EzjMH5w6AIaTPaxsSzTJgbSDli9obZ+XG3Qsn64Jr5pic0jFL9saJIrNPbgmjzA9IU n0zGNgHEwrHsQdopHGq6VKp093LaI3p1TNAyHpXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Sami Tolvanen , Nick Desaulniers Subject: [PATCH 4.19 41/49] kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt) Date: Thu, 30 Jun 2022 15:46:54 +0200 Message-Id: <20220630133235.087412571@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133233.910803744@linuxfoundation.org> References: <20220630133233.910803744@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada commit 53632ba87d9f302a8d97a11ec2f4f4eec7bb75ea upstream. If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice. Commit 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") explains why this happens, but it did not fix the issue at all. Now I realized I had applied a wrong patch. In v1 patch [1], the autoksyms_recursive target correctly recurses to "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive". In v2 patch [2], I accidentally dropped the diff line, and it recurses to "$(MAKE) -f $(srctree)/Makefile vmlinux". Restore the code I intended in v1. [1]: https://lore.kernel.org/linux-kbuild/1521045861-22418-8-git-send-email-yamada.masahiro@socionext.com/ [2]: https://lore.kernel.org/linux-kbuild/1521166725-24157-8-git-send-email-yamada.masahiro@socionext.com/ Fixes: 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") Signed-off-by: Masahiro Yamada Tested-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -1017,7 +1017,7 @@ PHONY += autoksyms_recursive autoksyms_recursive: $(vmlinux-deps) ifdef CONFIG_TRIM_UNUSED_KSYMS $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ - "$(MAKE) -f $(srctree)/Makefile vmlinux" + "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive" endif # For the kernel to actually contain only the needed exported symbols,