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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable 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 B0CFAC433DB for ; Wed, 3 Feb 2021 10:38:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7773864E0A for ; Wed, 3 Feb 2021 10:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234003AbhBCKhv convert rfc822-to-8bit (ORCPT ); Wed, 3 Feb 2021 05:37:51 -0500 Received: from wildebeest.demon.nl ([212.238.236.112]:37974 "EHLO gnu.wildebeest.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233731AbhBCKhp (ORCPT ); Wed, 3 Feb 2021 05:37:45 -0500 X-Greylist: delayed 355 seconds by postgrey-1.27 at vger.kernel.org; Wed, 03 Feb 2021 05:37:45 EST Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 28BF9304481E; Wed, 3 Feb 2021 11:31:08 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 16C714000C6A; Wed, 3 Feb 2021 11:31:08 +0100 (CET) Message-ID: <544278979063fbee59f7e8d82c88ba3293380d57.camel@klomp.org> Subject: Re: [PATCH] kbuild: fix duplicated flags in DEBUG_CFLAGS From: Mark Wielaard To: Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: Sedat Dilek , Nick Desaulniers , Andi Kleen , Ian Rogers , Michal Marek , Nathan Chancellor , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Date: Wed, 03 Feb 2021 11:31:07 +0100 In-Reply-To: <20210203075239.5505-1-masahiroy@kernel.org> References: <20210203075239.5505-1-masahiroy@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, On Wed, 2021-02-03 at 16:52 +0900, Masahiro Yamada wrote: > With commit 121c5d08d53c ("kbuild: Only add -fno-var-tracking- > assignments > for old GCC versions") applied, DEBUG_CFLAGS is now reset only when > CONFIG_CC_IS_GCC=y. > > Fix it to reset DEBUG_CFLAGS also when using Clang. > > [...] > +DEBUG_CFLAGS := > + > # Workaround for GCC versions < 5.0 > # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801 > ifdef CONFIG_CC_IS_GCC > -DEBUG_CFLAGS := $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments)) > +DEBUG_CFLAGS += $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments)) > endif Yes, this makes sense given that the original code, before commit 121c5d08d53c did always set DEBUG_CFLAGS without checking for CONFIG_CC_IS_GCC. So it behaved like the above code does. Reviewed-by: Mark Wielaard Thanks, Mark