Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3638553rwl; Sun, 2 Apr 2023 11:49:00 -0700 (PDT) X-Google-Smtp-Source: AKy350aiZZXyqta9V9N2y7PL31YLVG0ApXTxDBID1jeyDJae2aAeP40+xmkIwmRhYoRoDPCKNAG9 X-Received: by 2002:a17:903:11c3:b0:1a2:9994:c340 with SMTP id q3-20020a17090311c300b001a29994c340mr14007067plh.46.1680461339927; Sun, 02 Apr 2023 11:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680461339; cv=none; d=google.com; s=arc-20160816; b=VpP2ZdYbgspWtUR6pBgfYa8qhQtsS+qGpoHKdXvMJeQ0b8p7iGJx1pCCzTPSyL94eg zSuvUgVe6Tx58AM189l+O43yMEbdkZZiyAwdx00tMPdj9KI3M/3ZA2/1F6Sgb36IovUb +KahFio1P0/ewfHI+3loajalBGara0Ns5D57xdaoRQBdP9JS112AJKa/U40AfGEzLSyA Ais/YUT92frdjPdywK7vWrCnmxI18fJa7XKtAWKFVUyoNPIPWYZ7TXngYSWHujTsfQRt f0hnE1C7r8qGMIKpEW2x1BNpUhER4441j3ryBj2lTSNxbiq2uWYA0ACy18IA+KMuiVc0 E6MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rPhCrC3CjbQN1Dg1Zqq7ctyFWoqoF1IYyUN7/zC9icI=; b=Wi9DR1aq4836/HgPH/eE4s1dYFWHn+od9w0pJK1rXhQGebL7ta0BhhGPmJ2q+GpmMB kAaod1iNILMZMSQSfUdumFhMST6pAnubFo0MLsBLox14OS3S/CRrmtfjMWZfX8ZaIC4h W2LBNJzQjakLwWmxLeh6wDkmKUb003boiFyRdUdAu96zGaFOHCbEizoryW+j5adxJrwQ G9fybcyIYu1aFg1zcVWWOcbz1CT2JykVdKxNsMJBr64Kw5CIiD0OOq3Sg5YDXIX7j7gQ uUPsBqrTGPUy1OKKgZu7ovdodHCXLUadxoaoFL6VFXWqoq11DwZSa72ve+RWxArtLIXr xcNQ== 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 c20-20020a170902c1d400b0019e95180a08si6814346plc.59.2023.04.02.11.48.46; Sun, 02 Apr 2023 11:48:59 -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 S231144AbjDBSsV (ORCPT + 99 others); Sun, 2 Apr 2023 14:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230470AbjDBSsT (ORCPT ); Sun, 2 Apr 2023 14:48:19 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6ECA65B6 for ; Sun, 2 Apr 2023 11:48:18 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 332ImDkS012487; Sun, 2 Apr 2023 20:48:13 +0200 From: Willy Tarreau To: "Paul E. McKenney" Cc: linux@weissschuh.net, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 1/4] tools/nolibc: add libc-test binary Date: Sun, 2 Apr 2023 20:48:03 +0200 Message-Id: <20230402184806.12440-2-w@1wt.eu> X-Mailer: git-send-email 2.17.5 In-Reply-To: <20230402184806.12440-1-w@1wt.eu> References: <20230402184806.12440-1-w@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 From: Thomas Weißschuh This can be used to easily compare the behavior of nolibc to the system libc. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau --- tools/testing/selftests/nolibc/.gitignore | 1 + tools/testing/selftests/nolibc/Makefile | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/tools/testing/selftests/nolibc/.gitignore b/tools/testing/selftests/nolibc/.gitignore index 4696df589d68..52f613cdad54 100644 --- a/tools/testing/selftests/nolibc/.gitignore +++ b/tools/testing/selftests/nolibc/.gitignore @@ -1,4 +1,5 @@ /initramfs/ +/libc-test /nolibc-test /run.out /sysroot/ diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index bbce57420465..0cbe13809b37 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -94,6 +94,7 @@ help: @echo " help this help" @echo " sysroot create the nolibc sysroot here (uses \$$ARCH)" @echo " nolibc-test build the executable (uses \$$CC and \$$CROSS_COMPILE)" + @echo " libc-test build an executable using the compiler's default libc instead" @echo " run-user runs the executable under QEMU (uses \$$ARCH, \$$TEST)" @echo " initramfs prepare the initramfs with nolibc-test" @echo " defconfig create a fresh new default config (uses \$$ARCH)" @@ -128,6 +129,9 @@ nolibc-test: nolibc-test.c sysroot/$(ARCH)/include $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ \ -nostdlib -static -Isysroot/$(ARCH)/include $< -lgcc +libc-test: nolibc-test.c + $(QUIET_CC)$(CC) -o $@ $< + # qemu user-land test run-user: nolibc-test $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || : @@ -159,6 +163,8 @@ clean: $(Q)rm -rf sysroot $(call QUIET_CLEAN, nolibc-test) $(Q)rm -f nolibc-test + $(call QUIET_CLEAN, libc-test) + $(Q)rm -f libc-test $(call QUIET_CLEAN, initramfs) $(Q)rm -rf initramfs $(call QUIET_CLEAN, run.out) -- 2.17.5