lkml.org 
[lkml]   [2021]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] btrfs: Use immediate assignment when referencing cc-option
On Wed, Mar 17, 2021 at 09:08:48AM -0700, Victor Erminpour wrote:
> Calling cc-option will use KBUILD_CFLAGS, which when lazy setting
> subdir-ccflags-y produces the following build error:
>
> scripts/Makefile.lib:10: *** Recursive variable `KBUILD_CFLAGS' \
> references itself (eventually). Stop.
>
> Use single := assignment for subdir-ccflags-y. The cc-option calls
> are done right away and we don't end up with KBUILD_CFLAGS
> referencing itself.
>
> Signed-off-by: Victor Erminpour <victor.erminpour@oracle.com>
> ---
> fs/btrfs/Makefile | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
> index b634c42115ea..583ca2028e08 100644
> --- a/fs/btrfs/Makefile
> +++ b/fs/btrfs/Makefile
> @@ -1,16 +1,16 @@
> # SPDX-License-Identifier: GPL-2.0
>
> # Subset of W=1 warnings
> +subdir-ccflags-y := $(call cc-option, -Wunused-but-set-variable) \
> + $(call cc-option, -Wunused-const-variable) \
> + $(call cc-option, -Wpacked-not-aligned) \
> + $(call cc-option, -Wstringop-truncation)

That's still overwriting the value unconditionally, the idea was a
separate variable

https://lore.kernel.org/linux-btrfs/20210317104313.17028-1-dsterba@suse.com

\
 
 \ /
  Last update: 2021-03-17 18:08    [W:2.304 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site