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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 93677C5B579 for ; Fri, 28 Jun 2019 18:01:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A7E7208C4 for ; Fri, 28 Jun 2019 18:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbfF1SBF (ORCPT ); Fri, 28 Jun 2019 14:01:05 -0400 Received: from asavdk4.altibox.net ([109.247.116.15]:45884 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbfF1SBF (ORCPT ); Fri, 28 Jun 2019 14:01:05 -0400 Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id 8DED880348; Fri, 28 Jun 2019 20:00:58 +0200 (CEST) Date: Fri, 28 Jun 2019 20:00:57 +0200 From: Sam Ravnborg To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Jani Nikula , Tony Luck , John Fastabend , Jakub Kicinski , Daniel Borkmann , xdp-newbies@vger.kernel.org, Anton Vorontsov , Matthias Brugger , Song Liu , Yonghong Song , Michal Marek , Jesper Dangaard Brouer , Martin KaFai Lau , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Colin Cross , "David S. Miller" , Kees Cook , Alexei Starovoitov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v3 4/4] kbuild: compile-test kernel headers to ensure they are self-contained Message-ID: <20190628180057.GA22758@ravnborg.org> References: <20190627163903.28398-1-yamada.masahiro@socionext.com> <20190627163903.28398-5-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190627163903.28398-5-yamada.masahiro@socionext.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=VcLZwmh9 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=yXOKcWPwKYVsdpAgASMA:9 a=CjuIK1q_8ugA:10 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Masahiro. On Fri, Jun 28, 2019 at 01:39:02AM +0900, Masahiro Yamada wrote: > The headers in include/ are globally used in the kernel source tree > to provide common APIs. They are included from external modules, too. > > It will be useful to make as many headers self-contained as possible > so that we do not have to rely on a specific include order. > > There are more than 4000 headers in include/. In my rough analysis, > 70% of them are already self-contained. With efforts, most of them > can be self-contained. > > For now, we must exclude more than 1000 headers just because they > cannot be compiled as standalone units. I added them to header-test-. > The black list was mostly generated by a script, so should be checked > later. The list is smaller than I had expected. And I see why you insisted on avoiding a maze ok Kbuild files. It looks good, except there is a few issues.. The file kernel/kheaders_data.tar.xz includes all the .s files. Something needs to be done to exclude the .s files... When building a full kernel the build fails like this: LD vmlinux.o aarch64-linux-gnu-ld: cannot find include/lib.a: No such file or directory make[1]: *** [/home/sam/kernel/linux-kbuild.git/Makefile:1054: vmlinux] Error 1 make[1]: Leaving directory '/home/sam/kernel/linux-kbuild.git/.build/arm64-allyesconfig' make: *** [Makefile:179: sub-make] Error 2 include/uapi/linux/mman.h fails when building sparc64 allmodconfig. There is likely more header files that will fail when we start to throw this after diverse randconfigs. I have no good idea how to catch this. Unless your scripts could automate this across several architectures. I did not continue my testing futher. > +header-test- += uapi/drm/vmwgfx_drm.h > +header-test- += uapi/linux/a.out.h > +header-test- += uapi/linux/coda.h ... > +header-test- += uapi/xen/evtchn.h > +header-test- += uapi/xen/gntdev.h > +header-test- += uapi/xen/privcmd.h I though uapi files were covered by another Makefile? If they are added because we pull them in using a pattern, maybe they should be removed using a specific filer-out? Sam