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=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 4906DC433F5 for ; Mon, 6 Sep 2021 22:25:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22845610A6 for ; Mon, 6 Sep 2021 22:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbhIFW0N (ORCPT ); Mon, 6 Sep 2021 18:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238439AbhIFW0F (ORCPT ); Mon, 6 Sep 2021 18:26:05 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04732C06175F for ; Mon, 6 Sep 2021 15:25:00 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id f2so13426501ljn.1 for ; Mon, 06 Sep 2021 15:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=djkX2LEeT3p1G5IHevNmOqztMBJt0/G4rH/Ybx5oPXc=; b=D5wOQF1JFIwGSDN/Sb0iapcFbHL+lhF3tzSy9ZFGW3bv6GMHaFvDgFX4JLNGAakjXo dqIBpyrSiDU7hHebER8AWhG3rNllOoPtrVW0l0dbSzHNmizT1X+Wdyt8jpV4p65GcbHK ldnvLQtZ4dlaDVszjo7P3N48zYpV1BMBHKhjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=djkX2LEeT3p1G5IHevNmOqztMBJt0/G4rH/Ybx5oPXc=; b=YPIO+06F3JOtR6M5011jdMqbKKnArh5Lhy9EWXm9gdJFUcF90CZQksOV6wschRZ4L6 HOHCSgs8ZkRye3XtEbUfazId+YQniD6gi+eIzaxowg3SpqcsvhTe3dcwO0kqw5ABRovi gzPVdLXnV6eDNJnBPZy9CPZeXQLgv/IpEBXsF4ulx5aSm/pzmmn/u2Pv7KO4Q4yqwo0T gSaVBl+aIrKjP1SvGu68bdEaweUQWz0/1EENHX0nGO7H9247ub9PRk7ha7NmKBzMJCIX Rqr7OUj5j4OsuUYeZGQYeseAn5e/LGPEmV7+cpi3w/dPE5BUd6iYNrm4U6wc0YJa7C+h wRYg== X-Gm-Message-State: AOAM532MjjLNPGIwOnQsnW/K3F9BRP/4zgX8GYv0Wnr7pb0mjca89vvQ YtbdHjEEV5mTlR1VKh5ib4+dAh7tSIxDGdiN X-Google-Smtp-Source: ABdhPJx7OFQJIpqbKfau2yPNCZdSDfKpEednXNhq06am15RfwN9pz1tzcDeo9Wm8ty549hZTYGUwaA== X-Received: by 2002:a05:651c:33b:: with SMTP id b27mr12358508ljp.314.1630967098052; Mon, 06 Sep 2021 15:24:58 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id v16sm1229826ljc.138.2021.09.06.15.24.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Sep 2021 15:24:57 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id s10so15651981lfr.11 for ; Mon, 06 Sep 2021 15:24:57 -0700 (PDT) X-Received: by 2002:a05:6512:34c3:: with SMTP id w3mr10565547lfr.173.1630967096954; Mon, 06 Sep 2021 15:24:56 -0700 (PDT) MIME-Version: 1.0 References: <20210904191531.GS1583@gate.crashing.org> <20210906154642.GV1583@gate.crashing.org> <20210906172701.GX1583@gate.crashing.org> <87lf49wodu.fsf@oldenburg.str.redhat.com> <20210906194808.GY1583@gate.crashing.org> <20210906201432.GZ920497@tucnak> <20210906215218.GA920497@tucnak> In-Reply-To: <20210906215218.GA920497@tucnak> From: Linus Torvalds Date: Mon, 6 Sep 2021 15:24:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL v2] Kbuild updates for v5.15-rc1 To: Jakub Jelinek Cc: Segher Boessenkool , Florian Weimer , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Mon, Sep 6, 2021 at 2:52 PM Jakub Jelinek wrote: > > It is actually not that bad, stdlib.h is indeed included there because of 2 > intrinsics out of more than 5000 and when one doesn't need those, just > #define _MM_MALLOC_H_INCLUDED .. and on clang? In other words, your suggestion is unworkable, and actively works against the whole point of "use standard headers". It's a joke. And not in a good way. There, I think you have to undefine __STDC_HOSTED__. Maybe by using -ffreestanding? Except if you use -ffreestanding, you lose some very bvasic functionality (*), so we don't do that except for very special code (our 16-bit realmode code does it, for example, and some very low-level library implementations). Just face the facts. Those header files weren't designed for the kernel, and we've done all the special x86 FPU stuff using inline asms. Which is fine. But it all just proves your arguments about "you guys have to use our header files" to be just a pipe dream, and not true. The compiler header files may in some very limited situations be usable. But in the general case? No. And they should very much *not*at*all* be considered some kind of sacred "this is the only way to do things". Because that is clearly not true, and has *never* been true. The usable header files are the odd special case, not the general case. Really. Is it really so hard to just admit that the kernel shouldn't use those headers? When we have 30 years of experience in doing exactly that? Linus (*) iirc, with -ffreestanding gcc doesn't do all the basic memcpy() optimizations. But I forget the exact details.