Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1951232pxy; Mon, 2 Aug 2021 14:52:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpvhwdUODRIM/nuWRXRPg2fvBx/QGJ+RnlrX3/SgEPK+nkIWIfiEwbJ9EdaWnM6r4nBKaW X-Received: by 2002:a92:b308:: with SMTP id p8mr2923718ilh.296.1627941162802; Mon, 02 Aug 2021 14:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627941162; cv=none; d=google.com; s=arc-20160816; b=aCMWlFCsFWMQcbTVKFeaFM9DJc0DpUcULd1WxExTsk+FXRqfQusvQb55UajzcNQXhW /QZXyiX7QFJc8ISPHEHL+/2+KR8nYgt6W21U3tU/ufBVkr9H/yibMb2ceCgODgyQuBct xQGyRub9/6EvxIn6qHrBZyFcWbbsHkQwDczjaVRSC/U+nkezPMiINK1PZkHMqixgjcsu Lx9ViNbNcloHbH4HvoMxfIO/gNxz6S08fDoFp4+nKFgnNER7I1hUvkMw/YB/lFSVGirN POD6W4sZCZXlH6Bxej1RrZCT1701gSC66NQE4S2vbnHilRvTLNhFa6RhemgrPL/AO864 YK0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=XgdgznSeUG2xcCN0+5QVBxBzPOM8/xN43jhEPg8MV0w=; b=U9msIutHbyfVlRBbUgFwMsdoVSt9YxnYgGlxx+T8fopMcvt0R934dpSh3kzkFTZFVa P80/RbFX0z0uPtKRI/SLRxyiX44OUqOxOMtauY8C+9ljZr0CsUjL7i2o30baB66lR2ZY Qp9Yv7QAbZmPmFZYxHhw2Er4/EqXMZeGO7UtFUH92nOtko6k/v9u1Fbifycd6MvAqC28 ZbxGt6akc47/xA1Uh1E7Nm5ribWN1Mwoa1t4XM7huiJZeZ9B0XTbiNPC3dMIhg3V1AGQ RuOwiDDfYtQJtnOeipfEEq3h4S5WZ1b9t/AHgWrLcDvSFEXKxXF4ZJuXpa6GM2E4Z26a qDXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v66si6440505iof.105.2021.08.02.14.52.19; Mon, 02 Aug 2021 14:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231764AbhHBVtp (ORCPT + 99 others); Mon, 2 Aug 2021 17:49:45 -0400 Received: from gate.crashing.org ([63.228.1.57]:46054 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbhHBVtp (ORCPT ); Mon, 2 Aug 2021 17:49:45 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 172Lg8IZ011901; Mon, 2 Aug 2021 16:42:08 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 172Lg7U0011900; Mon, 2 Aug 2021 16:42:07 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 2 Aug 2021 16:42:07 -0500 From: Segher Boessenkool To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-arch@vger.kernel.org, Catalin Marinas , masahiroy@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Paul Mackerras , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 3/3] isystem: delete global -isystem compile option Message-ID: <20210802214207.GP1583@gate.crashing.org> References: <20210801201336.2224111-1-adobriyan@gmail.com> <20210801201336.2224111-3-adobriyan@gmail.com> <20210801213247.GM1583@gate.crashing.org> <20210802164747.GN1583@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 02, 2021 at 11:30:00PM +0300, Alexey Dobriyan wrote: > On Mon, Aug 02, 2021 at 11:47:47AM -0500, Segher Boessenkool wrote: > > The kernel *cannot* make up its own types for this. It has to use the > > types it is required to use (by C, by the ABIs, etc.) So why > > reimplement this? > > Yes, it can. gcc headers have stuff like this: > > #define __PTRDIFF_TYPE__ long int > #define __SIZE_TYPE__ long unsigned int > > If gcc can defined standard types, kernel can too. The kernel *has to* use those exact same types. So why on earth do you feel you should reimplement this? > > > noreturn, alignas newest C standard > > > are next. > > > > What is wrong with and ? > > These two are actually quite nice. > > Have you seen ? Loads of macrology crap. > Kernel can ship nicer one. It is a pretty tame file. And it works correctly for *all* targets, including all Linux targets. Why reimplement this? No, it takes virtually no resources to compile this. And you do not have to maintain it *at all*, the compiler will take care of it. It is standard. > > > They are userspace headers in the sense they are external to the project > > > just like userspace programs are external to the kernel. > > > > So you are going to rewrite all of the rest of GCC inside the kernel > > project as well? > > What an argument. "the rest of GCC" is already there except for stdarg.h. ??? That is there as well. But you want to remove it. "The rest of GCC" is everything in cc1 (the compiler binary), in libgcc (not that the kernel wants that either on most targets, although it is required), etc. A few GB of binary goodness. > > > Kernel chose to be self-contained. > > > > That is largely historical, imo. Nowadays this is less necessary. > > I kind of agree as in kernel should use int8_t and stuff because they > are standard. s8 is a much nicer name, heh. But it could #define s8 int8_t certainly. What I meant was the kernel wanted to avoid standard headers because those traditionally have been a bit problematic. But decades have gone by, and nowadays the kernel's own headers are at least as bad. > Also, -isystem removal disables and which is > desireable. Why? Do you think #include will ever make it past code review? Do you need to throw up extra barriers so people will have a harder time changing that policy, if ever they think that a good idea? > > > It will be used for intrinsics where necessary. > > > > Like, everywhere. > > No, where necessary. Patch demostrates there are only a few places which > want -isystem back. Yes, where necessary, that is what I said. So, potentially everywhere. An arch can decide to use some builtin in a generic header, for example. Your patch makes for more work in the future, that is the best it does. Segher