Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp877060pxb; Fri, 3 Sep 2021 16:10:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPsMPAFZbzS274qwvk/Yzo4dIBYNTMSK9Tyzdqbt0EvK3GueCo3pauuf7EL2bRp/SSBrIY X-Received: by 2002:a17:907:2137:: with SMTP id qo23mr1308006ejb.508.1630710617614; Fri, 03 Sep 2021 16:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630710617; cv=none; d=google.com; s=arc-20160816; b=s5hUUP3oAby2vSkTuyYHwNDk5SCum9mThaHikTMXGVftSjYPyfdrpPfBNL/i1WM/C/ BKgRe/WcSx3FNhzN0R90Aer2RgrRBHeZdRRBE1bGxx/eoPNMC+nLCtBYXkMjyxOLFy9+ PmYAX/9i4YAfsp7IG74bVyyFQDRjpPDblATWty6gfir583xwEXQBkhbOSyJ8Od6qyTL8 kqzrm/TWHw42r4v1UkHXwdan+M3/o+rucfqt2fd7Kl3Z0nMv4yaUYrtjnWfwQc+xOTud iV+EAsuN38EyWv7zouDXFWPQRnBpopRZ9gnZx6I9n6K0TtT4cy6w8TuSxaYNF7l8/ZbZ GqWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=47jHCEYHAGhavgqw7Taui0hPE/9Rg8dj4ydZwA+ocGo=; b=F7i3+yBFGEGvE/rUJmm/YVQFkKQWaeSoTH2uu3mqeZ0cfRB04A2v6QkazS0LdtmVAU 7lGPrO0QZqHxokU8T0NpQeDCMJBQnBKjLkdSthn/Sc2Y8N9Md/hnz6LNBCJzsU6NQob8 kr6a7er7IHKC2XI6vhTCVZBTEPXCR9IZ+B+4M4PCp/+J4BhqdEupq8jGVxPAQBhc1v3X ZGVd9rmbssPW9IiN2HYwEbFn3TGBPA9ftbNa5t14a9LyhPhV52Fm+6xTXYICR9f4xk6L yI5+Nutc/BdMeuri4Emx820U7p+Du23hi/J4LGSY41lq02Ick0Qa6Lz7hetqIWWzyIVe d2tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VBpNgYVx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si851820edy.116.2021.09.03.16.09.52; Fri, 03 Sep 2021 16:10:17 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VBpNgYVx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236053AbhICXFx (ORCPT + 99 others); Fri, 3 Sep 2021 19:05:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:58950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbhICXFw (ORCPT ); Fri, 3 Sep 2021 19:05:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A00A6101A; Fri, 3 Sep 2021 23:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630710292; bh=kwXSNoztsapfek/7tY4BJ7A92I7Ax8v7jMAhfQGx4P8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=VBpNgYVxlYcqc92N5qpBQjPqicLgFFNDzKeL8/V8pFfLJKu8s83FKiWXT6LclHlco VCSESOcdDqVwXfx4n3b2T6HAcn9VvuCMtSJLcwKcdot8Q4H+3oiAzOq33XWNvwkWDe qMtKxj5PeCAifOrrzcELYmxY00v9D4vIMtPrImjxOD0IdmwZsx3MxUZdX24Pk3GFhU gy11fK9vf2a3Stq5mbbYaXsLb1ZYbxUGKCMl2/7inye+n729JPtX2ebNR5TJYS2P9V EJOdZD/0f850MQstl+wcK4qM0shthcyIXyhV6sEV6G9TuxhMi+YFWItjp1Gj/AFRDb JgUnCwIlj0y9A== Subject: Re: [GIT PULL v2] Kbuild updates for v5.15-rc1 To: Linus Torvalds , Masahiro Yamada Cc: Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , llvm@lists.linux.dev, linux-toolchains@vger.kernel.org References: From: Nathan Chancellor Message-ID: <3b461878-a4a0-2f84-e177-9daf8fe285e7@kernel.org> Date: Fri, 3 Sep 2021 16:04:50 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/3/2021 3:53 PM, Linus Torvalds wrote:> On Thu, Sep 2, 2021 at 4:31 PM Masahiro Yamada wrote: >> >> I fixed the warnings observed in the previous PR. > > Ok, let's try it again. > >> - Add to the kernel source instead of borrowing >> from the compiler. > > So I certainly agree with the reasoning, but this worries me a bit. > > stdarg is truly intimately an internal compiler file, in ways that > stddef (to pick another example) isn't. > > Yeah, yeah, offsetof() is "kind of compiler internal", and we end up > using __compiler_offsetof(), but in the absence of that we *can* just > do it by hand. So offsetof() really is one of those things where we > can just do our own version if some compiler is being difficult. > > But va_start and friends absolutely *must* match the exact compiler version. > > It does look like both gcc and clang have just standardized on using > __builtin_xyz for all the different stdarg things, and so I approve of > what that ended up looking like. > > But at the same time, it does make me go "ok, this is a big new > assumption that we've consciously avoided for a long time". > > Nick is already on the cc here for other reasons, but let's add the > clang-built list and Nathan explicitly. Because this basically > codifies that > > typedef __builtin_va_list va_list; > #define va_start(v, l) __builtin_va_start(v, l) > #define va_end(v) __builtin_va_end(v) > #define va_arg(v, T) __builtin_va_arg(v, T) > #define va_copy(d, s) __builtin_va_copy(d, s) > > being the way all the supported compilers work. > > Did people talk to any gcc maintainers too? We don't have the same > kind of "gcc kernel people" list or contacts. The above builtins have > been the case for a long long time for gcc, so I don't think it's > wrong or likely to change, but I think it would be a good thing to > just make compiler people aware of how we're now relying on that > explicitly. We set up the linux-toolchains mailing list after Plumbers 2020 to have a common place that kernel developers can bring issues and discussion to both clang and GCC folks. I am not sure who exactly from the GCC world is subscribed but I have added it now to see. > (Side note: Linux using the compiler goes so far back that > it very much predates all those nice builtins. I still have memories > of being a collection of nasty per-architecture messes back > in the bad old days. So I'm actually happy we can do this now, but > there most definitely was a time when we really really had to use the > compiler-provided stdarg.h). Cheers, Nathan