From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E82CC433E0 for ; Fri, 19 Jun 2020 14:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0452C2070A for ; Fri, 19 Jun 2020 14:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577590; bh=IjElmARq6eMzDOjlp6QPQm+41lcq/XlSv+UorJp2UCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hKUlnNavGlw7TuqtFLAQH+xXSDwE1g9KCHyNEZbh5FQa34ol7XH64fQhsjG+S0MDj Id9SnZhhnEk2YQ7ys7n8tEa3t71a8QHISKL2qytIglx9dalnwC5iDlTJH53COlRrTj BSU47atPkDHeQ46Te6+aeZvhvmSnpUTwIDjrFZWc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388076AbgFSOjr (ORCPT ); Fri, 19 Jun 2020 10:39:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:57370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387594AbgFSOjq (ORCPT ); Fri, 19 Jun 2020 10:39:46 -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 384502070A; Fri, 19 Jun 2020 14:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577585; bh=IjElmARq6eMzDOjlp6QPQm+41lcq/XlSv+UorJp2UCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Co60UGoFejsgh/VDl5tLuiR+0HdZlRriP7Tm01MzHcFW7hwUpUrX4WwOOhrtwAXr7 Upd3oLEHwWqk+0eMzYnP3Ta5hlm5WLllMpukXZ3ePyv7xHzBSMXzb0FmBzetOFYj48 CV2gmCqY3Krs8cagVqUcZZZ7pom/PBK4TVbsUxls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 4.4 096/101] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Date: Fri, 19 Jun 2020 16:33:25 +0200 Message-Id: <20200619141618.992572618@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141614.001544111@linuxfoundation.org> References: <20200619141614.001544111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -1156,6 +1152,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