Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2907242iog; Mon, 27 Jun 2022 05:31:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uDplUJqN0BBgPnXkMO/IJWu3H3ezjvnMc3YjKUt7UnUxeB0jaPUxuyffWru5pmyOsJ/OBb X-Received: by 2002:a05:6402:3490:b0:435:9802:96ac with SMTP id v16-20020a056402349000b00435980296acmr16238975edc.40.1656333116030; Mon, 27 Jun 2022 05:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333116; cv=none; d=google.com; s=arc-20160816; b=GMQnv0MsktPNx7P/iqUoTFt9ZXP3nD7Ubold7Ri5t9YER6lo8A9GWquXwre5TZCmgF yISkSrZnL84ZbsfVivlZId+6rC5arlOOKKfTBPEJ7RqeFZyJkqHn33uMX+lNBKJbkmOz nBhlSaxHMMwLmcXRDuHKRQZRr0kXCxE791TcLOlNuEEt8HMUCtPAXsdPJX8zQ84dq43x Vf9R75TajmqMRyERXXqP688/pw+jkH1BBiaUNKul6MsDRMg9bbqFaK89ncUTzr74DEXa oRx6n36M0FcCJC1hrliMGMQ86sRobEPqLcah/3uts9N8qyR2mSlvIE/B2WNrPZNvOc8C Ei6g== 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=TXuzyOKHhM/rLdBOXC+MlMhxIK7ezb8VQlio1sUVycs=; b=jOXV8yYY60vHK9dqSHb92tK8CmykWzniK63EFJOQB/399EYErtNsr6cBrQ6fUwgoET gGr6Jb71RLpU4XaJmD7LrKdSNGP+mcloRYjnjmgcxXaP7h1hb8sT5OjlNlOKaVQzBsCQ bLwIPJfC7yPWtCMOHhUh9gXa2Z+xtHP/efKs+dQhmbtIwuY/2lRCaf0WCoGGaN6lp2cK brk92OXn8cBlbPacskEDslN6Mll4zHOKWAFIvIAXVLso6i9m67iANuAgdkvy9/TMvuJF 0BJfV/szVV9cEvS4x2Bvt2CxmIQmfZBWA/PG7FQIJdy+DQpkZ24Q8MrDfDeDW/LIIPAR VGxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ROVGLgvX; 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 z26-20020a50e69a000000b004357fc380d7si13083853edm.203.2022.06.27.05.31.31; Mon, 27 Jun 2022 05:31:56 -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=ROVGLgvX; 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 S234958AbiF0LfF (ORCPT + 99 others); Mon, 27 Jun 2022 07:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236207AbiF0Ld1 (ORCPT ); Mon, 27 Jun 2022 07:33:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B510ECE35; Mon, 27 Jun 2022 04:30:36 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2B43F614F0; Mon, 27 Jun 2022 11:30:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16C18C341D2; Mon, 27 Jun 2022 11:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329435; bh=zTmVWyeo9uBh0jWVQ7ODzF2cjoMO46JiMkOWCxwDuJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ROVGLgvXqBkipx1qNjGShsbrd1S2BThlQILZj/oAzq3UcmxxNoXv3lFEERiDjNaIp 23oawrg36eXEdA+yYElmZg/UhPBgqGwnzffP/xLWHZynyBUZyavOMEsnV2gjbGfytO 3tCgv2TY7FdXjnjzB/c5re89ACbUWaoZI39tRD8w= 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 5.4 59/60] kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt) Date: Mon, 27 Jun 2022 13:22:10 +0200 Message-Id: <20220627111929.426963379@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@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 @@ -1073,7 +1073,7 @@ PHONY += autoksyms_recursive ifdef CONFIG_TRIM_UNUSED_KSYMS autoksyms_recursive: descend modules.order $(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,