Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp991504ybt; Fri, 19 Jun 2020 20:49:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWjOW4b8nCTwf2VH3NvXs2I9Od4jDE4V6phgMDlSfK11ClET+9PDF5TlEkaNimn+uc41Hn X-Received: by 2002:a17:906:f911:: with SMTP id lc17mr1105762ejb.330.1592624999474; Fri, 19 Jun 2020 20:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592624999; cv=none; d=google.com; s=arc-20160816; b=Yth+UwJ3qHfxIn1LQi4a2TI7s1564vndVm95LaD+OtEbgONwUQ5KpXXxMSA+caMkeA A847Vqdy2nMcQv9F69F/dfyFEevYnWmyECQzSuqhO64OzqzARhLtuOBZOUF6bJphg3MF Yl+qIN8imXKPAFLv0wgnUYNYhgVwoHyTfDD6JxG1GhUsshh4TUkw9kG0TJ4F5lGFXcZi BnluaYdGsJHaUvuQq+ZT977oXysdsMZv9a0zywDoxexRMNDrt/yRQ5hT6Ipp/Kyl3jYA X9l7+P3klbHZ8IXXgGU/srMCVT8ZQaPLaTnAPeef+k8GhKl5p9l4Ruok9r1LARi2hEqT Zb2Q== 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=I3C17FhyAvTcMDHKlFbTA/TGW1M9BCAfPpiNvErixUE=; b=JdqOgM7kgbtmHN3pYN3tgfJ82ttW8yKKitwjmwkbltOCGuJj0IjYhI7vH3lxtoUYzd 9jHV1Uz1SUhHxOAZysOh0SWkHvfzVi00NyS6UXnE9s0ZGSEe/0+E1vVNy7nm+k4EoJw4 Cq8nlnkD5wgJhVQ2VOyJhgZXxP6WVZEu8z6e8BnaGNsPaljQt5Ab1tLCgVe7kUmsA8Yo UTCLP6xM4e0pfQDtq7TpN9fjNuKnu7QryIbmLjHucDjhlOwOLcsBs8CkfNh/CNIE0Mz3 Leu76TPVlujrPuhS4hcakkEBBean1+JqEASGsFg9LsBbwPOWEzjQZppx8P+jpdF0F4ZJ dvbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a6hvhPqA; 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 a9si5025869edy.372.2020.06.19.20.49.38; Fri, 19 Jun 2020 20:49:59 -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=a6hvhPqA; 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 S2393156AbgFSQMd (ORCPT + 99 others); Fri, 19 Jun 2020 12:12:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390728AbgFSPE6 (ORCPT ); Fri, 19 Jun 2020 11:04:58 -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 7337721941; Fri, 19 Jun 2020 15:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579098; bh=G55nFWnpw32hiv2wW5Qw8jEXLGNHxJVBMoYUIUI9F18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6hvhPqA0NPLu11xjNwfH/XnquQSrK+W5D4OBPIUCeRbLOeciH/U1EAdi1Igkdi2l Ht2qNiYnPy3aScqn5LmqGyE02S04gfgwbjD2HPoDTctePAWy3YezczpB0PYCIbKQ/w ZLeEegCQ9xGPcl2Ecx+4pK+QsNclM5SNHXezoTR8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 4.19 258/267] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Date: Fri, 19 Jun 2020 16:34:03 +0200 Message-Id: <20200619141701.041984692@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@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 @@ -554,12 +554,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 @@ -1229,6 +1225,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