Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3124125pxb; Mon, 6 Sep 2021 12:59:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpO0oKz6L8TEEV5UVTaygtIYl3+vNToJoG3IzMdFQZpmFPdwCPwBoAlNRsMo8OpDgRzLNb X-Received: by 2002:a92:c542:: with SMTP id a2mr9260915ilj.191.1630958358490; Mon, 06 Sep 2021 12:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630958358; cv=none; d=google.com; s=arc-20160816; b=l8FL/Hjj5VXyL7/fxT3SLaztLkSluWmBBQmcCXV5mxe0GwX1zZZr4S/cRm7xn6rG7F shkBNJlgKizs7Kj4+Ht4rdWkwCFCe0x5LCvnPyLskOTjiy1NrcAugxQfKR4juTyu7FXo mL0mkhQgP5b9+RLooxjdEEJvmKNZcpLJpRO/Z28CXlUQnmnIrj9YdPlVvJhMQrCM2EnK h9VR5OiXmJ3yJKZnU6vivwdpEbFJ4F7ivsJCJGNsADu3ujpibQSCJwSjK6jJfq24aQSB 1q7maWkbN9DizuGEsg9yuNYzm0qFP+0HS5xpy4nu8DmGe/WLilCGO46UEG0PrSVMjJhk qV8w== 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=ljt32P5qq2QYTemxygv2Pmixe56RvpxSssc8KSjNKdw=; b=LFE3OEA6LlWm0qlraibRogg++XDA2VG1N+6e8MCKnA0KiyM3lPEWLoqfUAV/6QteLC L//OG0hokHkPHBv0886H19UEFcuSaWl5LpktXEW6UNw3e6vyW678f4XE7ACMVjMhQmQI 7A3+kugGSrTXE0+vbGWaEJ03V2zhMxAnChqf62uk/Uszj6wffS4Sew3CCefrC++uA9bJ L+SYGV9a0/H8mUreBpt6FNM1UUZjPD4umPOurgXU1YkT5BtjPG168bW02CRYEu59qiOM DeWsuueZVZIWi8DuxYrhPVOqFxa5QgMZA9LrbMQtYn7nmY38zrBkumoZKv1t7QWXd7U0 jTMQ== 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 g1si7226411jab.42.2021.09.06.12.59.06; Mon, 06 Sep 2021 12:59:18 -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 S242811AbhIFTx3 (ORCPT + 99 others); Mon, 6 Sep 2021 15:53:29 -0400 Received: from gate.crashing.org ([63.228.1.57]:53507 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241578AbhIFTx2 (ORCPT ); Mon, 6 Sep 2021 15:53:28 -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 186JmAuS020071; Mon, 6 Sep 2021 14:48:10 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 186Jm8MM020070; Mon, 6 Sep 2021 14:48:08 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 6 Sep 2021 14:48:08 -0500 From: Segher Boessenkool To: Florian Weimer Cc: Linus Torvalds , Nathan Chancellor , Masahiro Yamada , Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , llvm@lists.linux.dev, linux-toolchains@vger.kernel.org Subject: Re: [GIT PULL v2] Kbuild updates for v5.15-rc1 Message-ID: <20210906194808.GY1583@gate.crashing.org> References: <20210904131911.GP1583@gate.crashing.org> <871r644bd2.fsf@oldenburg.str.redhat.com> <20210904191531.GS1583@gate.crashing.org> <20210906154642.GV1583@gate.crashing.org> <20210906172701.GX1583@gate.crashing.org> <87lf49wodu.fsf@oldenburg.str.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lf49wodu.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 06, 2021 at 08:27:25PM +0200, Florian Weimer wrote: > * Linus Torvalds: > > > We use the compiler intrinsics without the C library header files for > > everything else, so doing so for seems to actually be a > > clarification and improvement. > > This is an exaggeration. On several architectures, the kernel cannot > use the vector built-ins directly. Some of the implementing headers are > very special and intertwined with the compiler. is currently > not such a case, but it's just not technically not feasible to avoid > dependencies on all compiler headers. I think this considerably weakens > the case against because the compiler version is so obviously > harmless. Exactly Florian. Thank you for so clearly making the point. > What the kernel is doing here is imposing an unnecesary constraint on > compiler development. Basically, you are telling compiler writers that > implementing features with the help of header files is a bad idea > because it makes it more difficult to use them from the kernel. (See > the proposed exceptions for vector code.) Either it will constrain the compiler development, or perhaps more likely, building the kernel will break in ways that the kernel people will blame the compiler developers for. The compiler headers (standard or arch-specific, same reason here) are there because it decouples the user (that doesn't mean "userland", it means the kernel here) from the builtins. Decoupling has many advantages. The most obvious in general is you can use nicer names in a header file, names that can step on the user's toes (like "bool" vs. "_Bool", which is essentially all that does). But another huge advantage of decoupling is it allows the compiler more freedom in bugfixing (or any other maintenance / new development). It is low probability that there are bugs in the compiler's standard headers, and it's not likely the kernel's ad-hoc imitation of it has bugs, this is all so small after all (but have I mentioned the c46bbf5d2def commit?) So there is no big pressure for changing anything here. But OTOH it clearly is not a good idea to remove the existing uses of standard headers. No upsides, various downsides, and some of those can be very costly. Segher