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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 056F1C32772 for ; Tue, 23 Aug 2022 08:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346468AbiHWImT (ORCPT ); Tue, 23 Aug 2022 04:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241908AbiHWIkN (ORCPT ); Tue, 23 Aug 2022 04:40:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB60C4D4DF; Tue, 23 Aug 2022 01:18:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E14E0B81C36; Tue, 23 Aug 2022 08:17:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39D33C433C1; Tue, 23 Aug 2022 08:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242673; bh=REnsOf1qaq3VcnLbeF/05iGYQcU3+3goKpVVWJlYh0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=effRwk9QBqZkC0BZSbW9yhQF6Ce6YL4kCJi2t3Zggzcfdg8BD8ZJrjlFui+vu7FXo 9cyk3KR9DkraJGj1QMEH0FOOB5TjJ0NKDzPmgRtl1M4uj4zVA+vE7wQkLUZZ5+4wp0 Otx7QwqwfW/kcyvqcd8V30zU/IxaBPua7RIkvsYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Nicolas Pitre Subject: [PATCH 4.9 086/101] kbuild: clear LDFLAGS in the top Makefile Date: Tue, 23 Aug 2022 10:03:59 +0200 Message-Id: <20220823080037.829968607@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080034.579196046@linuxfoundation.org> References: <20220823080034.579196046@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit ce99d0bf312daf0178e640da9e3c93b773a67e7d upstream. Currently LDFLAGS is not cleared, so same flags are accumulated in LDFLAGS when the top Makefile is recursively invoked. I found unneeded rebuild for ARCH=arm64 when CONFIG_TRIM_UNUSED_KSYMS is enabled. If include/generated/autoksyms.h is updated, the top Makefile is recursively invoked, then arch/arm64/Makefile adds one more '-maarch64linux'. Due to the command line change, modules are rebuilt needlessly. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre Signed-off-by: Greg Kroah-Hartman --- Makefile | 1 + 1 file changed, 1 insertion(+) --- a/Makefile +++ b/Makefile @@ -395,6 +395,7 @@ KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +LDFLAGS := GCC_PLUGINS_CFLAGS := CLANG_FLAGS :=