Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp539675ybt; Fri, 19 Jun 2020 07:48:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxB3KttwqVSqh0PXHEsy7jcPbpX9Z/ynyXRlT67KPhiSy9wPhwr/NRwFXyG83oSExIiRFk X-Received: by 2002:a17:906:799:: with SMTP id l25mr3960178ejc.234.1592578081021; Fri, 19 Jun 2020 07:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592578081; cv=none; d=google.com; s=arc-20160816; b=hv8wuDQjp1jaCzT36XQmJ4mnxaqVDBKfcV0KbwAC0ial3a91JsT0lnJQiTPWADVUsU RoZCXoWLQ2RRM0nxGci/slyyro9s1FdmcH5kqL/a1gBp8KCTNxxqYuXQDcWGq5Agb4IN 8Tej4/Ve58HPsHOf8Y+6VEnVe8HqMDePMqrK3kSR3ClODBLo7tEgWhc05iJieF7TgRRh ZGFGHHQcAveTxZTUO8ROqaZuSPZG5zpfOvv6kFFfpZ3iNGUfaIkQuF2yBCei+f3GOAMe fxbsCNkXdm3ATKgigit1eJApRfaGx/x5uBsUffTfKFk43GVZta5Dmw7hKVg2MwTX/J0K Onug== 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=IJLjFCCtma1sRjA+rmzbO0C1a20DxBhKGOrL+d7kLhE=; b=NLDnxlmacuilOnmGp0LP1pcb32nInkAP4ZNFc7gqHpF6L7HTZOPr6AnhoRTBWvBIB9 KsEIgfsG5T7yrje4qia6YdBO4MiWYkxVepV6ktoxTibY7MsF41f4BoAWxG3rTYJG6Cnq cGLp1M/9byPVYIF6uIXGJ0RYV1SMjBapiMVZJKD9Sqs3RwrdFqY5kL/hlixMXSzqvCOg 8fhcOCAA9BrJxD1rvSLJc4W9Xn/4gwK1I77bxgxKt1XrE0yDFe/6C0U0PbrmNCftrizI kpYCuvKuSAhkottwAGQ+0Luk7HlGGGYtlktlaNjsV56jZ7A7jSENAiEdzgty29GUL5J9 A/wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JgENVrfg; 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 r18si3631581edy.594.2020.06.19.07.47.38; Fri, 19 Jun 2020 07:48:01 -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=JgENVrfg; 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 S2388644AbgFSOpF (ORCPT + 99 others); Fri, 19 Jun 2020 10:45:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:36016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387470AbgFSOoo (ORCPT ); Fri, 19 Jun 2020 10:44:44 -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 3493A21556; Fri, 19 Jun 2020 14:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577883; bh=bsL2vyOy8pegqBawPjnA9McV2ew99oX3Akpc3n5eyjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JgENVrfgLKT3MmvYz7hU8S8rGEMqYK8L/1UQxOiRAUqE3FfgC2hd/0YPxyayeLeru t7lZTab88FB1IUgRa1jZDCX0qpopYc1Hmb0W/0LtPrmyyAn85VPvT2OWERTLaU3eao kUeKKVC8t0+Nj3YIIYZ8UFpB3+I1egzTY20ejiZA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 4.9 121/128] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Date: Fri, 19 Jun 2020 16:33:35 +0200 Message-Id: <20200619141626.506133658@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141620.148019466@linuxfoundation.org> References: <20200619141620.148019466@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 @@ -313,12 +313,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 @@ -1237,6 +1233,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