Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2228380rwl; Thu, 6 Apr 2023 07:31:09 -0700 (PDT) X-Google-Smtp-Source: AKy350bvUjyWgMf7CA3KMCK9ssr0E4GErW0rE5zNcQYnlL6/bmMx6CwIKokBMLOHtAc8+AqoaVbz X-Received: by 2002:a17:907:2113:b0:886:7e24:82eb with SMTP id qn19-20020a170907211300b008867e2482ebmr6495896ejb.21.1680791469449; Thu, 06 Apr 2023 07:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680791469; cv=none; d=google.com; s=arc-20160816; b=PlP7mYnLe5xpIfsPJXrhDUn0qrWW4UjnzpTqPUDnc3RFj6Qfqg4pcYeqydsSxfhAqQ TWM9zInssWmCd1nlsQdA+sLtLVoj8RSvKj3psG+Un879T+7a0px8JaxcKG0WeCqOaE1F /O9lJmOz/edWPFAmGJEhMFQCWXllQroElv3a+0gbQYIgO454/esF6Air9Cc3+r85+cZk g+eUWGB00wmIyZuh7oj231JAdwxL0lm4ENWmWTid2WPrPcDvf1cVhN8bCDUA5x8eOpqG TC0NrhhStXp1lG8oDJ+Bc4MfBK/XeYlwSwWpdjWNY0UxkNHMMiLegZFRrzaXCk1t5L4Q Mc3g== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=oAU5kbcmyswn2M1ZQ7CK6DlCpAOA7VANviFP6L6CeeM=; b=Hzl9XVZiAezDhJr9G1+A2ec2R9lhunS35jr8HlzxTKPFQh2pimODs7V+byq/kdEz3y rQbig33FI04z8iyP/u6WP1nJOlr8lK97TEdSd1ogGV+o4Qy+3S/3De8jqfnTpBkqIYp1 yqigt4d3L23zfh17/Bi316Lx9wyBJtxBk66CPgn6UEa6Vxk1xT4MEHPYAExh9hzrfZ6i prb7h5REEnJFC2/bZVAb6dFDU0XphA7z4/mg688ewW12BKTDAtNy2E2KKsrbPbI5XOqs u3firkonnq0AVQl0DretfzxRiw8O83/hxOxcQb9eYAMORA/W+mbGp4IzzAoQE+R98BAj pCKQ== 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 h16-20020a170906855000b009318f826868si1288995ejy.640.2023.04.06.07.30.41; Thu, 06 Apr 2023 07:31:09 -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 S237453AbjDFOVR (ORCPT + 99 others); Thu, 6 Apr 2023 10:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjDFOVP (ORCPT ); Thu, 6 Apr 2023 10:21:15 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 49F6B86AC; Thu, 6 Apr 2023 07:21:12 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 336EKT7g003156; Thu, 6 Apr 2023 16:20:29 +0200 Date: Thu, 6 Apr 2023 16:20:29 +0200 From: Willy Tarreau To: Mark Brown Cc: Shuah Khan , Catalin Marinas , Will Deacon , "Paul E. McKenney" , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] kselftest: Support nolibc Message-ID: References: <20230405-kselftest-nolibc-v1-0-63fbcd70b202@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405-kselftest-nolibc-v1-0-63fbcd70b202@kernel.org> X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Hi Mark, On Thu, Apr 06, 2023 at 02:56:28PM +0100, Mark Brown wrote: > At present the kselftest header can't be used with nolibc since it makes > use of vprintf() which is not available in nolibc and seems like it would > be inappropriate to implement given the minimal system requirements and > environment intended for nolibc. In fact we already have vfprintf(), and printf() is based on it, so wouldn't it just be a matter of adding vprintf() that calls vfprintf() for your case ? Maybe just something like this : static int vprintf(const char *fmt, va_list args) { return vfprintf(stdout, fmt, args); } It's possible I'm missing something, but it's also possible you didn't find vfprintf() which is why I prefer to raise my hand ;-) > This has resulted in some open coded > kselftests which use nolibc to test features that are supposed to be > controlled via libc and therefore better exercised in an environment with > no libc. Yeah that's ugly. In nolibc-test we now have two build targets so that we can more easily verify the compatibility between the default libc and nolibc, so my recommendation would be to stick to a common subset of both libcs, but not to rely on nolibc-specific stuff that could make tests harder to debug. Regards, Willy