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=-14.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 06D47C43460 for ; Thu, 15 Apr 2021 06:53:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB1EC61153 for ; Thu, 15 Apr 2021 06:53:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbhDOGxZ (ORCPT ); Thu, 15 Apr 2021 02:53:25 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:64536 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhDOGxW (ORCPT ); Thu, 15 Apr 2021 02:53:22 -0400 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 13F6qfpq015976; Thu, 15 Apr 2021 15:52:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 13F6qfpq015976 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1618469561; bh=ASLMD/Isn3hyU3AH6rc2TBLrCxFcTFf8y3b9byejf+k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QwDQByczDp2Ixc5lmb0fTUY0fURBptlbXVYbFrJk7tr0V2WT1I+xMW1fy/nuaSm3A eVZ1lykXl438BMO7IHX+FvjX+ANuPxqUd6f0YdG7iN3yb7r+vYML21Zem9K3kFWqih AnCzn/WgRJRIdEwi3hZbOZoTh4uOe6mNGwQ4G+sUkgdXyznrOwrD6pBKLIOJbQZRJS TsnKY4xVw1G98JyH+5om3gtB4Q5tlWLHQLkJiJKbZ4Dfq1ElZvrduxL9F5EZ6dKgth oyY72QksPOPWSQPwF1qsBqKddCpkr0IGzu6ipz7tjm99JFEOTsGhQjQf2iRfKfz4Zl a6Um2KxZ/t1XQ== X-Nifty-SrcIP: [209.85.216.43] Received: by mail-pj1-f43.google.com with SMTP id z22-20020a17090a0156b029014d4056663fso12163663pje.0; Wed, 14 Apr 2021 23:52:41 -0700 (PDT) X-Gm-Message-State: AOAM532CNR4sIMkZS3Lo4Wh3ZU5z2nfooz0cEsz9T5IIPbRZC9XkzuXr 2poS7tREx1MiGmKGb9M8X1XzN4sR1/ChYA9vFmA= X-Google-Smtp-Source: ABdhPJyMNCwpzerAzacYrJrcWqFcuKBK68TQWYjfjdGIIUUg6XX5GJzX3WcOY63EAoqh8uq6kpikN+HHEWtCfQmbYCE= X-Received: by 2002:a17:90a:1056:: with SMTP id y22mr2109954pjd.153.1618469560457; Wed, 14 Apr 2021 23:52:40 -0700 (PDT) MIME-Version: 1.0 References: <20210414192657.17764-1-rdunlap@infradead.org> In-Reply-To: <20210414192657.17764-1-rdunlap@infradead.org> From: Masahiro Yamada Date: Thu, 15 Apr 2021 15:52:03 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] uml: fix W=1 missing-include-dirs warnings To: Randy Dunlap Cc: Linux Kernel Mailing List , Michal Marek , Linux Kbuild mailing list , Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 4:27 AM Randy Dunlap wrote: > > Currently when using "W=1" with UML builds, there are over 700 warnings > like so: > > CC arch/um/drivers/stderr_console.o > cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs] > > but arch/um/ does not have include/uapi/ at all, so don't > include arch/um/include/uapi/ in USERINCLUDE for UML. > > Signed-off-by: Randy Dunlap > Cc: Masahiro Yamada > Cc: Michal Marek > Cc: linux-kbuild@vger.kernel.org > Cc: Jeff Dike > Cc: Richard Weinberger > Cc: Anton Ivanov > Cc: linux-um@lists.infradead.org > --- > Makefile | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > Option 2: change the setting of USERINCLUDE. This could alter > (a) build times and > (b) which header files get used: if there are multiple > header files named foobar.h in the $(USERINCLUDE) > subdirectories, this Option changes the order in which > they would be found. > > - linux-next-20210413.orig/Makefile > + linux-next-20210413/Makefile > @@ -501,13 +501,16 @@ LDFLAGS_vmlinux = > > # Use USERINCLUDE when you must reference the UAPI directories only. > USERINCLUDE := \ > - -I$(srctree)/arch/$(SRCARCH)/include/uapi \ > -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ > -I$(srctree)/include/uapi \ > -I$(objtree)/include/generated/uapi \ > -include $(srctree)/include/linux/compiler-version.h \ > -include $(srctree)/include/linux/kconfig.h > > +ifneq ($(ARCH),um) > +USERINCLUDE += -I$(srctree)/arch/$(SRCARCH)/include/uapi > +endif > + > # Use LINUXINCLUDE when you must reference the include/ directory. > # Needed to be compatible with the O= option > LINUXINCLUDE := \ > > Option 3: modify scripts/Makefile.extrawarn not to set > -Wmissing-include-dirs for arch=um. I think that this is not > a good idea: it could cause valid problem reports not to be > reported. > > Option 4: simply mkdir arch/um/include/uapi > That's what I did first, just as a test, and it works. I like Option 4. But, you cannot do "mkdir -p arch/um/include/uapi" at build-time because the build system should not touch the source tree(, which might be read-only) for O= building. How about adding arch/um/include/uapi/asm/Kbuild, which is just having a SPDX one-liner? > > --- linux-next-20210413.orig/Makefile > +++ linux-next-20210413/Makefile > @@ -500,6 +500,15 @@ AFLAGS_KERNEL = > LDFLAGS_vmlinux = > > # Use USERINCLUDE when you must reference the UAPI directories only. > +# Note: arch/um/ does not have an include/uapi/ subdir. > +ifeq ($(ARCH),um) > +USERINCLUDE := \ > + -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ > + -I$(srctree)/include/uapi \ > + -I$(objtree)/include/generated/uapi \ > + -include $(srctree)/include/linux/compiler-version.h \ > + -include $(srctree)/include/linux/kconfig.h > +else > USERINCLUDE := \ > -I$(srctree)/arch/$(SRCARCH)/include/uapi \ > -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ > @@ -507,6 +516,7 @@ USERINCLUDE := \ > -I$(objtree)/include/generated/uapi \ > -include $(srctree)/include/linux/compiler-version.h \ > -include $(srctree)/include/linux/kconfig.h > +endif > > # Use LINUXINCLUDE when you must reference the include/ directory. > # Needed to be compatible with the O= option -- Best Regards Masahiro Yamada From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-06.nifty.com ([210.131.2.91]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWvsL-008K5u-MJ for linux-um@lists.infradead.org; Thu, 15 Apr 2021 06:53:19 +0000 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 13F6qf7B006383 for ; Thu, 15 Apr 2021 15:52:41 +0900 Received: by mail-pj1-f42.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so12155826pjv.1 for ; Wed, 14 Apr 2021 23:52:41 -0700 (PDT) MIME-Version: 1.0 References: <20210414192657.17764-1-rdunlap@infradead.org> In-Reply-To: <20210414192657.17764-1-rdunlap@infradead.org> From: Masahiro Yamada Date: Thu, 15 Apr 2021 15:52:03 +0900 Message-ID: Subject: Re: [PATCH] uml: fix W=1 missing-include-dirs warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Randy Dunlap Cc: Linux Kernel Mailing List , Michal Marek , Linux Kbuild mailing list , Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org On Thu, Apr 15, 2021 at 4:27 AM Randy Dunlap wrote: > > Currently when using "W=1" with UML builds, there are over 700 warnings > like so: > > CC arch/um/drivers/stderr_console.o > cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs] > > but arch/um/ does not have include/uapi/ at all, so don't > include arch/um/include/uapi/ in USERINCLUDE for UML. > > Signed-off-by: Randy Dunlap > Cc: Masahiro Yamada > Cc: Michal Marek > Cc: linux-kbuild@vger.kernel.org > Cc: Jeff Dike > Cc: Richard Weinberger > Cc: Anton Ivanov > Cc: linux-um@lists.infradead.org > --- > Makefile | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > Option 2: change the setting of USERINCLUDE. This could alter > (a) build times and > (b) which header files get used: if there are multiple > header files named foobar.h in the $(USERINCLUDE) > subdirectories, this Option changes the order in which > they would be found. > > - linux-next-20210413.orig/Makefile > + linux-next-20210413/Makefile > @@ -501,13 +501,16 @@ LDFLAGS_vmlinux = > > # Use USERINCLUDE when you must reference the UAPI directories only. > USERINCLUDE := \ > - -I$(srctree)/arch/$(SRCARCH)/include/uapi \ > -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ > -I$(srctree)/include/uapi \ > -I$(objtree)/include/generated/uapi \ > -include $(srctree)/include/linux/compiler-version.h \ > -include $(srctree)/include/linux/kconfig.h > > +ifneq ($(ARCH),um) > +USERINCLUDE += -I$(srctree)/arch/$(SRCARCH)/include/uapi > +endif > + > # Use LINUXINCLUDE when you must reference the include/ directory. > # Needed to be compatible with the O= option > LINUXINCLUDE := \ > > Option 3: modify scripts/Makefile.extrawarn not to set > -Wmissing-include-dirs for arch=um. I think that this is not > a good idea: it could cause valid problem reports not to be > reported. > > Option 4: simply mkdir arch/um/include/uapi > That's what I did first, just as a test, and it works. I like Option 4. But, you cannot do "mkdir -p arch/um/include/uapi" at build-time because the build system should not touch the source tree(, which might be read-only) for O= building. How about adding arch/um/include/uapi/asm/Kbuild, which is just having a SPDX one-liner? > > --- linux-next-20210413.orig/Makefile > +++ linux-next-20210413/Makefile > @@ -500,6 +500,15 @@ AFLAGS_KERNEL = > LDFLAGS_vmlinux = > > # Use USERINCLUDE when you must reference the UAPI directories only. > +# Note: arch/um/ does not have an include/uapi/ subdir. > +ifeq ($(ARCH),um) > +USERINCLUDE := \ > + -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ > + -I$(srctree)/include/uapi \ > + -I$(objtree)/include/generated/uapi \ > + -include $(srctree)/include/linux/compiler-version.h \ > + -include $(srctree)/include/linux/kconfig.h > +else > USERINCLUDE := \ > -I$(srctree)/arch/$(SRCARCH)/include/uapi \ > -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ > @@ -507,6 +516,7 @@ USERINCLUDE := \ > -I$(objtree)/include/generated/uapi \ > -include $(srctree)/include/linux/compiler-version.h \ > -include $(srctree)/include/linux/kconfig.h > +endif > > # Use LINUXINCLUDE when you must reference the include/ directory. > # Needed to be compatible with the O= option -- Best Regards Masahiro Yamada _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um