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,URIBL_BLOCKED, 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 3B281C433DF for ; Fri, 19 Jun 2020 15:15:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CBBF2080C for ; Fri, 19 Jun 2020 15:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579725; bh=AQ2qJA/CQlrwmS2DMffeqHx1aRMKJZZOKPK/n6ZrwEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ph3GGT14VxWfRmbiIP1ZtqWf/NA9vmiNqGjzbpK3gCa6NWVvpIhbSYzYUP5hVacdb 2c1WGWwqGtJVCyP7LoTaWZae3eIHlxaDW/v+xMRMTMFnYlzJT2r/jbzPSLmIYEG31l +AKNwzm+yaG1KuL0B1tFL3Ex6Qt01peIk7PVkTgw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392405AbgFSPPX (ORCPT ); Fri, 19 Jun 2020 11:15:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:45688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392374AbgFSPPJ (ORCPT ); Fri, 19 Jun 2020 11:15:09 -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 6194C20776; Fri, 19 Jun 2020 15:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579708; bh=AQ2qJA/CQlrwmS2DMffeqHx1aRMKJZZOKPK/n6ZrwEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o3beFNeOJjAp2cmOIv4I32lrmDPWzOXjicKaui80sbmNCLrFYS0JkUhABgb3IWDIu XosIUZ4NXDzBY0r/kiZSD2iwYN0gtWc3lkm4mlH+q1EKqNkS4x5Nm+nyVo7z9L9yfO n1/zz4MPpX9IOnv/MrOw9YPT/9MjOsQLHiigumxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 5.4 237/261] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Date: Fri, 19 Jun 2020 16:34:08 +0200 Message-Id: <20200619141701.234980613@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141649.878808811@linuxfoundation.org> References: <20200619141649.878808811@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 @@ -587,12 +587,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 @@ -1282,6 +1278,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