Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp907977ybt; Fri, 19 Jun 2020 17:45:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrC6jObO0FVGUBcs+o1Xfo1Fc+k6sdvNq16ywit6QVDm5YM0eDyVY680nRi8Q+tzoI6uXA X-Received: by 2002:a17:906:d933:: with SMTP id rn19mr6197799ejb.158.1592613947475; Fri, 19 Jun 2020 17:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592613947; cv=none; d=google.com; s=arc-20160816; b=g87yCh2+hx3AVCnZZ/1p2MxUdqcnaqhyhtjoRFUjbcgGPrAvlCEbUiPDgfTpqRUopL 6CyuiaBsE+k9dGLAczbwbwRm1Hd2cxez0j5owncIpcz4Fc8xaYxJVMme3+0qLy9hNkKY zlQUnfCBnGp+UdRUakfBEnd/x0zu35EtAoP89HFtDKZCNZkqPvQXTOm3I8JSXl8HXmjJ pocCZHXveQqoYVIqlFeb1jgzW3IyRMT/p/N9q47XpvhuGGtspOulyeKlqV5QEqV37UR3 LiSACZEtbljuR+9/HVbslpmmZvS6fAPfw2gApmPFr1og9MleZrG4LJK6x6pINB98ya2z sSkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=65efGsBXU7D+vkdw1nQx+0+fHacHAitr5qCBEx6Zvxk=; b=iPr9mi2xVleaaIqPgYC3wpdnNwe7tK27ODdrIsFcvSQV3T1RTBSci/G3w+6/7vQgc9 Y3mQ2/r14FCWmMKyCTooU6rfuKLrAK0iBPfuHD7eY4RlWHhXUlBY2o+sI67CYicXps/3 M2lk5+w1mYXBT61J/0bw8DThh2UUrp4AXv1xr0xoEh0Wnuz8VJNWa3dxsWP5KuqQzabQ eVpKXelUbQekC7jUyNCh28kd1dcBaAaVQY19lfBkHQhxmDPw7gbg2ZOSYn3RQK7BrkeA ITAcbFwdPlOUvzk8B5LN26lfLbJTyUSSu4JI/aK5hpQgkmM2fNR0nSEb03Tx2Sw7/MP4 aSUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZCerBpLu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si4809469edu.320.2020.06.19.17.45.09; Fri, 19 Jun 2020 17:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZCerBpLu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404974AbgFSPew (ORCPT + 99 others); Fri, 19 Jun 2020 11:34:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:36186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393881AbgFSPcM (ORCPT ); Fri, 19 Jun 2020 11:32:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D2EE20734; Fri, 19 Jun 2020 15:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580731; bh=oO1bjccYz64ROXGmEVK5NoXSBmGAiK54CSO+SgGWLYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZCerBpLuIc8I/LU7BIkIJA5acUPwjcgXVcYOWjhvOSA/U3ZC+UuLYv1fo0BOs2Dn/ bftY3XEGPlGe3S5Src5vDUPvYBJMRoTihB2nOmZfS2z3OpEo8xGLP9pphordK2epbT fJFnHQF1zLsdKKL0qRtHFjZdy0nLQQCGEW3gkZ7w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 5.7 344/376] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Date: Fri, 19 Jun 2020 16:34:22 +0200 Message-Id: <20200619141726.610751005@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada commit 4b50c8c4eaf06a825d1c005c0b1b4a8307087b83 upstream. This code does not work as stated in the comment. $(CONFIG_MODVERSIONS) is always empty because it is expanded before include/config/auto.conf is included. Hence, 'make modules' with CONFIG_MODVERSION=y cannot record the version CRCs. This has been broken since 2003, commit ("kbuild: Enable modules to be build using the "make dir/" syntax"). [1] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=15c6240cdc44bbeef3c4797ec860f9765ef4f1a7 Cc: linux-stable # v2.5.71+ Signed-off-by: Masahiro Yamada Signed-off-by: Greg Kroah-Hartman --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/Makefile +++ b/Makefile @@ -608,12 +608,8 @@ KBUILD_MODULES := KBUILD_BUILTIN := 1 # If we have only "make modules", don't compile built-in objects. -# When we're building modules with modversions, we need to consider -# the built-in objects during the descend as well, in order to -# make sure the checksums are up to date before we record them. - ifeq ($(MAKECMDGOALS),modules) - KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) + KBUILD_BUILTIN := endif # If we have "make modules", compile modules @@ -1315,6 +1311,13 @@ ifdef CONFIG_MODULES all: modules +# When we're building modules with modversions, we need to consider +# the built-in objects during the descend as well, in order to +# make sure the checksums are up to date before we record them. +ifdef CONFIG_MODVERSIONS + KBUILD_BUILTIN := 1 +endif + # Build modules # # A module can be listed more than once in obj-m resulting in