Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp4329966rwp; Sun, 16 Jul 2023 00:07:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlH+rQSotqXq2lJoHBv6Gx30A5csgBY8gwC4NdSyWsrRuHkTgifbVmY4KFSLAFOGVA/h9La8 X-Received: by 2002:a05:6a20:72a9:b0:114:7637:3451 with SMTP id o41-20020a056a2072a900b0011476373451mr9819761pzk.37.1689491250922; Sun, 16 Jul 2023 00:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689491250; cv=none; d=google.com; s=arc-20160816; b=XOE6KjGuScS7++xghjju3VZGA7ReQ30UiRwfREfdneV+NhwFzrqlBd87y+QzjgeQ0D SYydNAfsAILoXki93NK5Nh86Q062J54PxAEa5i0+rERXN9USvevymLzDbCj8jt11fU74 d75SrTv0C16lSqjJCIugJu5Cwxr7H+6MwzlAprfI7o1sCBF3EN0eQyT9nheAFr65m33O Pb1vyg9jGFOjPJLP6Mb0o2uAqop+S7RIADUFoeGUedl/5ehz1N6lTHfV0jZRRhu+r4sX g1Fouh9nTfBmQ73YGDF74RKx1kF5JOL451Q8cVwyiODT9gOQvmdp+jdRLz4fR3+qxPuY cUsg== 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=rKqhH/2eVfuZcrQafjBYKdlzMefLxCKfy7NFyQ7KzA0=; fh=tcl19X2u8PtEELiqC9wF/fi8DNcGozPCtYGeW6FgzSg=; b=0HkLS3SWeOT+Tj3P4dMspT/UE107/k2mVgP5tp6Hp5A6lkLZjWZOWiFNdKlz5cECpC EJhS5u9JP2D00mRIN2BUSjFSeWWXn0Npv2AqMqXT5An2KTdMpMHVmU08O/vtiPBgGcFv f1MpIR4BZJTaV/ji+W/ZWhw1BUbIBCWMxNEq+3Pia/KZK7uqD+nu9s4Dnj2Zo+DtKaZV f7OMBb0dtKzbJWN/mGsIPO4N1KWUE32z5FOHdAUTeG59iQ7T2sJDpMsEUhZ1X4SpPc+K rHjgkLVgeNEG8FHUwaihUTDcw6lPdmMKtjic6nPrNtFrfuPXYZ+xirb74k0q267Inaum 9SUQ== 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 h191-20020a636cc8000000b005575f8d00c1si9631608pgc.852.2023.07.16.00.07.06; Sun, 16 Jul 2023 00:07:30 -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 S229746AbjGPEua (ORCPT + 99 others); Sun, 16 Jul 2023 00:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjGPEu2 (ORCPT ); Sun, 16 Jul 2023 00:50:28 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A77E10F8; Sat, 15 Jul 2023 21:50:27 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 36G4oFVC028846; Sun, 16 Jul 2023 06:50:15 +0200 Date: Sun, 16 Jul 2023 06:50:15 +0200 From: Willy Tarreau To: Zhangjin Wu Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, thomas@t-8ch.de Subject: Re: [PATCH v4 00/18] tools/nolibc: shrink arch support Message-ID: <20230716045015.GA28761@1wt.eu> References: <20230715222658.GA27708@1wt.eu> <20230716011744.499597-1-falcon@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230716011744.499597-1-falcon@tinylab.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Sun, Jul 16, 2023 at 09:17:44AM +0800, Zhangjin Wu wrote: > > I finally found that it's due to the lack of -Isysroot/x86/include, so > > it used to get linux includes from those provided by glibc and these ones > > were missing statx since packaged for an older kernel. > > > > So, your local glibc may be older than 2.28 (The one we mentioned in the > commit message who supports statx)? mine 2.31 glibc is ok: Oh definitely! It's a 2.23, and on another machine I'm having a 2.27 on an ubuntu 18 but it was built against a more recent kernel so its linux/stat.h has the required entries, and on another one I'm having a 2.17 which was built against a 3.10 kernel. > For older Linux systems without a newer libc may really require the > installation of the linux sysroot (linux/uapi). Yes. My point was that it wasn't very hard to already spot breakage on existing code built on existing setups. > > I knew that sooner or later I'd have to reinstall this machine but I > > can't get out of my head that to date I have yet not been convinced by > > the absolute necessity of this modification which is progressively adding > > more burden :-/ Time will tell... > > > > This may also let us think about the removing of from our > nolibc headers? just like musl does ;-) > > $ grep "include ../../../include/nolibc/stdlib.h:#include > ../../../include/nolibc/sys.h:#include > ../../../include/nolibc/sys.h:#include > ../../../include/nolibc/sys.h:#include > ../../../include/nolibc/sys.h:#include > ../../../include/nolibc/sys.h:#include /* for O_* and AT_* */ > ../../../include/nolibc/sys.h:#include /* for statx() */ > ../../../include/nolibc/sys.h:#include > ../../../include/nolibc/types.h:#include > ../../../include/nolibc/types.h:#include /* for LINUX_REBOOT_* */ > ../../../include/nolibc/types.h:#include > ../../../include/nolibc/types.h:#include > > If simply put all of them to types.h, it may be too much, a new "sys/" > directory with almost the same Linux type files may be required, but as > an in-kernel libc, this duplication may be a "big" issue too, so, adding > minimal required macros and structs in types.h may be another choice. (...) > The required new macros and structs may be around 100-300 lines? but it may > help to avoid the installation of sysroot completely and also avoid the cross > including the linux-libc-dev package used by glibc? No, really, that's what we used to do previously. If you remember we recently removed lots of structs and defines from various files because they used to regularly conflict with linux/foo.h (that we can't prevent users from including), while not always being 100% up-to-date. It's particularly annoying when there are typedefs for example because it's difficult to detect them, and if you redefine them you end up with build errors. We should only keep that for absolute necessity. In fact, maybe we could have these few ones precisely for statx, right after including linux/stat.h (which is supposed to provide them): #ifndef STATX_BASIC_STATS /* pre-4.10 linux uapi headers present, missing statx that we need */ #define STATX_BASIC_STATS xxx struct statx { ... }; #endif I may give this a try to see if it's sufficient to fix the build on these machines. But it's not critical anyway. I might try once I'm bored of seeing build failures. Cheers, Willy