Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3139085rdb; Tue, 29 Aug 2023 06:36:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLxP+GPB16CFamTUGahX5SuMvsay544r53ps6TcbY5MANjPFhYzDt3FwG5A57v6R2InlPA X-Received: by 2002:a05:6a21:32a3:b0:14d:6309:fc96 with SMTP id yt35-20020a056a2132a300b0014d6309fc96mr5809533pzb.4.1693316198324; Tue, 29 Aug 2023 06:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693316198; cv=none; d=google.com; s=arc-20160816; b=QJaJhsudZPcM6GdGO6DN8q18dRbPrwvtiBDLlByefQ/ngTWE+xLXAOHV3aSZKu1s5Q rzlfW97cgqYl1YtodjW+sm3l8h81U3ciuzt5S3OeadpCBd+RZVfAvLTdocW7vKlj4xQg hAQ2G1H0LFGPVI8gYYhfo19gi50Uv5uhviUy6/mdZzUxnMl5ttfiKd1u2Y9oKaXoVdAQ ULli8kR3HRdzGcebUftv41kVkzgmzw03ONskZzZwEFxHnOoMgWOeeOQYL+KTZtrEPd6n uKJpIciMzWv6T63UMGoaBLTrOqMO+SAQm7cTB6PJOVyfdoFyutCcBZMBJUBKqQ8pPoFn aX4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7BmXSk6+aZa7asXpSFt5ofX3cLZsS61tVXvAEJXnpzg=; fh=q1RB602wbnpeA4xEGIahT6LYjwTOYHyG2x6uZL9R6HE=; b=Oq29wtX7J7ltONG9U6Uly/KYIkzC0mMWhXPaSqMf0Xm/mCR3QYv0WJ5QulPWvn4NFc uKV5Ku45W78B9hwLhfFeN6GRQP5kUI8mZifiwkoOHlFwJkqmjrG8ZdyGFOANUnFtHcl5 kMkrXIvtLRlne+qnubYBsfIE3fkPy9LhDM8y/5ABM0y4tgUEeWK9IhqfBK+buGoGkNoJ rTeA0kbtKm1M1jdT2ICoRX3LZQ3qHSnPtMWky76teOyciQRUdl0XaqbfNycUD16Mb8PF 8pX5HRxjoeOMANg35DqHxwJOVYntdMCogfivFR33IWA7yWElknzVq/DARQJTShJmhHzg kibw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a63b64e000000b0056956177395si4546505pgt.512.2023.08.29.06.36.10; Tue, 29 Aug 2023 06:36:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233492AbjH2J2u (ORCPT + 99 others); Tue, 29 Aug 2023 05:28:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234915AbjH2J2f (ORCPT ); Tue, 29 Aug 2023 05:28:35 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FE7CE56; Tue, 29 Aug 2023 02:28:10 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 37T9QJ8E013415; Tue, 29 Aug 2023 11:26:19 +0200 Date: Tue, 29 Aug 2023 11:26:19 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Shuah Khan , Zhangjin Wu , Yuan Tan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/2] tools/nolibc: add stdarg.h header Message-ID: References: <20230827-nolibc-nostdinc-v1-0-995d1811f1f3@weissschuh.net> <20230827-nolibc-nostdinc-v1-1-995d1811f1f3@weissschuh.net> <2b6c62f1-c1f1-4f2c-ba0c-981e066f4268@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2b6c62f1-c1f1-4f2c-ba0c-981e066f4268@t-8ch.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 29, 2023 at 11:14:09AM +0200, Thomas Wei?schuh wrote: > Hi Willy! > > On 2023-08-29 08:28:27+0200, Willy Tarreau wrote: > > On Sun, Aug 27, 2023 at 10:00:15AM +0200, Thomas Wei?schuh wrote: > > > This allows nolic to work with `-nostdinc` avoiding any reliance on > > > system headers. > > > > > > The implementation has been lifted from musl libc 1.2.4. > > > There is already an implementation of stdarg.h in include/linux/stdarg.h > > > but that is GPL licensed and therefore not suitable for nolibc. > > > > I'm a bit confused because for me, stdarg was normally provided by the > > compiler, but I could be mistaken. It's just that it reminds me not so > > old memories. Therefore maybe we just need to include or define > > "something" to use it. > > It is indeed provided by the compiler. OK. But then, doesn't it mean that if we don't provide our stdarg.h, the compilers' will be used ? I'm asking because we're already using va_list and va_args, for example in vfprintf() in stdio.h, which precisely includes so it must indeed come from the compiler. > I could not find anybody doing this differently. > Using builtins seems to me to be the normal way to expose compiler > implementation specifics. OK but it's already what the compiler does itself in its own stdarg that is provided. That's why I don't understand what specific case we're trying to cover here, I feel like we're providing an alternate stdarg in case the compiler doesn't provide one except that I've not seen a compiler not provide it (even tcc comes with it), it's like stddef. Thanks, Willy