Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6437345rwr; Mon, 1 May 2023 23:51:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40Ix2UZUB25qpBYHKFUpLA8gwHkoMR1pACY5IvJVFHZsRIAvWBMuuugQtADnV/LKhkewjv X-Received: by 2002:a05:6a20:7d84:b0:f3:3169:7ece with SMTP id v4-20020a056a207d8400b000f331697ecemr21546856pzj.39.1683010275009; Mon, 01 May 2023 23:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683010274; cv=none; d=google.com; s=arc-20160816; b=GtQc2qKpUgnA2tVBJsgjG44dsOEcBzOc+kVe2MPMy7tq8wSgRHxf5CyJw6mpimb7ZN t2IfDhsFQOa40ByfOu7hQZKmMpo3MfcktlA1VyxbHb/V3ekENArYwUE5NlmFyWcphP96 uYy/oFNYi2IAOk2sqKnbGVrpFlZp5SpsHk3ufOH8lJ62GndxraedIhY9nQrPbTO7sYrJ 4/OTDwHCkRFp0UAsPwMpEGaOV+abgaDkqJgepgM8cbuaGewTJj/Cr9MlbIvE0uIQbPp2 2c/yfEOT0j7wpUbVCOPXcTfJQ4bUm1yqxui5Haxkd+FCHeP/k5nnHklfkMiaJBI7+7Ba mF6g== 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:dkim-signature:date; bh=b+6QOlp/8g43ARGR7+x71AJ1CKLyngwAgpD1Qsmt5QY=; b=RbO96YqXtUEZRUPoeJGvAwigXeONAlwGYESwl+TfWzEWBxO/7ZNjt6iNsjXChj3vdn oIteTMF9g7uv1Yu67u3nJ5nAqoCZZX9xCviEvDPLbptHMlacjcEfo2U9/bylylPp+o+c SXJLenhmLUVN/zyW9fhFag41X+PYW8+FkqkTbxImrd9ZUno8spYWGy06hYOER0NJNSzV jyTHhZCopMWrWNT1qKJQieIs+xnMW2BsVLlBZ44ETY0cIw+q8No0Ss4PpX49E6wREAE6 lT2Jkvw3q9JPciUMKccUIPzJvKd1JtuUt/p1Xdnvn6WKjgrx/IpGAPy2aRdg6zLHesTw kCyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=WyNxJX1R; 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 k23-20020a6568d7000000b00503a029385asi25923759pgt.849.2023.05.01.23.51.00; Mon, 01 May 2023 23:51:14 -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; dkim=pass header.i=@t-8ch.de header.s=mail header.b=WyNxJX1R; 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 S233607AbjEBGrY (ORCPT + 99 others); Tue, 2 May 2023 02:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233569AbjEBGrW (ORCPT ); Tue, 2 May 2023 02:47:22 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E90B19B0 for ; Mon, 1 May 2023 23:47:18 -0700 (PDT) Date: Tue, 2 May 2023 08:47:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1683010036; bh=QX2OOLcfGpNlKl3zjd9j0gHhX42jLgoW5/8PmXR8oJE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WyNxJX1Ry6ZDFUXmFpepZhEBvARAxDoPFJateKZF4N6qbwdS3cQDQzOPT7gGsRMCD 9xSvQan76KW1IWHJFhriHEy46Jh4PFHNjHS/j47y/rjvevkfreNClie2UY/Tv469U1 dlJuEkiSi8vrYSa2kM3sKMoG3d6qIhiszKSeogzY= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Willy Tarreau Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] tools/nolibc: remove LINUX_REBOOT_ constants Message-ID: References: <20230428-nolibc-reboot-v1-1-0bca02d20ba6@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,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 2023-05-02 08:32:15+0200, Willy Tarreau wrote: > On Fri, Apr 28, 2023 at 05:52:11PM +0200, Thomas Weißschuh wrote: > > The same constants and some more have been exposed to userspace via > > linux/reboot.h for a long time. > > > > To avoid conflicts and trim down nolibc a bit drop the custom > > definitions. > > For me it breaks the build when including nolibc directly, so most > likely we need to include certain files: Indeed, sorry no idea how I missed that. > In file included from /g/public/linux/master/tools/include/nolibc/nolibc.h:99, > from : > /g/public/linux/master/tools/include/nolibc/sys.h: In function 'reboot': > /g/public/linux/master/tools/include/nolibc/sys.h:972:30: error: 'LINUX_REBOOT_MAGIC1' undeclared (first use in this function) > 972 | int ret = sys_reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, 0); > | ^~~~~~~~~~~~~~~~~~~ > /g/public/linux/master/tools/include/nolibc/sys.h:972:30: note: each undeclared identifier is reported only once for each function it appears in > > I suspect it might be like the S_* macros for stat() that we had to > guard against. What build conflict did you meet ? I would like as well > to redefine the least possible and if we can make sure to fix the > conflict efficiently without breaking code, that would be better. The conflict looks like this: In file included from nolibc-test.c:18: sysroot/x86/include/linux/reboot.h:10: warning: "LINUX_REBOOT_MAGIC2" redefined 10 | #define LINUX_REBOOT_MAGIC2 672274793 | In file included from sysroot/x86/include/nolibc.h:98, from sysroot/x86/include/errno.h:26, from sysroot/x86/include/stdio.h:14, from nolibc-test.c:15: ... and all the other ones. The following trivial fix on top of my patch would fix the problem: diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 5d624dc63a42..9d27131c224e 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -21,6 +21,7 @@ #include #include // for O_* and AT_* #include // for statx() +#include // for LINUX_REBOOT_* #include "arch.h" #include "errno.h" Want me to send a v2 or will you fix it up on your side?