From patchwork Mon Jun 12 20:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 106881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp134356vqr; Mon, 12 Jun 2023 14:09:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ474TqDdLsZNC8ZbZiTZ+raR5rfgksAsPafdD5amalBpSiPG7/zgO7MWqyBt5czdlvb/xjL X-Received: by 2002:a17:907:25c8:b0:978:4d7c:1db9 with SMTP id ae8-20020a17090725c800b009784d7c1db9mr10388623ejc.39.1686604194007; Mon, 12 Jun 2023 14:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686604193; cv=none; d=google.com; s=arc-20160816; b=Ha4BEUMRUOvOt3EKbQ8Twf+HK9cDYBiScl1cISKPr4yucXZm5/95Wz1e2HIdtXxCdr 7amlL9C7Whb5fC2UWP94KBO1K8iLQIa/5j8ijhVQ+YBbY+E+ajpVbXEVgaLkWqP/S61W QZFxpoa9XABk7NHSAh4iiCVP4WkY21zWvXCn1rHpiuL8qWrz1h/8i36e9+WcPJoG5EKR Xjgwct1s1Srfls3NFqnatdMvLSU2G28b9QqGWlcfl7P2fz2glz7WTYHvQGX7f7aba9Gg FlYAOZb6ZlxNaFVVdnU+1FSBGD/03Y6TCE5gcdcYWB6tkOn61XpG0VLQnJtifGtTaO9L e+6A== 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 :dkim-signature; bh=qtX82d1rJQnhMsYGPeR74hOitr4ivHlngK9QrIw5Qtg=; b=wdHzwfEbO9YxbcP6r7X3GaqQhbupDHPoEYTgd6tjTXLBnol7KTjzuuPtITIpQLPFm9 fQXNvsJaY91gtQ4Zy5BgtA/32v2CF12C4GRHN1sPsIht0+DrLL19Jjl6TEHqz82HtGMb Tmor9hyWz2O9O4ZQoVRP+K9VW5RuCNvykoTjjqY5wVwuzTdTz0gyDXtcUBoFXZIl16z7 ubsLZX/Ur7oVB3CrE9eFR8FXm9vOLYiK9bZdeK7eIHMFbTSrcEEptqC8JhACzRV9D4UP zqsznIpMTLssiiTn+j/1GjymVWOTXhNG6+MrXk0UyZyb1ydosUVyqS6AxaicZhEhCFm1 BFLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a6fYIoJG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020aa7c991000000b00514bdde913csi6329182edt.215.2023.06.12.14.09.28; Mon, 12 Jun 2023 14:09:53 -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=@kernel.org header.s=k20201202 header.b=a6fYIoJG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237269AbjFLUrh (ORCPT + 99 others); Mon, 12 Jun 2023 16:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234860AbjFLUqz (ORCPT ); Mon, 12 Jun 2023 16:46:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E9651FC3 for ; Mon, 12 Jun 2023 13:46:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D3D2C62B22 for ; Mon, 12 Jun 2023 20:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39158C4339C; Mon, 12 Jun 2023 20:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686602716; bh=C0Q9VdND465nWzuW7Df4EbGHS4KOUK1apvejVVAdFFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6fYIoJGMAm3UTo2yCUg3fgy7OIk/4lbO/m4uQ+SBzI55BlWwzUSeTUQ+cGFjMAdj 44ZI6dKQ65olNT7ZqX4pTfbluehPWrbtlYjrRsei2mKkt9RctqwK4TD/vH51IYjBV2 BHPQiBJgrzivsCMsyrT5XyaJuBT2f2wAHec/mtlLxd4/awVHi4aXr3TdqzFJdqnAIq SF9WmLkwiIJcB8ubljzjIKj5Dos88OKP62o5nH1sC5IlgTmPxyk0fylzuVIytR3dIU mx/2S1gM5enhpoUd7TNnCTa7UNdVtgrmJ5GpBn0VcFPPOR0DhqUS2CLQv10yJPp/Ag cMiEj+pPyq9vw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B1F69CE3A1E; Mon, 12 Jun 2023 13:45:15 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, =?utf-8?q?Thomas_?= =?utf-8?q?Wei=C3=9Fschuh?= , Willy Tarreau , "Paul E . McKenney" Subject: [PATCH v2 nolibc 04/53] tools/nolibc: add libc-test binary Date: Mon, 12 Jun 2023 13:44:25 -0700 Message-Id: <20230612204514.292087-4-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> References: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768532679401473608?= X-GMAIL-MSGID: =?utf-8?q?1768532679401473608?= 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 Signed-off-by: Paul E. McKenney --- 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)