Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp312585rwb; Fri, 4 Aug 2023 13:10:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7to6hY+hTdbIVl5EFofnbs0eX32D7RasSdO2kaELsCOq+d214YwHNJUNvUxDN1a9jA4we X-Received: by 2002:a17:907:7814:b0:99b:f534:9bae with SMTP id la20-20020a170907781400b0099bf5349baemr2162891ejc.30.1691179815756; Fri, 04 Aug 2023 13:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691179815; cv=none; d=google.com; s=arc-20160816; b=y91mCtZBGmxS37tMI8Kq0Dd7mWgch6ShHeI/OfY5+3Iu6gST1ezcbqucdc5tiD/fd4 hACEz28VVbgq2M+s1G4+WXKT2f09ScOAsNNL3gvHGaHBjyb9brl6ZUt+zBHK2WJb4KjH 6D7b/+0v2LeFRPcZqKI/6ol3KrwySk3ZoBxf445lzqAm89iOeu51w83TQDV+QIwI+TNv cexZQ8U8er7nkw0YFBuuBnkSyag/FQ4Jytv5+PCKK2c/yMBXTaVg+NEYeATzUgX1+jjY OOxS1miHhOxbWWQu/NQ8WJMc6YvusMNK5eAEYTdFQvHWKFLJxjmwDvQNPBojPH0FI+6e Klrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=/+Wa2itw0uGzZLqJP+TeM+7Y+hin0GT8at7gBeqTs7c=; fh=+qsfJeOpObjlcHwPCCRUHa7oNQ6bwHfvQ+ffaAd9lGE=; b=W7yaw8xC29ULuMakAfYsJxuGl98QWH/dQGJgqRoIx6zFtZi7Tvy2ttG3/hBs7YFpWh oKns8XCWNqIm+OWR7ncSuxuVMIuggUtbTn4CkvGVzDHQBPeZ7DkZjDelcVZh74OxBXk8 VkhbkToEfnpQm7eoDZqBOHMdbxVlCjpgA3wE70YrxRA5s1mbXjcY+VzNXwwEzwS5KI/A BaB13C/JQbwGMduunxzNfruGjzCUznzTOSy1FO0xja0B/ZARVDXh47gA6NfnYtwUAYsw Z/cNVXhsMi7jXDMlGflj3bYbWLWmQurt/GO097opaq/00ARRD5HzgJ3pz0TsIC4Qef0P t85g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cknJ4MVW; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a170906180a00b009924c43105csi1968950eje.94.2023.08.04.13.09.50; Fri, 04 Aug 2023 13:10:15 -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=cknJ4MVW; 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 S230197AbjHDTXH (ORCPT + 99 others); Fri, 4 Aug 2023 15:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230466AbjHDTXE (ORCPT ); Fri, 4 Aug 2023 15:23:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E861BE; Fri, 4 Aug 2023 12:23:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 40E086211E; Fri, 4 Aug 2023 19:23:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17DE8C433C7; Fri, 4 Aug 2023 19:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691176981; bh=XOri76sJpkz03uX4PCxdz17la0oq/zwN78Dx+ZuWn6E=; h=From:Date:Subject:To:Cc:From; b=cknJ4MVW9GsFmnvCz3QefAmehTF3taU0s4Xel4PtbztuLCO5PdCcUmK7JKxJxgsOa upoLQVjMQzBMc1rhOK74sD/XW62yXiZ9hmxlTsBwr1byTn1f6S97GTXBLdx71fb+5f +21Qi/KS5pjHu/j3hbyuthyGMv2a/OXaCBUMt2cA8uDLZigXY6GZSLAauGA4bYwFts VHD1XriK9QT0qZsBV8HUflipU5/Mxymp3wCvWiOZPUitwGlpo8ds5xxATieNfl/Xdj BUUGHGmb0AZuiASPLSj/Fia9EpH66s+vgVPtrDLl408o+QlzNOP44zeEaB9hE436cw 6q0aXxoRJMaKA== From: Mark Brown Date: Fri, 04 Aug 2023 20:22:11 +0100 Subject: [PATCH] selftests/rseq: Fix build with undefined __weak MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230804-kselftest-rseq-build-v1-1-015830b66aa9@kernel.org> X-B4-Tracking: v=1; b=H4sIAOJPzWQC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2MDCwMT3ezi1Jy0ktTiEt2i4tRC3aTSzJwUXcsUU2NzSxOjJMOUVCWg1oK i1LTMCrCx0bG1tQB6lBNIZgAAAA== To: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Shuah Khan , Paolo Bonzini , Sean Christopherson Cc: Aaron Lewis , stable@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-034f2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2410; i=broonie@kernel.org; h=from:subject:message-id; bh=XOri76sJpkz03uX4PCxdz17la0oq/zwN78Dx+ZuWn6E=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkzVASILAQQzthU6vaozHnSSJrqoeklAkR7/lneg1V 6U6HkuWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZM1QEgAKCRAk1otyXVSH0K8uB/ 9fP4U1ure2KD6wbesdwvU7rvh7aeJT6lOCKZlUp4ZxY/AkPXdFeUZIpMLptqk7UQn7aFHJT2+flbJ2 pYnATX/W1banTs6c7waPruBz9cVg5cJJW7nYa3MCY3ErHm4uluhA9il3c/yQ1iZEJrg9twyiYEyoNi m1bGgzcNzXrJqgj5hYEwdOMbkCSDDSpw1H+drp6UZtJoS1+3jRbjhIDNdf9hqgKaymqslePKekFqld 5gnqhQ5dwDx7xE59L3b1BRC8B/L7U8zPPOcPl8D/WjbRQyRsa8QN8pTuuooCjplNsx6AzyEg9PAF6q KjqCB5hxFqh8Rf4U05Ioerdz5N1Z7t X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Commit 3bcbc20942db ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+") which is now in Linus' tree introduced uses of __weak but did nothing to ensure that a definition is provided for it resulting in build failures for the rseq tests: rseq.c:41:1: error: unknown type name '__weak' __weak ptrdiff_t __rseq_offset; ^ rseq.c:41:17: error: expected ';' after top level declarator __weak ptrdiff_t __rseq_offset; ^ ; rseq.c:42:1: error: unknown type name '__weak' __weak unsigned int __rseq_size; ^ rseq.c:43:1: error: unknown type name '__weak' __weak unsigned int __rseq_flags; Fix this by using the definition from tools/include compiler.h. Fixes: 3bcbc20942db ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+") Signed-off-by: Mark Brown --- It'd be good if the KVM testing could include builds of the rseq selftests, the KVM tests pull in code from rseq but not the build system which has resulted in multiple failures like this. --- tools/testing/selftests/rseq/Makefile | 4 +++- tools/testing/selftests/rseq/rseq.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile index b357ba24af06..7a957c7d459a 100644 --- a/tools/testing/selftests/rseq/Makefile +++ b/tools/testing/selftests/rseq/Makefile @@ -4,8 +4,10 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) CLANG_FLAGS += -no-integrated-as endif +top_srcdir = ../../../.. + CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \ - $(CLANG_FLAGS) + $(CLANG_FLAGS) -I$(top_srcdir)/tools/include LDLIBS += -lpthread -ldl # Own dependencies because we only want to build against 1st prerequisite, but diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index a723da253244..96e812bdf8a4 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -31,6 +31,8 @@ #include #include +#include + #include "../kselftest.h" #include "rseq.h" --- base-commit: 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 change-id: 20230804-kselftest-rseq-build-9d537942b1de Best regards, -- Mark Brown